Closed mvanaken closed 1 year ago
I'm reviewing by email, but is that really a single line? It could sure use some newlines!
jvdb @.***> schreef op 25 februari 2023 12:07:09 CET:
@jvdb commented on this pull request.
@@ -189,6 +189,15 @@ private Shorthand() {} /* @see Until / public static Token until(final String name, final Token terminator, final Encoding encoding) { return until(name, null, terminator, encoding); } /* @see Until / public static Token until(final String name, final Token terminator) { return until(name, terminator, null); }
- public static Token defU(final String name, final ValueExpression initialSize, final ValueExpression stepSize, final ValueExpression maxSize, final Token terminator, final Encoding encoding) { return new Until(name, initialSize, stepSize, maxSize, terminator, false, encoding); }
-- Reply to this email directly or view it on GitHub: https://github.com/parsingdata/metal/pull/361#discussion_r1117904430 You are receiving this because you are subscribed to this thread.
Message ID: @.***>
Run code coverage locally and this was again 100%. The codecov hickup is resolved in #362.
There are three scenarios where you would like to use Until:
The current implementation of Until parses two structures: a def and the terminator. The current implementation can handle 1. correctly, but for 2 and 3 requires some hacky solutions with some drawbacks. See examples solutions below.
Especially for scenario 3, the "T" part is parsed twice and is also available twice in the parseGraph. This can be resolved by allowing two implementations of Until where you can specify if the terminator should be part of the parseGraph.
This PR includes the new shorthands "defU" (name still in progress) that parses the def, but not the terminator. It uses the same Until class, but with an additional boolean indicating if the terminator should be included or not.
Resolves #360.