Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parseable sequences with in-place reader extend #78

Merged
merged 6 commits into from
Oct 21, 2022

Conversation

phorward
Copy link
Member

@phorward phorward commented Oct 18, 2022

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.

This program works with 9ec2b66 with input 1 2

print("stage 1 " + repr(x))
x = (Int _ Int ast("test"))
print("stage 2 " + repr(x))

Nevertheless, programs like

(Int ',' Int) | Ident   # will accept: 1,2a

will accept inputs like 1,2a, which is obviously not a wanted behavior.

Maybe it's better to introduce a new syntactic construct like a @(...) area, which creates a sequence as an in-place parse-able area.

This PR relates to #76 as initial issue.

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.
@phorward phorward added feature New feature or request syntax labels Oct 18, 2022
@phorward phorward changed the title Parse-able areas with in-place reader extend Parseable areas with in-place reader extend Oct 21, 2022
@phorward phorward changed the title Parseable areas with in-place reader extend Parseable sequences with in-place reader extend Oct 21, 2022
@phorward
Copy link
Member Author

As 5aab91c implements this feature well, it should be merged. I'm still a little bit odd with the syntax, especially with further visions regarding integrating parsers from modules or so.

@phorward phorward marked this pull request as ready for review October 21, 2022 23:13
@phorward phorward merged commit 28032dc into tokay-lang:main Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request syntax
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant