@@ -35,18 +35,19 @@ grammar Rubyish::Grammar is HLL::Grammar {
35
35
|| <.panic (' Syntax error' )>
36
36
}
37
37
38
- rule separator { \n | ';' }
38
+ token continuation { \\ \n }
39
+ rule separator { ';' | \n <! after continuation> }
39
40
token template { [<tmpl - unesc >| <tmpl - hdr >] <text = .template - content >* [<tmpl - esc >| $ ] }
40
41
proto token template-content {* }
41
42
token template-content :sym <interp > { <interp > }
42
43
token template-content :sym <plain-text > { [<! before [<tmpl - esc >| '#{' | $ ]> . ]+ }
43
44
44
45
token tmpl-hdr {'<?rbi?>' \h * \n ? <?{ $ * IN_TEMPLATE := 1 }> }
45
46
token tmpl-esc {\h * '<%'
46
- [<?{ $ * IN_TEMPLATE }> || <.panic (' Template directive precedes "<% rbi>"' )>]
47
+ [<?{ $ * IN_TEMPLATE }> || <.panic (' Template directive precedes "<? rbi? >"' )>]
47
48
}
48
49
token tmpl-unesc { '%>' \h * \n ?
49
- [<?{ $ * IN_TEMPLATE }> || <.panic (' Template directive precedes "<% rbi>"' )>]
50
+ [<?{ $ * IN_TEMPLATE }> || <.panic (' Template directive precedes "<? rbi? >"' )>]
50
51
}
51
52
52
53
rule stmtlist {
@@ -153,7 +154,7 @@ grammar Rubyish::Grammar is HLL::Grammar {
153
154
}
154
155
155
156
token value :sym <integer > { \+? \d + }
156
- token value :sym <float > { \+? \d + '.' \d + }
157
+ token value :sym <float > { \+? \d * '.' \d + }
157
158
token value :sym <array > {'[' ~ ']' <paren - list > }
158
159
token value :sym <hash > {'{' ~ '}' <paren - list > }
159
160
token value :sym <nil > { <sym > }
@@ -181,7 +182,7 @@ grammar Rubyish::Grammar is HLL::Grammar {
181
182
proto token comment {* }
182
183
token comment :sym <line > { '#' [<?{ ! $ * IN_TEMPLATE }> \N * || [<! before '%>' >\N ]* ] }
183
184
token comment :sym <podish > {[^^ '=begin' \n ] ~ [^^ '=end' \n ] .*? }
184
- token ws { <!ww >[\h | <.comment > | <?{ $ * LINE_SPAN }> \n ]* }
185
+ token ws { <!ww >[\h | <.comment > | <.continuation > | < ?{$ * LINE_SPAN }> \n ]* }
185
186
186
187
# Operator precedence levels
187
188
INIT {
0 commit comments