-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parseable sequences with in-place reader extend (#78)
* Op::Extend and Op::Capture This makes all inline-sequences consuming input to areas with an in-place reader extend, which avoid the outer frame to break because input is not indicated to be parsed. Nevertheless, programs like ```tokay (Int ',' Int) | Ident # will accept: 1,2a ``` will accept inputs like `1,2a`, which is obviously not a wanted behavior. * Adding working test-case * Starting over with a `@(...)` parseable area This reverts the first attempt, but uses a new syntactic element to define a sequence / block as an area which extends the reader.
- Loading branch information
Showing
8 changed files
with
54 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
print("stage 1 " + repr(x)) | ||
#Int _ x = (Int expect EOF ast("test")) ast("yo") | ||
x = @(Int _ Int ast("test") | Void) | ||
print("stage 2 " + repr(x)) | ||
#end x | ||
#--- | ||
#1 2 | ||
#--- | ||
#stage 1 void | ||
#stage 2 (emit => "test", children => (1, 2), offset => 0, row => 1, col => 1, stop_offset => 3, stop_row => 1, stop_col => 4) |