package xm::code::cxx;
use xm::o;
use xm::code::vars;
use xm::code::func;
"
highlight sourcecode - C++ mode
"}
$LANGUAGE{'c++'} = {
'filename' => '\\.(c(c|pp|xx)|h(h|pp|xx)|C(C|PP|XX)?|H(H|PP|XX)?|i)$',
'regex' => '',
'patterns' => [
{
'name' => 'doc comment',
'regex' => '/\\*\\*.*?\\*/',
'style' => 'doc comment',
'childregex' => []
},
{
'name' => 'comment',
'regex' => '/\\*.*?\\*/',
'style' => 'comment',
'childregex' => []
},
{
'name' => 'cplus comment',
'regex' => '//.*?$',
'style' => 'comment',
'childregex' => []
},
{
'name' => 'string',
'regex' => '""|"\\\\\\\\"|".*?([^\\\\](\\\\\\\\)*)"',
'style' => 'string',
'childregex' => [
{
'name' => 'esc character',
'regex' => '\\\\.',
'style' => 'esc character',
'childregex' => []
}
]
},
{
'name' => 'preprocessor line',
'regex' => '^[ \\t]*#.*?$',
'style' => 'preprocessor',
'childregex' => [
{
'name' => 'string',
'regex' => '""|".*?([^\\\\](\\\\\\\\)*)"|"\\\\\\\\"',
'style' => 'string',
'childregex' => [
{
'name' => 'esc character',
'regex' => '\\\\.',
'style' => 'esc character',
'childregex' => []
}
]
},
{
'name' => '<files>',
'regex' => '<.*?>',
'style' => 'string',
'childregex' => []
},
{
'name' => 'comment',
'regex' => '[^/]/\\*.*?\\*/',
'style' => 'comment',
'childregex' => []
},
{
'name' => 'cplus comment',
'regex' => '//.*?$',
'style' => 'comment',
'childregex' => []
}
]
},
{
'name' => 'character constant',
'regex' => '\'(\\\\)?.\'',
'style' => 'character',
'childregex' => [
{
'name' => 'esc character',
'regex' => '\\\\.',
'style' => 'esc character',
'childregex' => []
}
]
},
{
'name' => 'numeric constant',
'regex' => '\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\\b',
'style' => 'numeric',
'childregex' => []
},
{
'name' => 'storage keyword',
'regex' => '\\b(class|typename|typeid|template|friend|virtual|inline|explicit|operator|overload|public|private|protected|const|extern|auto|register|static|mutable|unsigned|signed|volatile|char|double|float|int|long|short|bool|wchar_t|void|typedef|struct|union|enum)\\b',
'style' => 'reserved word',
'childregex' => [],
},
{
'name' => 'keyword',
'regex' => '\\b(new|delete|this|return|goto|if|else|case|default|switch|break|continue|while|do|for|catch|throw|sizeof|true|false|namespace|using|dynamic_cast|static_cast|reinterpret_cast)\\b',
'style' => 'reserved word',
'childregex' => []
},
{
'name' => 'braces',
'regex' => '[\\{\\}]',
'style' => 'braces',
'childregex' => []
},
{
'name' => 'symbols',
'regex' => '([\\*\\-\\+=:;%&\\|<>\\(\\)\\[\\]!])',
'style' => 'symbol',
'childregex' => []
},
{
'name' => 'identifiers',
'regex' => '([a-zA-Z_][a-zA-Z_0-9]*)',
'style' => 'identifier',
'childregex' => []
}
]
};
$LANGUAGE{'cc'} = $LANGUAGE{'c++'};
$LANGUAGE{'cpp'} = $LANGUAGE{'c++'};
$LANGUAGE{'cxx'} = $LANGUAGE{'c++'};
return xm::code::func::DO($_[0],$LANGUAGE{cxx}{patterns});
}
return xm::o::args_stdin(@_, DESC); }
return DO(xm::o::args_stdin(@_, DESC)); }
1;