Comments (3)
Take a look at the formal spec for identifier:
identifier:
regular-identifier
quoted-identifier
regular-identifier:
available-identifier
available-identifier dot-character regular-identifier
In short an identifier can't end with a period. The lexer reads available-identifier
, then optionally reads .
followed by available-identifier
.
from powerquery-parser.
Ahhh - this likely explains why the Grammar treats Access.Database
as one token, and Access.
as two tokens. That creates an annoyance for intellisense purposes, though. I can't think of a case where you'd want .
to be treated as a separate word/token.
I could fix this on the grammar side by treating .
as a valid identifier char, but I was hoping to always rely on the positions returned by the parser code. (It would also break once VS Code allows us to stop using the grammar entirely).
Any suggestions on how to resolve?
I guess we could solve this within the intellisense code itself... if we find the last char is .
, we adjust the current word position to include the previous identifier as well.
from powerquery-parser.
As far as I know there's no situation where an identifier followed by a dot isn't intended to be an identifier. I see two main options:
- Handle it in the Intellisense code
- Add an optional flag on how to tokenize identifiers (eg. Strict vs Intellisense)
Adding an additional flag would more tightly couple the parser's code with the VSCode extension, which is something I'd like to avoid if possible. That said if it's not easy to implement the fix in the Intellisense code and/or it requires a hacky solution then I'd prefer a flag over code separation ideology.
from powerquery-parser.
Related Issues (20)
- [Enhancement] Add support for the new null coalescing operator ?? HOT 1
- [Enhancement] Add SectionAccessExpression
- [Enhancement] Remove LexerSnapshot HOT 2
- [BUG] Sequences using variables causes a parse error HOT 1
- Parser error when function return type is nullable HOT 5
- [BUG] escaped quote inside of quoted identifier HOT 1
- [BUG] Parser error on record type definition - Did you leave a dangling comma? HOT 2
- [BUG] Invalid identifier allowed as record field name HOT 1
- [BUG] Inconsistent parsing of identifiers with PowerBI HOT 5
- [BUG] parser error with empty table type declaration
- Identifier not parsed with unicode symbols [BUG] HOT 5
- This repo is missing important files
- [Enhancement] New language keyword `catch`
- [BUG] maybeNormalizeNumber doesn't work on hex literals HOT 1
- [Enhancement] Is there a python version of the parser? HOT 1
- [BUG] - Recursive Section Member Reference Isn't Accepted as Valid HOT 4
- [Enhancement] Reason tag for CancellationToken HOT 1
- field-specification Deviation Double-Check
- [BUG] Inconsistent and maybe buggy parsing of generalized-identifier compared to Power-BI HOT 1
- [BUG] Quoted identifiers and unquoted identifiers sometimes parse differently
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powerquery-parser.