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

PEG files for peg in examples fails to compile #43

Open
greenfork opened this issue Dec 24, 2023 · 4 comments
Open

PEG files for peg in examples fails to compile #43

greenfork opened this issue Dec 24, 2023 · 4 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@greenfork
Copy link
Contributor

> ./build/release/compiler examples/pony.peg peg/ast.pony
-- Syntax Error --

/home/grfork/playground/pony/aoc2023/day02/_corral/github_com_ponylang_peg/examples/pony.peg:35:5:1

35:     '=>' seq '}' cap?
        ^
        expected end-of-file

There is a syntax error that has prevented the parser from being able to
understand the source text.
> ./build/release/compiler examples/peg.peg examples/json.peg
-- Syntax Error --

/home/grfork/playground/pony/aoc2023/day02/_corral/github_com_ponylang_peg/examples/json.peg:19:16:1

19: object <- -'{' (pair % ',') -'}'
                   ^
                   expected end-of-file

There is a syntax error that has prevented the parser from being able to
understand the source text.
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Dec 24, 2023
@SeanTAllen
Copy link
Member

When running with individual files like:

../build/release/compiler peg.peg

then peg.peg and json.peg work fine, but the pony.peg does have an issue.

When giving two args like is done in the examples in the report. It would create a compiler from the using the first one of the two peg files and run over the second.

So there's at least a couple bugs to look for in the examples. One.

../build/release/compiler pony.peg

where the pony.peg isn't valid.

And

../build/release/compiler peg.peg json.peg

where the parser created by peg.peg doesn't understand json.peg. the bug there would probably be peg.peg not validating json.peg. IE the bug is probably in peg.peg. Because json.peg is valid, just not when peg.peg parses it.

@SeanTAllen SeanTAllen added bug help wanted Extra attention is needed labels Dec 24, 2023
@SeanTAllen
Copy link
Member

The two different bugs should be addressed in different PRs.

@SeanTAllen SeanTAllen added good first issue Good for newcomers needs investigation This needs to be looked into before its "ready for work" labels Dec 24, 2023
@SeanTAllen
Copy link
Member

SeanTAllen commented Dec 24, 2023

I have a fix for the pony.peg issue. But it exposes a larger issue that the pony.peg is out of date and missing rules. I opened #45 for that new much larger issue.

@SeanTAllen
Copy link
Member

the grammar in peg.peg should be updated to be the same as the grammar in peg/pegparser.pony.

@SeanTAllen SeanTAllen removed the needs investigation This needs to be looked into before its "ready for work" label Dec 25, 2023
@SeanTAllen SeanTAllen changed the title PEG files for peg and pony in examples fail to compile PEG files for peg in examples fails to compile Jan 9, 2024
@SeanTAllen SeanTAllen removed the discuss during sync Should be discussed during an upcoming sync label Jan 9, 2024
@chalcolith chalcolith self-assigned this Jan 9, 2024
@SeanTAllen SeanTAllen removed the bug label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants