Nothing Special   »   [go: up one dir, main page]

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

Detect and report invalid identifiers #186

Closed
gdetrez opened this issue Oct 12, 2016 · 4 comments
Closed

Detect and report invalid identifiers #186

gdetrez opened this issue Oct 12, 2016 · 4 comments
Assignees
Labels
enhancement LBNF Concerning the LBNF syntax and its checking
Milestone

Comments

@gdetrez
Copy link
Contributor
gdetrez commented Oct 12, 2016

This issue was first discussed in the mailing list

The lbnf reference specify that "An identifier is a nonempty sequence of letters, starting with a capital letter." but bnfc will accept a rule such as cat . Type = "Foo";, generating invalid haskell code.

Instead, bnfc should detect the invalid identifier and print a error message.

@pascalh
Copy link
Contributor
pascalh commented Oct 12, 2016

I'd like to work on that issue as I already said on the mailing list (if it is fine for you).

@gdetrez
Copy link
Contributor Author
gdetrez commented Oct 12, 2016

@pascalh yes, I saw, thanks for volunteering!
It seems that I can only assign issue to member of the organization. I sent you an invitation :-)

@andreasabel
Copy link
Member

It seems that lower case identifiers are for defined identifiers, via the define pragma. This feature is documented in the book Implementing Programming Languages, see http://www.grammaticalframework.org/ipl-book/ , but not in the user manual.
Also, there is no check that a definition is actually supplied in the grammar file. A badly implemented and badly documented feature which eventually got broken by some refactoring, see #214.

@andreasabel
Copy link
Member

I did serious work on the define feature in #214, #266, and #285, addressing the lowercase label issue. Error reporting is better now. Also, apostrophes are now forbidden in identifiers, see #279.

Closing this now, feel free to reopen with new information.

@andreasabel andreasabel added the LBNF Concerning the LBNF syntax and its checking label Jan 4, 2020
@andreasabel andreasabel added this to the 2.8.4 milestone Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement LBNF Concerning the LBNF syntax and its checking
Projects
None yet
Development

No branches or pull requests

3 participants