@@ -17,73 +17,73 @@ BR \r\n|\n|\r
17
17
<action >" {" yy.depth++; return '{'
18
18
<action>"}" yy.depth == 0 ? this.begin(' trail' ) : yy.depth--; return ' }'
19
19
20
- <conditions >{NAME } return ' NAME'
21
- <conditions >" >" this .popState(); return ' >'
22
- <conditions >" ," return ' ,'
23
- <conditions >" *" return ' *'
20
+ <conditions >{NAME } return ' NAME' ;
21
+ <conditions >" >" this .popState(); return ' >' ;
22
+ <conditions >" ," return ' ,' ;
23
+ <conditions >" *" return ' *' ;
24
24
25
- <rules >{BR }+ /* */
26
- <rules >\s + this .begin(' indented' )
27
- <rules >" %%" this .begin(' code' ); return ' %%'
28
- <rules >[a -zA -Z0 -9_ ]+ return ' CHARACTER_LIT'
25
+ <rules >{BR }+ /* */
26
+ <rules >\s + this .begin(' indented' )
27
+ <rules >" %%" this .begin(' code' ); return ' %%'
28
+ <rules >[a -zA -Z0 -9_ ]+ return ' CHARACTER_LIT'
29
29
30
- <options >{NAME } yy.options[yytext] = true
31
- <options >{BR }+ this .begin(' INITIAL' )
32
- <options >\s + {BR }+ this .begin(' INITIAL' )
33
- <options >\s + /* empty */
30
+ <options >{NAME } yy.options[yytext] = true
31
+ <options >{BR }+ this .begin(' INITIAL' )
32
+ <options >\s + {BR }+ this .begin(' INITIAL' )
33
+ <options >\s + /* empty */
34
34
35
- <start_condition >{NAME } return ' START_COND'
36
- <start_condition >{BR }+ this .begin(' INITIAL' )
37
- <start_condition >\s + {BR }+ this .begin(' INITIAL' )
38
- <start_condition >\s + /* empty */
35
+ <start_condition >{NAME } return ' START_COND'
36
+ <start_condition >{BR }+ this .begin(' INITIAL' )
37
+ <start_condition >\s + {BR }+ this .begin(' INITIAL' )
38
+ <start_condition >\s + /* empty */
39
39
40
- <trail >. * {BR }+ this .begin(' rules' )
40
+ <trail >. * {BR }+ this .begin(' rules' )
41
41
42
- <indented >" {" yy.depth = 0; this.begin('action'); return '{'
43
- <indented>"%{"(.|{BR})*?"%}" this.begin(' trail' ); yytext = yytext.substr(2, yytext.length-4);return ' ACTION'
44
- "%{"(.|{BR})*?"%}" yytext = yytext.substr(2, yytext.length-4); return ' ACTION'
45
- <indented>.+ this.begin(' rules' ); return ' ACTION'
42
+ <indented >" {" yy.depth = 0; this.begin('action'); return '{'
43
+ <indented>"%{"(.|{BR})*?"%}" this.begin(' trail' ); yytext = yytext.substr(2, yytext.length-4);return ' ACTION'
44
+ "%{"(.|{BR})*?"%}" yytext = yytext.substr(2, yytext.length-4); return ' ACTION'
45
+ <indented>.+ this.begin(' rules' ); return ' ACTION'
46
46
47
47
"/*"(.|\n |\r )*?"*/" /* ignore */
48
48
"//".* /* ignore */
49
49
50
50
{BR}+ /* */
51
51
\s + /* */
52
- {NAME} return ' NAME'
53
- \" ("\\\\ "|' \" '|[^" ])*\" yytext = yytext.replace(/\\ " /g,' "' );return ' STRING_LIT'
54
- " '" (" \\\\ " |" \' " |[^' ])*"' " yytext = yytext.replace(/\\ '/g," ' ");return ' STRING_LIT'
55
- "|" return ' |'
56
- "["("\\\\ "|"\] "|[^\] ])*"]" return ' ANY_GROUP_REGEX'
57
- "(?:" return ' SPECIAL_GROUP'
58
- "(?=" return ' SPECIAL_GROUP'
59
- "(?!" return ' SPECIAL_GROUP'
60
- "(" return ' ('
61
- ")" return ' )'
62
- "+" return ' +'
63
- "*" return ' *'
64
- "?" return ' ?'
65
- "^" return ' ^'
66
- "," return ' ,'
67
- "<<EOF>>" return ' $'
68
- "<" this.begin(' conditions' ); return ' <'
69
- "/!" return ' /!'
70
- "/" return ' /'
71
- "\\ "([0-7]{1,3}|[rfntvsSbBwWdD\\ *+()${}|[\]\/ .^?]|"c"[A-Z]|"x"[0-9A-F]{2}|"u"[a-fA-F0-9]{4}) return ' ESCAPE_CHAR'
72
- "\\ ". yytext = yytext.replace(/^\\ /g,' ' ); return ' ESCAPE_CHAR'
73
- "$" return ' $'
74
- "." return ' .'
75
- "%options" yy.options = {}; this.begin(' options' )
76
- "%s" this.begin(' start_condition' );return ' START_INC'
77
- "%x" this.begin(' start_condition' );return ' START_EXC'
78
- "%%" this.begin(' rules' ); return ' %%'
79
- "{"\d +(","\s ?\d +|",")?"}" return ' RANGE_REGEX'
80
- "{"{NAME}"}" return ' NAME_BRACE'
81
- "{" return ' {'
82
- "}" return ' }'
52
+ {NAME} return ' NAME' ;
53
+ \" ("\\\\ "|' \" '|[^" ])*\" yytext = yytext.replace(/\\ " /g,' "' ); return ' STRING_LIT' ;
54
+ " '" (" \\\\ " |" \' " |[^' ])*"' " yytext = yytext.replace(/\\ '/g," ' "); return ' STRING_LIT' ;
55
+ "|" return ' |' ;
56
+ "["("\\\\ "|"\] "|[^\] ])*"]" return ' ANY_GROUP_REGEX' ;
57
+ "(?:" return ' SPECIAL_GROUP' ;
58
+ "(?=" return ' SPECIAL_GROUP' ;
59
+ "(?!" return ' SPECIAL_GROUP' ;
60
+ "(" return ' (' ;
61
+ ")" return ' )' ;
62
+ "+" return ' +' ;
63
+ "*" return ' *' ;
64
+ "?" return ' ?' ;
65
+ "^" return ' ^' ;
66
+ "," return ' ,' ;
67
+ "<<EOF>>" return ' $' ;
68
+ "<" this.begin(' conditions' ); return ' <' ;
69
+ "/!" return ' /!' ;
70
+ "/" return ' /' ;
71
+ "\\ "([0-7]{1,3}|[rfntvsSbBwWdD\\ *+()${}|[\]\/ .^?]|"c"[A-Z]|"x"[0-9A-F]{2}|"u"[a-fA-F0-9]{4}) return ' ESCAPE_CHAR' ;
72
+ "\\ ". yytext = yytext.replace(/^\\ /g,' ' ); return ' ESCAPE_CHAR' ;
73
+ "$" return ' $' ;
74
+ "." return ' .' ;
75
+ "%options" yy.options = {}; this.begin(' options' );
76
+ "%s" this.begin(' start_condition' ); return ' START_INC' ;
77
+ "%x" this.begin(' start_condition' ); return ' START_EXC' ;
78
+ "%%" this.begin(' rules' ); return ' %%' ;
79
+ "{"\d +(","\s ?\d +|",")?"}" return ' RANGE_REGEX' ;
80
+ "{"{NAME}"}" return ' NAME_BRACE' ;
81
+ "{" return ' {' ;
82
+ "}" return ' }' ;
83
83
. /* ignore bad characters */
84
- <*><<EOF>> return ' EOF'
84
+ <*><<EOF>> return ' EOF' ;
85
85
86
- <code>(.|{BR})+ return ' CODE'
86
+ <code>(.|{BR})+ return ' CODE' ;
87
87
88
88
%%
89
89
0 commit comments