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

Simple non-antlr AT parser #6

Merged
merged 15 commits into from
Apr 17, 2024
Merged

Conversation

lukebemish
Copy link

Antlr, unfortunately, is Not Great. At this point, it's beginning to consistently be badly-supported by gradle and IDEs alike; furthermore, it's not necessary at all for this use case. AT files are quite easy to parse; here, I implement a small, regex-free AT file parser that as far as I can tell is consistent with the old behavior of AT files. While it seems to run correctly on all the tests, if anyone finds an issue with my implementation, please let me know.

@FiniteReality
Copy link
Member

I feel that we should keep the ANTLR grammars around, though not in /src, likely a /extras folder or some such. This is because it may be useful to other people writing AT parsers as a reference (e.g. for IDE integration), even if it's not a 1:1 match with how they're parsed actively.

@lukebemish
Copy link
Author

That's not a bad suggestion; added them in a extra directory.

@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Apr 14, 2024

  • Publish PR to GitHub Packages

Last commit published: 7d332a6e0ed61b5edfe597f2050f0176b3cade59.

PR Publishing

The artifacts published by this PR:

Repository Declaration

In order to use the artifacts published by the PR, add the following repository to your buildscript:

repositories {
    maven {
        name 'Maven for PR #6' // https://github.com/neoforged/AccessTransformers/pull/6
        url 'https://prmaven.neoforged.net/AccessTransformers/pr6'
        content {
            includeModule('net.neoforged', 'accesstransformers')
            includeModule('net.neoforged.accesstransformers', 'at-cli')
            includeModule('net.neoforged.accesstransformers', 'at-modlauncher')
            includeModule('net.neoforged.accesstransformers', 'at-parser')
        }
    }
}

@lukebemish lukebemish mentioned this pull request Apr 14, 2024
Matyrobbrt added a commit to neoforged/JavaSourceTransformer that referenced this pull request Apr 14, 2024
@Matyrobbrt Matyrobbrt added the enhancement New feature or request label Apr 15, 2024
@lukebemish lukebemish requested a review from Matyrobbrt April 15, 2024 19:12
@Matyrobbrt Matyrobbrt merged commit ef6c7ed into neoforged:main Apr 17, 2024
2 checks passed
@lukebemish lukebemish deleted the yeet-antlr branch April 17, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants