Skip to content

Fix grammar verification - #37607

Merged
bors merged 1 commit into
rust-lang:masterfrom
dns2utf8:doc_grammar
Nov 17, 2016
Merged

Fix grammar verification#37607
bors merged 1 commit into
rust-lang:masterfrom
dns2utf8:doc_grammar

Conversation

@dns2utf8

Copy link
Copy Markdown
Contributor
  • Use make check-lexer to verify the grammar.
  • Extend grammar/README
  • Add make clean-grammar rule
  • Add target check-build-lexer-verifier to make tidy, so it will build the verifier with every build and catch future errors

This is the continuation of #34994

r? @steveklabnik@jonathandturner@alexcrichton

@alexcrichtonalexcrichton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Hopefully we'll be able to easily get a "bot" up and running for this soon once we switch to Travis

Comment threadmk/grammar.mk Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to abstract this to avoid hardcoding it?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean something like this?

echo $(find /usr/ -name antlr-complete.jar 2>/dev/null)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking more of a ./configure style thing (or detection elsewhere)

@steveklabnik

Copy link
Copy Markdown
Contributor

Cool!

@alexcrichton

Copy link
Copy Markdown
Member

@dns2utf8 thoughts about configuring where antlr itself is located given my previous comment?

Comment threadsrc/grammar/check.sh Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure to see the usefulness of this change...

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I read it and I thought I change it. Is it wrong?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it's not wrong, but "it's is just as good as "it is" so why changing it?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I learned it that way in school, an old habit.

Comment threadsrc/grammar/check.sh Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

Comment threadsrc/grammar/check.sh Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

@dns2utf8

Copy link
Copy Markdown
ContributorAuthor

@alexcrichton I have never worked with the configure-step. I am looking into it now.

Comment threadconfigure Outdated

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a strange bug: With this line i save the CFG_ANTLR4_JAR to the generated config but it also generates an additional line after this entry.
That entry is empty and stops the use of the config.mk.

Do you have an idea?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that perhaps because the quote after JAR isn't terminated?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was unable to fix the bug inline without creating another one. So I rewrote it with a unfortunately global variable.

@dns2utf8

Copy link
Copy Markdown
ContributorAuthor

I extended the find to search the users homedirectory for antlr-complete.jar if it is installed on the system.
I do not have access to a mac, but I hope this will work there too.

 * Use `make check-lexer` to verify the grammar.
* Extend grammar/README
* Add make clean-grammar rule
* Add target `check-build-lexer-verifier` to `make tidy`, so it will build the verifier with every build and catch future errors
* Search for antlr4 with configure and find
@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+

@bors

bors commented Nov 17, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit 0e1828a has been approved by alexcrichton

@bors

bors commented Nov 17, 2016

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 0e1828a with merge 6cd5be8...

bors added a commit that referenced this pull request Nov 17, 2016
Fix grammar verification
* Use make check-lexer to verify the grammar.
* Extend grammar/README
* Add make clean-grammar rule
* Add target check-build-lexer-verifier to make tidy, so it will build the verifier with every build and catch future errors
This is the continuation of #34994
r? @steveklabnik@jonathandturner@alexcrichton
@bors
bors merged commit 0e1828a into rust-lang:masterNov 17, 2016
@dns2utf8
dns2utf8 deleted the doc_grammar branch November 17, 2016 09:55
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@dns2utf8@steveklabnik@alexcrichton@bors@GuillaumeGomez