-
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
fix: invalid identifiers #133
Conversation
cb4ea98
to
4eca63a
Compare
I would say this is a partial fix/workaround to #117, though I think there is probably a better higher level fix (that can be implemented in another PR) that I would sort of suggest should be done before we consider #117 closed entirely:
For context/continuity, while it's related to the 2nd part of the bugs identified in #111, your other fix PR is related to the original error on it: |
e31ab3a
to
a317fd3
Compare
@0xdevalias good point! I opened another issue for that implementation at #147 |
assert.equal(result, "const thisKLength = 1;"); | ||
}); | ||
|
||
test("should handle space in identifier name (happens for some reason though it shouldn't)", async () => { |
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.
gbnf`A good name would be '${/[a-zA-Z] [a-zA-Z0-9]{2,12}/}'` |
maybe because the regex has a space
and would ^
$
make a difference?
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.
This regex is actually a representation of gbnf, which is a superset of regex that allows strings edit: spaces in between. If it were a normal regex, all variable names should have a space in them, right?
To me this seems like an issue with the llama.cpp gbnf handling
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.
Another thing I'll need to check from the previous issues is that whether the users were using local
or openai
mode. Local mode is much more robust, openai does not have any actual guarantees about returning a valid identifier name.
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.
@jehna From memory, for at least some of the ones I was looking at/debugging, I believe they were using openai
, not local
.
Closes #117
Also related to #111