allowing comments instead of newlines and not capturing comments (leave that for later as it messes the output)
This commit is contained in:
parent
3912e0cd31
commit
c9ffb78e82
@ -6,13 +6,13 @@ module Parser
|
||||
# rule of thumb is that anything eats space behind it, but only space, no newlines
|
||||
rule(:space) { (str('\t') | str(' ')).repeat(1) }
|
||||
rule(:space?) { space.maybe }
|
||||
rule(:newline){ str("\n") >> space? >> newline.repeat }
|
||||
rule(:linebreak){ str("\n") >> space? >> linebreak.repeat }
|
||||
|
||||
rule(:quote) { str('"') }
|
||||
rule(:nonquote) { str('"').absent? >> any }
|
||||
|
||||
rule(:comment){ match('#') >> (newline.absent? >> any).repeat.as(:comment) >> newline }
|
||||
|
||||
rule(:comment){ match('#') >> (linebreak.absent? >> any).repeat >> linebreak }
|
||||
rule(:newline) { linebreak | comment }
|
||||
rule(:eol) { newline | any.absent? }
|
||||
|
||||
rule(:double_quote){ str('"') }
|
||||
|
@ -9,7 +9,7 @@ module Parser
|
||||
space? >> right_parenthesis
|
||||
}
|
||||
|
||||
rule(:call_site) { name.as(:call_site) >> argument_list }
|
||||
rule(:call_site) { name.as(:call_site) >> argument_list >> comment.maybe}
|
||||
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user