Handle escaped quotes; Fix Vector return type color#12
Open
dave-artificial-agency wants to merge 28 commits intoJoined-Forces:mainfrom
Open
Handle escaped quotes; Fix Vector return type color#12dave-artificial-agency wants to merge 28 commits intoJoined-Forces:mainfrom
dave-artificial-agency wants to merge 28 commits intoJoined-Forces:mainfrom
Conversation
npm install --save-dev jest @types/jest ts-jest typescript
this test is slow. but it is correct.
fix for >"The provided value 'undefined' is not a valid enum value of type CanvasTextAlign." on load. add test
remove warning
context is only used by the NodeParserRegistry, and NodeParserRegistry is already mocked.
update to match the syntax based on committed and merged code - Joined-Forces@3c694f2
source text like ``` CustomProperties Pin (.. DefaultValue="(Linkage=-1,UUID=-1,ExecutionFunction=\"\",CallbackTarget=None)" ..) ```
bd56bbd to
f8ab440
Compare
| // ([^,]*) Type 5: capture pure values e.g.: PinType.bIsConst=False | ||
| const matches = propertyData.matchAll(/([a-zA-Z0-9_.]+)\s*=\s*(("[^"]*")|(\([^)]*\))|(\w*\(\w*(?:[^(]*\([^)]*(?:"[^"]*")\))*\))|(\w*\([^)]*\([^)]*\)[^)]*\))|(\w*\([^)]*\))|([^,]*))/g); | ||
| // ("(?:[^"\\]|\\.)*\([^)]*\)") Type 6: capture struct values with escaped quotes e.g.: DefaultValue="(ExecutionFunction=\"\",CallbackTarget=None)" | ||
| const matches = propertyData.matchAll(/([a-zA-Z0-9_.]+)\s*=\s*(("(?:[^"\\]|\\.)*\([^)]*\)")|("[^"]*")|(\([^)]*\))|(\w*\(\w*(?:[^(]*\([^)]*(?:"[^"]*")\))*\))|(\w*\([^)]*\([^)]*\)[^)]*\))|(\w*\([^)]*\))|([^,]*))/g); |
Contributor
Author
There was a problem hiding this comment.
With this regex change , several of these regex comments are no longer accurate. I can update them, or delete them so we don't have to maintain anything if that's better.
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.
Two fixes:
\"\"in lines likeDefaultValue="(Linkage=-1,UUID=-1,ExecutionFunction=\"\",CallbackTarget=None)". This results in error messages like "Didn't parse property attribute 'CallbackTarget'. There isn't a matching parser.". The issue is not actually being able to parse and renderCallbackTarget, but rather how the PinPropertyParser handles escaped quotation marks. Add tests and a fix.Repro cases:
--
Change summary:
..
This patch may look difficult to review because it is basically an opaque change to a regex.
I have tried to add unit tests for each of the regex cases to ensure no other functionality changes or is broken.
I'm happy to add other tests or test with other nodes if you have source text or test cases you want to check.
Like other PRs, this one is based on #8 , so the first commits to add tests are the same.