-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Fix grammar verification #37607
Fix grammar verification #37607
Conversation
There was a problem hiding this comment.
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
@@ -37,7 +37,7 @@ $(BG): | |||
|
|||
$(BG)RustLexer.class: $(BG) $(SG)RustLexer.g4 | |||
$(Q)$(CFG_ANTLR4) -o $(BG) $(SG)RustLexer.g4 | |||
$(Q)$(CFG_JAVAC) -d $(BG) $(BG)RustLexer.java | |||
$(Q)$(CFG_JAVAC) -d $(BG) -classpath /usr/share/java/antlr-complete.jar $(BG)RustLexer.java |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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)
Cool! |
@dns2utf8 thoughts about configuring where antlr itself is located given my previous comment? |
@@ -20,11 +20,11 @@ skipped=0 | |||
check() { | |||
grep --silent "// ignore-lexer-test" "$1"; | |||
|
|||
# if it's *not* found... | |||
# if it is *not* found... |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
if [ $? -eq 1 ]; then | ||
cd $2 # This `cd` is so java will pick up RustLexer.class. I couldn't | ||
cd $2 # This `cd` is so java will pick up RustLexer.class. I could not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
# figure out how to wrangle the CLASSPATH, just adding build/grammar | ||
# didn't seem to have any effect. | ||
# did not seem to have any effect. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
@alexcrichton I have never worked with the configure-step. I am looking into it now. |
f8b7d59
to
4f2ff7e
Compare
@@ -852,6 +852,7 @@ probe_need CFG_CMAKE cmake | |||
# probe for it only in this case. | |||
if [ -n "$CFG_ANTLR4" ] | |||
then | |||
putvar "CFG_ANTLR4_JAR $(echo -n $(find /usr/ -name antlr-complete.jar 2>/dev/null | head -n 1))" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
0bc7627
to
e7637e6
Compare
I extended the find to search the users homedirectory for |
* 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
e7637e6
to
0e1828a
Compare
@bors: r+ |
📌 Commit 0e1828a has been approved by |
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
This is the continuation of #34994
r? @steveklabnik @jonathandturner @alexcrichton