-
Notifications
You must be signed in to change notification settings - Fork 8
[REPL] Add line parser for all queries that accept slice criteria #1994
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
base: main
Are you sure you want to change the base?
Conversation
| default: current += c; | ||
| } | ||
| } else if(c === split && !inQuotes && current !== '') { | ||
| } else if(inputString.slice(i, i + split.length) === split && !inQuotes && current !== '') { |
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.
We look for a character sequence here, but only skip the first character of the sequence...any ideas on how to write this more clearly, @EagleoutIce? 🤔
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 do you mean with skipping the first character here? we could also try a peek ahead that pattern matches against a regex for that matter, but in genreal i dont think this looks that bad
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.
We match on the split string (e.g. ;:) and if it is present, we forward over the semicolon and start the next argument with the :. That behavior is correct for our single specific use case currently, but it might be surprising in general.
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.
Todo: Use regex to allow arbitrary number of whitespace chars between the semicolon and colon
Adds a REPL line parser to all queries that accept one or multiple slice criteria 🎉
Dataframe Shape
Single criterion (optional)
Lineage
Single criterion
Location-Map
Multiple criteria (optional)
Origin
Single criterion
Resolve Value
Multiple criteria
Static Slice
Multiple criteria, backward and forward slice
Example Code
test/testfiles/dataframe.R: