X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fparser.re;h=81005f2c07acd238bcecd8fde42742ab6f83000b;hp=0eae9439b88c4f6f4f5b8fda20eec78d437a672c;hb=3137da963d298c73ce3bc858874fdfc87fa941b7;hpb=207ff7bc85e967235f0ad1ffbf47c0f85f375063 diff --git a/src/parser.re b/src/parser.re index 0eae943..81005f2 100644 --- a/src/parser.re +++ b/src/parser.re @@ -144,21 +144,6 @@ void PSI_ParserFree(PSI_Parser **P) return t; \ } while(1) -/* DIGIT = [0-9] - DIGITS = DIGIT+ - DECIMALS = (+|-)? DIGIT* "." - digits ::= digits DIGIT. - decimals ::= digits DOT digits. - decimals ::= DOT digits. - decimals ::= digits DOT. - number ::= digits. - number ::= PLUS digits. - number ::= MINUS digits. - number ::= decimals. - number ::= MINUS decimals. - number ::= PLUS decimals. - -*/ token_t PSI_ParserScan(PSI_Parser *P) { for (;;) { @@ -179,7 +164,7 @@ token_t PSI_ParserScan(PSI_Parser *P) QUOTED_STRING = "\"" ([^\"])+ "\""; NUMBER = [+-]? [0-9]* "."? [0-9]+ ([eE] [+-]? [0-9]+)?; - "#" .* "\n" { ++P->line; RETURN(PSI_T_COMMENT);} + ("#"|"//") .* "\n" { ++P->line; continue;} "(" {RETURN(PSI_T_LPAREN);} ")" {RETURN(PSI_T_RPAREN);} ";" {RETURN(PSI_T_EOS);}