-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(adapter-json): optimize indirect syntactic analysis
Refs #691
- Loading branch information
Showing
10 changed files
with
84 additions
and
78 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
import { isNodeType } from '../../predicates'; | ||
|
||
export const isDocument = isNodeType('document'); | ||
export const isDocument = isNodeType.bind(undefined, 'document'); | ||
|
||
export const isString = isNodeType('string'); | ||
export const isString = isNodeType.bind(undefined, 'string'); | ||
|
||
export const isFalse = isNodeType('false'); | ||
export const isFalse = isNodeType.bind(undefined, 'false'); | ||
|
||
export const isTrue = isNodeType('true'); | ||
export const isTrue = isNodeType.bind(undefined, 'true'); | ||
|
||
export const isNull = isNodeType('null'); | ||
export const isNull = isNodeType.bind(undefined, 'null'); | ||
|
||
export const isNumber = isNodeType('number'); | ||
export const isNumber = isNodeType.bind(undefined, 'number'); | ||
|
||
export const isArray = isNodeType('array'); | ||
export const isArray = isNodeType.bind(undefined, 'array'); | ||
|
||
export const isObject = isNodeType('object'); | ||
export const isObject = isNodeType.bind(undefined, 'object'); | ||
|
||
export const isStringContent = isNodeType('stringContent'); | ||
export const isStringContent = isNodeType.bind(undefined, 'stringContent'); | ||
|
||
export const isEscapeSequence = isNodeType('escapeSequence'); | ||
export const isEscapeSequence = isNodeType.bind(undefined, 'escapeSequence'); | ||
|
||
export const isProperty = isNodeType('property'); | ||
export const isProperty = isNodeType.bind(undefined, 'property'); | ||
|
||
export const isKey = isNodeType('key'); | ||
export const isKey = isNodeType.bind(undefined, 'key'); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
import { pathEq } from 'ramda'; | ||
export const isNodeType = (type: string, node: any): boolean => node?.type === type; | ||
|
||
export const isNodeType = pathEq(['type']); | ||
export const isLiteral = isNodeType.bind(undefined, 'literal'); | ||
|
||
export const isLiteral = isNodeType('literal'); | ||
export const isPosition = isNodeType.bind(undefined, 'position'); | ||
|
||
export const isPosition = isNodeType('position'); | ||
export const isPoint = isNodeType.bind(undefined, 'point'); | ||
|
||
export const isPoint = isNodeType('point'); | ||
|
||
export const isParseResult = isNodeType('parseResult'); | ||
export const isParseResult = isNodeType.bind(undefined, 'parseResult'); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import { isNodeType } from '../../predicates'; | ||
|
||
export const isStream = isNodeType('stream'); | ||
export const isStream = isNodeType.bind(undefined, 'stream'); | ||
|
||
export const isDocument = isNodeType('document'); | ||
export const isDocument = isNodeType.bind(undefined, 'document'); | ||
|
||
export const isMapping = isNodeType('mapping'); | ||
export const isMapping = isNodeType.bind(undefined, 'mapping'); | ||
|
||
export const isSequence = isNodeType('sequence'); | ||
export const isSequence = isNodeType.bind(undefined, 'sequence'); | ||
|
||
export const isKeyValuePair = isNodeType('keyValuePair'); | ||
export const isKeyValuePair = isNodeType.bind(undefined, 'keyValuePair'); | ||
|
||
export const isTag = isNodeType('tag'); | ||
export const isTag = isNodeType.bind(undefined, 'tag'); | ||
|
||
export const isScalar = isNodeType('scalar'); | ||
export const isScalar = isNodeType.bind(undefined, 'scalar'); | ||
|
||
export const isAlias = isNodeType('alias'); | ||
export const isAlias = isNodeType.bind(undefined, 'alias'); | ||
|
||
export const isDirective = isNodeType('directive'); | ||
export const isDirective = isNodeType.bind(undefined, 'directive'); | ||
|
||
export const isComment = isNodeType('comment'); | ||
export const isComment = isNodeType.bind(undefined, 'comment'); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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