This is a valid string in boo:
'hello, i\'m a string'
Here is the current PegRule that I have to parse strings (based on
Rodrigo's string rule in the miniboo Pegs example):
SingleQuoteString = "'",--(not "'",
any()),"'",{$HandlePegMatch(PegTokenType.SingleQuoteString)}
the callable at the end is extraneous... anywho, i've tried several
approaches to try and get the above example string to parse. Under the
provided SingleQuoteString PegRule, it'd parse as:
'hello, i\' <-- string token
m <-- identifier
a <-- identifier
string <-- keyword (for purposes of syntax colorizing)
and the trailing single-quote would cause the parser to bail out...
this was my initial approach to this issue:
SingleQuoteString = "'",--("""\'""",not "'",
any()),"'",{$HandlePegMatch(PegTokenType.SingleQuoteString)}
this would cause the parser to fail on attempting to parse any
string... anywho.. any thoughts on how to approach this issue?
I just wanted to say that, besides dealing with this, working with
pegs thus far has gone quite well. I am quite taken with the system,
as a whole.
The only other gripe I have (Pegs-wise) is that this PegRule will fail:
Rule = ++("bar" / not "foo" / any() )
in this case, it will fail because of the 'not "foo" ' piece.. changing it to
Rule = ++("bar" / Foo / any() )
Foo = not "foo"
will allow it to compile...
Just wanted to share that.. anywho, any help concerning the string
issue above from anyone also working with Pegs would be greatly
appreciated.
Thanks,
Jeff
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Boo Programming Language" group.
To post to this group, send email to
boolang@...
To unsubscribe from this group, send email to
boolang-unsubscribe@...
For more options, visit this group at
http://groups.google.com/group/boolang-~----------~----~----~----~------~----~------~--~---