-
Notifications
You must be signed in to change notification settings - Fork 94
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
replaced spel parser #7370
base: staging
Are you sure you want to change the base?
replaced spel parser #7370
Conversation
@coderabbitai summary |
📝 WalkthroughWalkthroughThis pull request introduces a significant refactoring of the parsing implementation in the Nussknacker Designer Client project. The changes primarily focus on replacing the The modification involves removing the The new implementation introduces private methods like The accompanying test file Possibly related PRs
Suggested labels
Suggested reviewers
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command 📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
changes to ts-spel appended with patch are here https://github.com/JulianWielga/ts-spel/tree/nu-changes |
designer/client/src/components/graph/node-modal/aggregate/parser.test.ts
Outdated
Show resolved
Hide resolved
this.input = lexResult.tokens; | ||
#parseObject(input: string, ast?: Ast) { | ||
switch (ast?.type) { | ||
case "InlineList": |
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.
Let's write a note that it is a work around for a bug in the ts-spel parser that it treats empty map as empty list (I'm not sure If I understand you correctly)
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.
it's not a bug. it's the way it works. {} means empty list. i want to treat empty list as empty object in this case - that's all. there is no sense and case where ":" would be inserted. test case shows this clearly.
const lexResult = this.lexer.tokenize(input); | ||
this.fullText = input; | ||
this.input = lexResult.tokens; | ||
#parseObject(input: string, ast?: Ast) { |
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.
I would call it more precisely. It looks like it parse map aggregate aggregators, not a general object
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.
it returns object - Record<string, string> and parses both: map and map wrapped with #AGG.map to the same format.
parseList(input: string): Array<string> { | ||
this.tokenizeInput(input); | ||
return this.groupBy() || null; | ||
#parseList(input: string, ast?: Ast) { |
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.
The same as above - I'd call it parseListToStringExpression or parseAggregateKey
Summary by CodeRabbit
New Features
ts-spel
library for improved functionality.AggMapLikeParser
class.Bug Fixes
Tests