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

Allow trailing comma in clauses #151

Open
trilis opened this issue Jun 24, 2022 · 2 comments
Open

Allow trailing comma in clauses #151

trilis opened this issue Jun 24, 2022 · 2 comments

Comments

@trilis
Copy link

trilis commented Jun 24, 2022

It would be nice to allow trailing commas in clauses, e.g.

Elpi Accumulate lp:{{
   C1,
   C2,
   C3, % <-- 
   .
}}

This would allow to delete or comment the last line without a syntax error.

@gares
Copy link
Contributor

gares commented Jun 24, 2022

Indeed.

This is already the case in the very frequent, in my code at least, case where one uses std.do! and list notation.
Eg

foo :- std.do! [
  a,
  b,
  c,
].

parses fine.

Anyway I don't see anbiguities in the grammar you propose, so I'm favorable to this change.

@gares
Copy link
Contributor

gares commented Jun 25, 2022

@trilis in your example you talk about clauses, but I think you meant premises. Did I get your comment right?
(because clauses are . terminated, if they are just one line you can comment them independently)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants