Переглянути джерело

corrected some bugs with the - (blank) rule

master
Nathan R 3 роки тому
джерело
коміт
a0ce191245
1 змінених файлів з 20 додано та 17 видалено
  1. +20
    -17
      ccmeta.leg

+ 20
- 17
ccmeta.leg Переглянути файл

@ -1972,22 +1972,6 @@ ids = i:id { listWith(i) }
( c:COMMA i:id { listAppend2(c, i) }
)* { $$= listEnd() }
- = < Space* > { if (yyleng && $$) setComment($$, newComment(yytext)) }
Space = Blank | Comment | EOL | Directive
| "__extension__" &{gnu} { icol += 13 }
Blank = ( [\003-\010] | '\013' | '\f' | [\016-\037] | [\177-\377] | ' ' ) { ++icol }
| '\t' { icol= (icol + 8) & ~7 }
EOL = ( "\r\n" | '\n' | '\r' ) { ++irow; icol= 0 }
Comment = "/*" ( !"*/" (EOL | Any) )* "*/"
| "//" ( ![\n\r] Any )* EOL
Directive = "#" (!EOL .)*
Any = . { ++icol }
###
@ -2105,8 +2089,27 @@ _FLOAT128 = '_Float128' !IDREST &{gnu} { $$= newToken("_Float1
#--------------------------------------------- Common rules ----------------------------------------------#
- = (blank | comment)*
- = (blank | comment)* &{lang == META}
| < Space* > &{lang == C} { if (yyleng && $$) setComment($$, newComment(yytext)) }
#| C rules
Space = Blank | Comment | EOL | Directive
| "__extension__" &{gnu} { icol += 13 }
Blank = ( [\003-\010] | '\013' | '\f' | [\016-\037] | [\177-\377] | ' ' ) { ++icol }
| '\t' { icol= (icol + 8) & ~7 }
EOL = ( "\r\n" | '\n' | '\r' ) { ++irow; icol= 0 }
Comment = "/*" ( !"*/" (EOL | Any) )* "*/"
| "//" ( ![\n\r] Any )* EOL
Directive = "#" (!EOL .)*
Any = . { ++icol }
#| Meta rules
blank = space | eol
space = [ \t]
eol = ( "\n""\r"*

Завантаження…
Відмінити
Зберегти