disallow -0 year
parent
7894e8eee7
commit
858159a4f5
|
@ -690,7 +690,7 @@ string eofbuff;
|
|||
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);
|
||||
return token::DATE_NUMBER;
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ typedef Macro::parser::token token;
|
|||
SPC [ \t]+
|
||||
EOL (\r)?\n
|
||||
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() */
|
||||
|
|
Loading…
Reference in New Issue