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

Adding support for comments to ASP/FOL grammars #68

Merged
merged 4 commits into from
Feb 23, 2024
Merged

Conversation

ZachJHansen
Copy link
Collaborator

COMMENT = _{ ("%" ~ (!NEWLINE ~ ANY)* ~ NEWLINE) | ("%" ~ (!NEWLINE ~ ANY)* ~ EOI)}

Matches "%" followed by 0 or more of any character except newline followed by a newline or the end of the file. Allows ASP-style comments in both .lp and .spec files., e.g.

%%%% Comment 1 %%%%
p(X) :- q(X). %%% Comment 2
%%% Comment 3

Closes #63

src/parsing/asp/grammar.pest Outdated Show resolved Hide resolved
src/parsing/asp/pest.rs Show resolved Hide resolved
src/parsing/fol/grammar.pest Outdated Show resolved Hide resolved
@teiesti teiesti added P-low Priority: Low E-easy Experience: Easy C-feature-requested Category: Requested feature A-parsing Area: Parsing L-asp Language: Answer Set Programming L-fol Language: First-order logic labels Feb 23, 2024
@ZachJHansen ZachJHansen merged commit 0e502aa into master Feb 23, 2024
4 checks passed
@ZachJHansen ZachJHansen deleted the zach/comments branch February 23, 2024 14:48
ZachJHansen added a commit that referenced this pull request Feb 23, 2024
Adding support for comments to ASP/FOL grammars

---------

Co-authored-by: Tobias Stolzmann <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parsing Area: Parsing C-feature-requested Category: Requested feature E-easy Experience: Easy L-asp Language: Answer Set Programming L-fol Language: First-order logic P-low Priority: Low
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow comments in .lp and .spec files
2 participants