Hi,
Jan has implemented a nice parser that allows us to specify easily
productions that depend on text having to be on a new line.
For example, in Pillar, a header is specified through an exclamation mark
starting on a new line. Now, you can parse this as:
#startOfLine asParser , $! asParser , #newline asParser negate star
Pretty cool!
@Jan: I think we need to enhance a bit the implementation. The
implementation looks like this right now:
isStartOfLine
(position = 0) ifTrue: [ ^ true ].
^ (collection at: position) = Character cr.
This will work when the line ending is either cr or lf+cr. However, it
won't work if the line ending is just lf.
For example, in my parsers, the newline implementation looks like:
(#cr asParser , #lf asParser optional) / #lf asParser / #cr asParser
What do you think?
Cheers,
Doru
--
www.tudorgirba.com
"Every thing has its own flow"