Skip to content

Commit

Permalink
Merge pull request #342 from DukeManh/issue-157
Browse files Browse the repository at this point in the history
Fix false positive binding with opening {
  • Loading branch information
spentacular committed May 3, 2024
2 parents f1c0d8c + d878180 commit cef2a5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ export const INVALID_AST_PARSER_TESTS: Array<string> = [
'foo.bar[',
'foo.bar.{{nested.}',
'foo.bar`not done()',
'{foo.bar',
];

export const VALID_AST_PARSER_CUSTOM_TESTS: Array<[string, PathNode]> = [
Expand Down
16 changes: 7 additions & 9 deletions core/player/src/binding-grammar/custom/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,13 @@ export const parse: Parser = (path) => {
const nestedPath = (): PathNode | undefined => {
if (ch === OPEN_CURL) {
next(OPEN_CURL);
if (ch === OPEN_CURL) {
next(OPEN_CURL);

/* eslint-disable-next-line @typescript-eslint/no-use-before-define */
const modelRef = parsePath();
next(CLOSE_CURL);
next(CLOSE_CURL);
return modelRef;
}
next(OPEN_CURL);

/* eslint-disable-next-line @typescript-eslint/no-use-before-define */
const modelRef = parsePath();
next(CLOSE_CURL);
next(CLOSE_CURL);
return modelRef;
}
};

Expand Down

0 comments on commit cef2a5f

Please sign in to comment.