-
Notifications
You must be signed in to change notification settings - Fork 36
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
Symbol grammar clarifications #255
Conversation
Sure, that'd be great. |
Allright, I think that should work. PTAL |
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.
Added some minor non-blocking comments
cmd/scip/lint.go
Outdated
} | ||
sym, err := scip.ParseSymbol(symbol) | ||
if err != nil { | ||
// TODO: This should be linted (but it makes all the tests fail) |
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.
Writing the long symbol names makes writing tests tedious, ideally we'd have a config object to disable some checks in tests. Maybe you can use a global variable here? It'd be off by default, and only one test would set it when checking for this code path. The other tests wouldn't need to worry about producing grammatically correct symbol names.
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.
What about introducing a constructor function for the tests? Something like sym("a")
that expands to . . . . a#
?
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 we can move that logic to makeIndex
or parseSymbolInfo
? In hindsight, I'm not sure if adding a DSL to specify relationships was a good idea, but I didn't want to have large chains of functions/methods when writing test cases. 🙈
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.
Okay I tried... but the DSL was a bit too much too handle so I went with the global as you suggested :D
Noticed one more difference between the spec and Spec issue, or scip-clang issue? |
Hmm, I don't see why the disambiguator should be forced to be non-empty -- the rationale for having the disambiguator is that different disambiguator values can correspond to different method overloads (there is no further sub-structure inside it). An empty string is just another string, which is different from other non-empty strings. Unless someone has a compelling reason otherwise, I think we should allow the disambiguator to be empty. |
+1 to allowing empty disambiguators |
- Forbids empty or 'local' scheme - Unifies "any UTF-8" wording - Specifies that identifiers that can be encoded as simple identifiers have to be encoded as simple identifiers
Co-authored-by: Varun Gandhi <[email protected]>
dcd0d06
to
49acfd1
Compare
Unfortunately I can not get the "build process" to work on my local machine.
Test plan
Added checks to the
lint
command for checking canonical identifiers and that parsing succeeds