Extend parse tree with range and position indices in input query string#2
Open
Querela wants to merge 12 commits intoindexdata:masterfrom
Open
Extend parse tree with range and position indices in input query string#2Querela wants to merge 12 commits intoindexdata:masterfrom
Querela wants to merge 12 commits intoindexdata:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Only cosmetic changes:
cql.jscode (Visual Studio Code default Javascript settings)cql.jsin a module manner, e.g. react etc.Adding position/range computation:
CQLErrorto track more state (currently only actual inputquery,position in string and some parsing context) to help with interpreting queries. Still needs some more manual work e.g. providing hints for fixing the query or some positioning in the query string.Note: forgot
let _qi = this.qi;which was added in 5d05ecf around line 360@pos) / range (@range) of terms and operators in original query. May be used for highlighting etc. Added fifth output box in demo HTML page to demonstrate the extra range properties.Note: only serialized in the
FQmethods (ignored when loading withcql.jsbut might introduce incompatibilities with other tools or libraries that just take any JSON key as some modifier.)NOTE: Indizes in
@posor@rangeare inclusive and start with1.I tried to test as many possible variants I could think of. There might be some issues but I hope I found and fixed most.
The original parsing code was left untouched, so nothing should be broken there.