diff --git a/examples/rubyish/rubyish.nqp b/examples/rubyish/rubyish.nqp index a145aeec71..9aae88145e 100755 --- a/examples/rubyish/rubyish.nqp +++ b/examples/rubyish/rubyish.nqp @@ -35,7 +35,8 @@ grammar Rubyish::Grammar is HLL::Grammar { || <.panic('Syntax error')> } - rule separator { \n | ';' } + token continuation { \\ \n } + rule separator { ';' | \n } token template { [|] * [|$] } proto token template-content {*} token template-content:sym { } @@ -43,10 +44,10 @@ grammar Rubyish::Grammar is HLL::Grammar { token tmpl-hdr {'' \h* \n? } token tmpl-esc {\h* '<%' - [ || <.panic('Template directive precedes "<%rbi>"')>] + [ || <.panic('Template directive precedes ""')>] } token tmpl-unesc { '%>' \h* \n? - [ || <.panic('Template directive precedes "<%rbi>"')>] + [ || <.panic('Template directive precedes ""')>] } rule stmtlist { @@ -153,7 +154,7 @@ grammar Rubyish::Grammar is HLL::Grammar { } token value:sym { \+? \d+ } - token value:sym { \+? \d+ '.' \d+ } + token value:sym { \+? \d* '.' \d+ } token value:sym {'[' ~ ']' } token value:sym {'{' ~ '}' } token value:sym { } @@ -181,7 +182,7 @@ grammar Rubyish::Grammar is HLL::Grammar { proto token comment {*} token comment:sym { '#' [ \N* || ['>\N]*] } token comment:sym {[^^'=begin'\n] ~ [^^'=end'\n ] .*?} - token ws { [\h | <.comment> | \n]* } + token ws { [\h | <.comment> | <.continuation> | \n]* } # Operator precedence levels INIT {