-
Notifications
You must be signed in to change notification settings - Fork 12
Changes: 2.0.x 2.1.x
This has the important consequence that .charAt()
now throws an IndexOutOfBoundsException
on an invalid index (therefore, Context
's .getCurrentChar()
as well).
Historically, Parboiled, and up to grappa 2.0.x, had a .charAt()
method which confusingly returned 0xffff if ever the index specified was greater than (or equal to) the underlying text length.
Not anymore. This method now obeys the CharSequence
contract, and specifying an invalid index will throw an exception.
This decision has been made because 0xffff, in spite of being a "non character", is a legal character in a CharSequence
and possibly in an input which Grappa may parse. It also has the advantage to greatly simplify the character matchers construction.
If you wish to detect the end of input, you can use the new .atEnd()
method available in Context
and BaseParser
(returns true if... Well... You've guessed it.) The .getCurrentCodePoint()
still returns -1 if the end of input is reached, so you can also use that.
This was prompted by grappa-formal.
In this package, the source code of a parser is generated from a formal grammar, then compiled. However, this compilation generated a class which is not in the classloaders available at runtime.
Code now exists to be able to add one classloader (or more) to the parser generation process, and obtain a valid instance of a parser generated at runtime from one such classloader.
- There is no more
ListeningParser
norValueBuilder
. All of these have been replaced with a much more simpleEventBusParser
. - There is no more
ListeningParseRunner
. The baseParseRunner
has everything thatListeningParseRunner
had. -
ParseRunnerListener
has been renamed toParseEventListener
.