-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add contains, startsWith, and endsWith to the operators supported in a relationship. #145
base: master
Are you sure you want to change the base?
Conversation
| | ||
<STARTS_WITH> {jjtThis.setStartsWith(true); jjtThis.setString("startsWith");} | ||
| | ||
<ENDS_WITH> {jjtThis.setEndsWith(true); jjtThis.setString("endsWith");} |
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.
The contributing guide says to use spaces, not tabs. My editor is configured to use spaces, but you can see the previous lines must be using tabs.
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.
np, so long as it doesn't confuse javacc
{ | ||
return false; | ||
} | ||
|
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.
Here I copy/pasted previous methods, so I apparently copied tab characters.
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.
np
jjtree.closeNodeScope(jjtn000, true); | ||
jjtc000 = false; | ||
jjtn000.setEndsWith(true); jjtn000.setString("endsWith"); | ||
break; |
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.
The files in generator/queryparser look like they were one time generated by javacc and then mostly edited by hand, except for this file which looks entirely generated. I had some trouble running javacc. I guess it doesn't run with every invocation of the build. I also don't think it was set up to run from ant since before the introduction of libboot.
I renamed the javacc jar to not include a version number and ran code generation. It doesn't overwrite existing files. I cleared out this directory, regenerated all code, and restored code that looks like it was written by hand. Is there a better way?
The problem I'm seeing is that all relationships are failing to parse with null pointer exceptions. When I log relationship strings, I see that existing relationships are failing to parse, not just new ones I'm adding for tests.
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.
(It'd be good to have a working target for running javacc, but it should not run all the time)
I don't think you did anything procedurally wrong.
javacc has the advantage that it generates a fully independent parser, but the code is pretty opaque. I would suggest taking the simplest relationship that fails and debugging it through.
"<DIGIT>", | ||
}; | ||
|
||
} |
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 just noticed this. javacc generates code with line endings that don't necessarily match what's in git, and I think I have my git client set up to preserve the original's line endings. I'll fix this, but I figured I'd ask if there's a better way.
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.
Maybe it makes sense to add this suggestion to contributing.md
$ git config core.autocrlf false
public static final String[] lexStateNames = { | ||
"DEFAULT", | ||
}; | ||
static final long[] jjtoToken = { | ||
0x7dfffffc1L, | ||
0x3effffffc1L, | ||
}; | ||
static final long[] jjtoSkip = { | ||
0x3eL, |
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.
All this is auto-generated so I'm assuming it's ok but I'm missing something.
814edaf
to
60d14a3
Compare
This pull request doesn't work yet. I'm sharing it for early feedback. I'll add comments inline to point out where I need help.