summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/code.l30
-rw-r--r--src/commentcnv.l34
2 files changed, 62 insertions, 2 deletions
diff --git a/src/code.l b/src/code.l
index 6627498..b3e7e4b 100644
--- a/src/code.l
+++ b/src/code.l
@@ -402,6 +402,32 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}
RAWBEGIN (u|U|L|u8)?R\"[^ \t\(\)\\]{0,16}"("
RAWEND ")"[^ \t\(\)\\]{0,16}\"
+ //Note same defines in commentcnv.l
+DECIMAL_INTEGER [1-9][0-9']*[0-9]?[uU]?[lL]?[lL]?
+HEXADECIMAL_INTEGER "0"[xX][0-9a-zA-Z']+[0-9a-zA-Z]?
+OCTAL_INTEGER "0"[0-7][0-7']+[0-7]?
+BINARY_INTEGER "0"[bB][01][01']*[01]?
+INTEGER_NUMBER {DECIMAL_INTEGER}|{HEXADECIMAL_INTEGER}|{OCTAL_INTEGER}|{BINARY_INTEGER}
+
+FP_SUF [fFlL]
+
+DIGIT_SEQ [0-9][0-9']*[0-9]?
+FRAC_CONST {DIGIT_SEQ}"."|{DIGIT_SEQ}?"."{DIGIT_SEQ}
+FP_EXP [eE][+-]?{DIGIT_SEQ}
+DEC_FP1 {FRAC_CONST}{FP_EXP}?{FP_SUF}?
+DEC_FP2 {DIGIT_SEQ}{FP_EXP}{FP_SUF}
+
+HEX_DIGIT_SEQ [0-9a-fA-F][0-9a-fA-F']*[0-9a-fA-F]?
+HEX_FRAC_CONST {HEX_DIGIT_SEQ}"."|{HEX_DIGIT_SEQ}?"."{HEX_DIGIT_SEQ}
+BIN_EXP [pP][+-]?{DIGIT_SEQ}
+HEX_FP1 "0"[xX]{HEX_FRAC_CONST}{BIN_EXP}{FP_SUF}?
+HEX_FP2 "0"[xX]{HEX_DIGIT_SEQ}{BIN_EXP}{FP_SUF}?
+
+FLOAT_DECIMAL {DEC_FP1}|{DEC_FP2}
+FLOAT_HEXADECIMAL {HEX_FP1}|{HEX_FP2}
+FLOAT_NUMBER {FLOAT_DECIMAL}|{FLOAT_HEXADECIMAL}
+NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
+
%option noyywrap
%x SkipString
@@ -1245,6 +1271,10 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
yyextra->inForEachExpression = FALSE;
BEGIN( SkipString );
}
+<FuncCall,Body,MemberCall,MemberCall2,SkipInits,InlineInit>{NUMBER} { //Note similar code in commentcnv.l
+ if (yyextra->lang!=SrcLangExt_Cpp) REJECT;
+ yyextra->code->codify(yytext);
+ }
<FuncCall,Body,MemberCall,MemberCall2,SkipInits,InlineInit>\' {
startFontClass(yyscanner,"stringliteral");
yyextra->code->codify(yytext);
diff --git a/src/commentcnv.l b/src/commentcnv.l
index a7d74ef..727c515 100644
--- a/src/commentcnv.l
+++ b/src/commentcnv.l
@@ -142,12 +142,42 @@ MAILADR ("mailto:")?[a-z_A-Z0-9.+-]+"@"[a-z_A-Z0-9-]+("."[a-z_A-Z0-9\-]+)+[a-z
%x CondLine
%x ReadAliasArgs
+ //Note same defines in code.l
+DECIMAL_INTEGER [1-9][0-9']*[0-9]?[uU]?[lL]?[lL]?
+HEXADECIMAL_INTEGER "0"[xX][0-9a-zA-Z']+[0-9a-zA-Z]?
+OCTAL_INTEGER "0"[0-7][0-7']+[0-7]?
+BINARY_INTEGER "0"[bB][01][01']*[01]?
+INTEGER_NUMBER {DECIMAL_INTEGER}|{HEXADECIMAL_INTEGER}|{OCTAL_INTEGER}|{BINARY_INTEGER}
+
+FP_SUF [fFlL]
+
+DIGIT_SEQ [0-9][0-9']*[0-9]?
+FRAC_CONST {DIGIT_SEQ}"."|{DIGIT_SEQ}?"."{DIGIT_SEQ}
+FP_EXP [eE][+-]?{DIGIT_SEQ}
+DEC_FP1 {FRAC_CONST}{FP_EXP}?{FP_SUF}?
+DEC_FP2 {DIGIT_SEQ}{FP_EXP}{FP_SUF}
+
+HEX_DIGIT_SEQ [0-9a-fA-F][0-9a-fA-F']*[0-9a-fA-F]?
+HEX_FRAC_CONST {HEX_DIGIT_SEQ}"."|{HEX_DIGIT_SEQ}?"."{HEX_DIGIT_SEQ}
+BIN_EXP [pP][+-]?{DIGIT_SEQ}
+HEX_FP1 "0"[xX]{HEX_FRAC_CONST}{BIN_EXP}{FP_SUF}?
+HEX_FP2 "0"[xX]{HEX_DIGIT_SEQ}{BIN_EXP}{FP_SUF}?
+
+FLOAT_DECIMAL {DEC_FP1}|{DEC_FP2}
+FLOAT_HEXADECIMAL {HEX_FP1}|{HEX_FP2}
+FLOAT_NUMBER {FLOAT_DECIMAL}|{FLOAT_HEXADECIMAL}
+NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
+
%%
-<Scan>[^"'!\/\n\\#,\-]* { /* eat anything that is not " / , or \n */
+<Scan>{NUMBER} { //Note similar code in code.l
+ if (yyextra->lang!=SrcLangExt_Cpp) REJECT;
+ copyToOutput(yyscanner,yytext,(int)yyleng);
+ }
+<Scan>[^"'!\/\n\\#,\-=; \t]* { /* eat anything that is not " / , or \n */
copyToOutput(yyscanner,yytext,(int)yyleng);
}
-<Scan>[,] { /* eat , so we have a nice separator in long initialization lines */
+<Scan>[,= ;\t] { /* eat , so we have a nice separator in long initialization lines */
copyToOutput(yyscanner,yytext,(int)yyleng);
}
<Scan>"\"\"\""! { /* start of python long comment */