disallow -0 year
parent
808d6ae1ad
commit
9c6ee78388
|
@ -690,7 +690,7 @@ string eofbuff;
|
||||||
return token::INT_NUMBER;
|
return token::INT_NUMBER;
|
||||||
}
|
}
|
||||||
|
|
||||||
<DYNARE_STATEMENT,DYNARE_BLOCK>dates[[:space:]]*\([[:space:]]*\'[[:space:]]*-?[0-9]+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4][0-9]|5[0-2]))[[:space:]]*\'[[:space:]]*\) {
|
<DYNARE_STATEMENT,DYNARE_BLOCK>dates[[:space:]]*\([[:space:]]*\'[[:space:]]*(-[1-9][0-9]*|[0-9]+)([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4][0-9]|5[0-2]))[[:space:]]*\'[[:space:]]*\) {
|
||||||
yylval->string_val = new string(yytext);
|
yylval->string_val = new string(yytext);
|
||||||
return token::DATE_NUMBER;
|
return token::DATE_NUMBER;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ typedef Macro::parser::token token;
|
||||||
SPC [ \t]+
|
SPC [ \t]+
|
||||||
EOL (\r)?\n
|
EOL (\r)?\n
|
||||||
CONT \\\\
|
CONT \\\\
|
||||||
DATE -?[0-9]+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4][0-9]|5[0-2]))
|
DATE (-[1-9][0-9]*|[0-9]+)([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4][0-9]|5[0-2]))
|
||||||
|
|
||||||
%%
|
%%
|
||||||
/* Code put at the beginning of yylex() */
|
/* Code put at the beginning of yylex() */
|
||||||
|
|
Loading…
Reference in New Issue