Updates on version 4 #714
Replies: 5 comments 6 replies
-
|
@jsinger67 I'm looking forward to the next generation scanner system! Btw, I have a question: Will it support unicode properties like |
Beta Was this translation helpful? Give feedback.
-
|
@jsinger67 Though I've not validated the following way is actually feasible yet, and don't understand the detailed timelines of stabilization and scnr2 for version 4, I'd like to share my idea of the release process.
|
Beta Was this translation helpful? Give feedback.
-
Start of version 4 development2025-07-11I released version 3.1 of parol, parol-runtime and parol-ls today. Feedback appreciated 😎 |
Beta Was this translation helpful? Give feedback.
-
Release of version 4 on crates.io2025-07-27I published version 4.0.0 of Have fun and good luck! PS: The documentation of this new version is not up to date yet. Please read the introduction of this discussion for changes that were planned. I realized these plans nearly exactly as described above. Also, feel free to ask questions here. |
Beta Was this translation helpful? Give feedback.
-
Further updates are shared via CHANGELOG.md2025-08-14To lower the amount of information to maintain I would as of now announce new features and changes only in the CHANGELOG.md.
Nevertheless this place can be used to give feedback and bring in own ideas. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Version 4 is in preparation
While version 3 is in its stabilization phase and will surely be declared production-ready soon, further developments have taken place. The main focus was on improving scanning performance. This had suffered a setback with the switch to scnr, leading to problems in some areas.
sncr was a big step towards supporting mode switching within the scanner itself and establishing a clean interface between scanner and parser. But as with so many things in life, sometimes you need a second attempt.
In this case, this second attempt is called scnr2. The successor to scnr places greater emphasis on simplicity and speed. It relies on compile-time code generation using Rust macros. The macro syntax used offers the possibility of defining transitions between scanner modes in various ways. Specifically, there are three types of transitions: set, push, and pop. Furthermore, as with scnr, you can define a positive or negative lookahead for each terminal.
Additionally, scnr2 offers more support for regex features such as case insensitivity.
However, there are also some new limitations. Manually setting a new position in the input string and manually setting the current scanner mode are no longer supported. This decision was made to keep the scanner's runtime overhead as low as possible.
For parol V4, this means that parser-controlled mode changes using
%sc,%push, and%popwithin productions are no longer possible.As a replacement, parol 4 allows scanner mode transitions to be defined using
%pushand%popin the%scannerdirectives, besides the already available%enterinstruction. This moves scanner mode control completely from the grammar to the scanner.I will announce further development on upcoming version 4 here.
As always I'm grateful for feedback and suggestions.
Beta Was this translation helpful? Give feedback.
All reactions