@mpeggroup/mpeg-sdl-parser 4.1.1 → 4.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -12
- package/dist/index.d.ts +82 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +82 -11833
- package/dist/src/analyser/checks/check-array-definition.d.ts +3 -0
- package/dist/src/analyser/checks/check-array-definition.d.ts.map +1 -0
- package/dist/src/analyser/checks/check-array-definition.js +54 -0
- package/dist/src/analyser/checks/check-array-element-access.d.ts +3 -0
- package/dist/src/analyser/checks/check-array-element-access.d.ts.map +1 -0
- package/dist/src/analyser/checks/check-array-element-access.js +19 -0
- package/dist/src/analyser/checks/check-class-declaration.d.ts +3 -0
- package/dist/src/analyser/checks/check-class-declaration.d.ts.map +1 -0
- package/dist/src/analyser/checks/check-class-declaration.js +252 -0
- package/dist/src/analyser/checks/check-computed-array-definition.d.ts +3 -0
- package/dist/src/analyser/checks/check-computed-array-definition.d.ts.map +1 -0
- package/dist/src/analyser/checks/check-computed-array-definition.js +29 -0
- package/dist/src/analyser/checks/check-computed-elementary-type-definition.d.ts +3 -0
- package/dist/src/analyser/checks/check-computed-elementary-type-definition.d.ts.map +1 -0
- package/dist/src/analyser/checks/check-computed-elementary-type-definition.js +27 -0
- package/dist/src/analyser/checks/check-elementary-type-definition.d.ts +3 -0
- package/dist/src/analyser/checks/check-elementary-type-definition.d.ts.map +1 -0
- package/dist/src/analyser/checks/check-elementary-type-definition.js +121 -0
- package/dist/src/analyser/checks/check-expression-binary.d.ts +3 -0
- package/dist/src/analyser/checks/check-expression-binary.d.ts.map +1 -0
- package/dist/src/analyser/checks/check-expression-binary.js +177 -0
- package/dist/src/analyser/checks/check-expression-lengthof.d.ts +3 -0
- package/dist/src/analyser/checks/check-expression-lengthof.d.ts.map +1 -0
- package/dist/src/analyser/checks/check-expression-lengthof.js +23 -0
- package/dist/src/analyser/checks/check-expression-unary.d.ts +3 -0
- package/dist/src/analyser/checks/check-expression-unary.d.ts.map +1 -0
- package/dist/src/analyser/checks/check-expression-unary.js +104 -0
- package/dist/src/analyser/checks/check-identifier.d.ts +3 -0
- package/dist/src/analyser/checks/check-identifier.d.ts.map +1 -0
- package/dist/src/analyser/checks/check-identifier.js +55 -0
- package/dist/src/analyser/checks/check-if-statement.d.ts +5 -0
- package/dist/src/analyser/checks/check-if-statement.d.ts.map +1 -0
- package/dist/src/analyser/checks/check-if-statement.js +122 -0
- package/dist/src/analyser/checks/check-map-declaration.d.ts +3 -0
- package/dist/src/analyser/checks/check-map-declaration.d.ts.map +1 -0
- package/dist/src/analyser/checks/check-map-declaration.js +130 -0
- package/dist/src/analyser/checks/check-map-definition.d.ts +3 -0
- package/dist/src/analyser/checks/check-map-definition.d.ts.map +1 -0
- package/dist/src/analyser/checks/check-map-definition.js +72 -0
- package/dist/src/analyser/checks/check-number-literal-float.d.ts +3 -0
- package/dist/src/analyser/checks/check-number-literal-float.d.ts.map +1 -0
- package/dist/src/analyser/checks/check-number-literal-float.js +17 -0
- package/dist/src/analyser/checks/check-parameter-list.d.ts +3 -0
- package/dist/src/analyser/checks/check-parameter-list.d.ts.map +1 -0
- package/dist/src/analyser/checks/check-parameter-list.js +26 -0
- package/dist/src/analyser/checks/check-specification.d.ts +3 -0
- package/dist/src/analyser/checks/check-specification.d.ts.map +1 -0
- package/dist/src/analyser/checks/check-specification.js +37 -0
- package/dist/src/analyser/checks/check-switch-statement.d.ts +3 -0
- package/dist/src/analyser/checks/check-switch-statement.d.ts.map +1 -0
- package/dist/src/analyser/checks/check-switch-statement.js +140 -0
- package/dist/src/analyser/checks/check.d.ts +15 -0
- package/dist/src/analyser/checks/check.d.ts.map +1 -0
- package/dist/src/analyser/checks/check.js +1 -0
- package/dist/src/analyser/create-sdl-analyser.d.ts +18 -0
- package/dist/src/analyser/create-sdl-analyser.d.ts.map +1 -0
- package/dist/src/analyser/create-sdl-analyser.js +72 -0
- package/dist/src/analyser/node-handler/abstract-analysis-node-handler.d.ts +63 -0
- package/dist/src/analyser/node-handler/abstract-analysis-node-handler.d.ts.map +1 -0
- package/dist/src/analyser/node-handler/abstract-analysis-node-handler.js +376 -0
- package/dist/src/analyser/node-handler/build-symbol-table-node-handler.d.ts +18 -0
- package/dist/src/analyser/node-handler/build-symbol-table-node-handler.d.ts.map +1 -0
- package/dist/src/analyser/node-handler/build-symbol-table-node-handler.js +350 -0
- package/dist/src/analyser/node-handler/specific-check-node-handler.d.ts +9 -0
- package/dist/src/analyser/node-handler/specific-check-node-handler.d.ts.map +1 -0
- package/dist/src/analyser/node-handler/specific-check-node-handler.js +29 -0
- package/dist/src/analyser/node-handler/validate-scope-node-handler.d.ts +18 -0
- package/dist/src/analyser/node-handler/validate-scope-node-handler.d.ts.map +1 -0
- package/dist/src/analyser/node-handler/validate-scope-node-handler.js +144 -0
- package/dist/src/analyser/node-handler/validate-type-node-handler.d.ts +13 -0
- package/dist/src/analyser/node-handler/validate-type-node-handler.d.ts.map +1 -0
- package/dist/src/analyser/node-handler/validate-type-node-handler.js +240 -0
- package/dist/src/analyser/sdl-analyser.d.ts +20 -0
- package/dist/src/analyser/sdl-analyser.d.ts.map +1 -0
- package/dist/src/analyser/sdl-analyser.js +69 -0
- package/dist/src/analyser/symbol-table.d.ts +103 -0
- package/dist/src/analyser/symbol-table.d.ts.map +1 -0
- package/dist/src/analyser/symbol-table.js +239 -0
- package/dist/src/analyser/util/symbol-table-utils.d.ts +67 -0
- package/dist/src/analyser/util/symbol-table-utils.d.ts.map +1 -0
- package/dist/src/analyser/util/symbol-table-utils.js +279 -0
- package/dist/src/analyser/util/type-utils.d.ts +14 -0
- package/dist/src/analyser/util/type-utils.d.ts.map +1 -0
- package/dist/src/analyser/util/type-utils.js +147 -0
- package/dist/src/ast/build/consume/consume-abstract-node.d.ts +20 -0
- package/dist/src/ast/build/consume/consume-abstract-node.d.ts.map +1 -0
- package/dist/src/ast/build/consume/consume-abstract-node.js +160 -0
- package/dist/src/ast/build/consume/consume-ast-node.d.ts +4 -0
- package/dist/src/ast/build/consume/consume-ast-node.d.ts.map +1 -0
- package/dist/src/ast/build/consume/consume-ast-node.js +297 -0
- package/dist/src/ast/build/consume/consume-primitive.d.ts +4 -0
- package/dist/src/ast/build/consume/consume-primitive.d.ts.map +1 -0
- package/dist/src/ast/build/consume/consume-primitive.js +47 -0
- package/dist/src/ast/build/consume/consume-trivia.d.ts +8 -0
- package/dist/src/ast/build/consume/consume-trivia.d.ts.map +1 -0
- package/dist/src/ast/build/consume/consume-trivia.js +67 -0
- package/dist/src/ast/build/consume/consume-white-space-and-missing-errors.d.ts +3 -0
- package/dist/src/ast/build/consume/consume-white-space-and-missing-errors.d.ts.map +1 -0
- package/dist/src/ast/build/consume/consume-white-space-and-missing-errors.js +17 -0
- package/dist/src/ast/build/node/build-aggregate-output-value.d.ts +4 -0
- package/dist/src/ast/build/node/build-aggregate-output-value.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-aggregate-output-value.js +24 -0
- package/dist/src/ast/build/node/build-aligned-modifier.d.ts +4 -0
- package/dist/src/ast/build/node/build-aligned-modifier.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-aligned-modifier.js +58 -0
- package/dist/src/ast/build/node/build-array-definition.d.ts +4 -0
- package/dist/src/ast/build/node/build-array-definition.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-array-definition.js +57 -0
- package/dist/src/ast/build/node/build-array-element-access.d.ts +4 -0
- package/dist/src/ast/build/node/build-array-element-access.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-array-element-access.js +19 -0
- package/dist/src/ast/build/node/build-base64-string-literal.d.ts +4 -0
- package/dist/src/ast/build/node/build-base64-string-literal.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-base64-string-literal.js +24 -0
- package/dist/src/ast/build/node/build-binary-expression.d.ts +4 -0
- package/dist/src/ast/build/node/build-binary-expression.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-binary-expression.js +90 -0
- package/dist/src/ast/build/node/build-binary-literal.d.ts +4 -0
- package/dist/src/ast/build/node/build-binary-literal.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-binary-literal.js +16 -0
- package/dist/src/ast/build/node/build-bit-modifier.d.ts +4 -0
- package/dist/src/ast/build/node/build-bit-modifier.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-bit-modifier.js +33 -0
- package/dist/src/ast/build/node/build-case-clause.d.ts +4 -0
- package/dist/src/ast/build/node/build-case-clause.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-case-clause.js +43 -0
- package/dist/src/ast/build/node/build-class-declaration.d.ts +4 -0
- package/dist/src/ast/build/node/build-class-declaration.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-class-declaration.js +46 -0
- package/dist/src/ast/build/node/build-class-definition.d.ts +4 -0
- package/dist/src/ast/build/node/build-class-definition.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-class-definition.js +22 -0
- package/dist/src/ast/build/node/build-class-id-range.d.ts +4 -0
- package/dist/src/ast/build/node/build-class-id-range.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-class-id-range.js +15 -0
- package/dist/src/ast/build/node/build-class-id.d.ts +4 -0
- package/dist/src/ast/build/node/build-class-id.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-class-id.js +7 -0
- package/dist/src/ast/build/node/build-class-member-access.d.ts +4 -0
- package/dist/src/ast/build/node/build-class-member-access.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-class-member-access.js +12 -0
- package/dist/src/ast/build/node/build-compound-statement.d.ts +4 -0
- package/dist/src/ast/build/node/build-compound-statement.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-compound-statement.js +15 -0
- package/dist/src/ast/build/node/build-computed-array-definition.d.ts +4 -0
- package/dist/src/ast/build/node/build-computed-array-definition.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-computed-array-definition.js +14 -0
- package/dist/src/ast/build/node/build-computed-elementary-type-definition.d.ts +4 -0
- package/dist/src/ast/build/node/build-computed-elementary-type-definition.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-computed-elementary-type-definition.js +37 -0
- package/dist/src/ast/build/node/build-decimal-literal.d.ts +4 -0
- package/dist/src/ast/build/node/build-decimal-literal.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-decimal-literal.js +6 -0
- package/dist/src/ast/build/node/build-default-clause.d.ts +4 -0
- package/dist/src/ast/build/node/build-default-clause.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-default-clause.js +30 -0
- package/dist/src/ast/build/node/build-do-statement.d.ts +4 -0
- package/dist/src/ast/build/node/build-do-statement.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-do-statement.js +24 -0
- package/dist/src/ast/build/node/build-elementary-type-definition.d.ts +4 -0
- package/dist/src/ast/build/node/build-elementary-type-definition.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-elementary-type-definition.js +71 -0
- package/dist/src/ast/build/node/build-elementary-type-output-value.d.ts +4 -0
- package/dist/src/ast/build/node/build-elementary-type-output-value.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-elementary-type-output-value.js +13 -0
- package/dist/src/ast/build/node/build-elementary-type.d.ts +4 -0
- package/dist/src/ast/build/node/build-elementary-type.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-elementary-type.js +19 -0
- package/dist/src/ast/build/node/build-expandable-modifier.d.ts +4 -0
- package/dist/src/ast/build/node/build-expandable-modifier.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-expandable-modifier.js +31 -0
- package/dist/src/ast/build/node/build-explicit-array-dimension.d.ts +4 -0
- package/dist/src/ast/build/node/build-explicit-array-dimension.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-explicit-array-dimension.js +18 -0
- package/dist/src/ast/build/node/build-expression-statement.d.ts +4 -0
- package/dist/src/ast/build/node/build-expression-statement.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-expression-statement.js +12 -0
- package/dist/src/ast/build/node/build-extended-class-id-range.d.ts +4 -0
- package/dist/src/ast/build/node/build-extended-class-id-range.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-extended-class-id-range.js +10 -0
- package/dist/src/ast/build/node/build-extends-modifier.d.ts +4 -0
- package/dist/src/ast/build/node/build-extends-modifier.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-extends-modifier.js +16 -0
- package/dist/src/ast/build/node/build-floating-point-literal.d.ts +4 -0
- package/dist/src/ast/build/node/build-floating-point-literal.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-floating-point-literal.js +6 -0
- package/dist/src/ast/build/node/build-for-statement.d.ts +4 -0
- package/dist/src/ast/build/node/build-for-statement.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-for-statement.js +53 -0
- package/dist/src/ast/build/node/build-hexadecimal-literal.d.ts +4 -0
- package/dist/src/ast/build/node/build-hexadecimal-literal.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-hexadecimal-literal.js +16 -0
- package/dist/src/ast/build/node/build-identifier.d.ts +4 -0
- package/dist/src/ast/build/node/build-identifier.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-identifier.js +4 -0
- package/dist/src/ast/build/node/build-if-statement.d.ts +4 -0
- package/dist/src/ast/build/node/build-if-statement.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-if-statement.js +31 -0
- package/dist/src/ast/build/node/build-implicit-array-dimension.d.ts +4 -0
- package/dist/src/ast/build/node/build-implicit-array-dimension.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-implicit-array-dimension.js +37 -0
- package/dist/src/ast/build/node/build-integer-literal.d.ts +4 -0
- package/dist/src/ast/build/node/build-integer-literal.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-integer-literal.js +6 -0
- package/dist/src/ast/build/node/build-length-attribute.d.ts +4 -0
- package/dist/src/ast/build/node/build-length-attribute.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-length-attribute.js +18 -0
- package/dist/src/ast/build/node/build-lengthof-expression.d.ts +4 -0
- package/dist/src/ast/build/node/build-lengthof-expression.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-lengthof-expression.js +14 -0
- package/dist/src/ast/build/node/build-map-declaration.d.ts +4 -0
- package/dist/src/ast/build/node/build-map-declaration.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-map-declaration.js +43 -0
- package/dist/src/ast/build/node/build-map-definition.d.ts +4 -0
- package/dist/src/ast/build/node/build-map-definition.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-map-definition.js +42 -0
- package/dist/src/ast/build/node/build-map-entry.d.ts +4 -0
- package/dist/src/ast/build/node/build-map-entry.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-map-entry.js +14 -0
- package/dist/src/ast/build/node/build-missing-error.d.ts +4 -0
- package/dist/src/ast/build/node/build-missing-error.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-missing-error.js +7 -0
- package/dist/src/ast/build/node/build-multiple-character-literal.d.ts +4 -0
- package/dist/src/ast/build/node/build-multiple-character-literal.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-multiple-character-literal.js +38 -0
- package/dist/src/ast/build/node/build-parameter-list.d.ts +4 -0
- package/dist/src/ast/build/node/build-parameter-list.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-parameter-list.js +20 -0
- package/dist/src/ast/build/node/build-parameter-value-list.d.ts +4 -0
- package/dist/src/ast/build/node/build-parameter-value-list.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-parameter-value-list.js +20 -0
- package/dist/src/ast/build/node/build-parameter.d.ts +4 -0
- package/dist/src/ast/build/node/build-parameter.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-parameter.js +25 -0
- package/dist/src/ast/build/node/build-partial-array-dimension.d.ts +4 -0
- package/dist/src/ast/build/node/build-partial-array-dimension.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-partial-array-dimension.js +22 -0
- package/dist/src/ast/build/node/build-specification.d.ts +4 -0
- package/dist/src/ast/build/node/build-specification.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-specification.js +12 -0
- package/dist/src/ast/build/node/build-string-definition.d.ts +4 -0
- package/dist/src/ast/build/node/build-string-definition.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-string-definition.js +50 -0
- package/dist/src/ast/build/node/build-switch-statement.d.ts +4 -0
- package/dist/src/ast/build/node/build-switch-statement.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-switch-statement.js +28 -0
- package/dist/src/ast/build/node/build-token.d.ts +4 -0
- package/dist/src/ast/build/node/build-token.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-token.js +16 -0
- package/dist/src/ast/build/node/build-unary-expression.d.ts +6 -0
- package/dist/src/ast/build/node/build-unary-expression.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-unary-expression.js +53 -0
- package/dist/src/ast/build/node/build-unexpected-error.d.ts +4 -0
- package/dist/src/ast/build/node/build-unexpected-error.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-unexpected-error.js +6 -0
- package/dist/src/ast/build/node/build-utf-string-literal.d.ts +4 -0
- package/dist/src/ast/build/node/build-utf-string-literal.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-utf-string-literal.js +54 -0
- package/dist/src/ast/build/node/build-while-statement.d.ts +4 -0
- package/dist/src/ast/build/node/build-while-statement.d.ts.map +1 -0
- package/dist/src/ast/build/node/build-while-statement.js +12 -0
- package/dist/src/ast/build/util/array-dimension-kind-by-token-type-id-map.d.ts +3 -0
- package/dist/src/ast/build/util/array-dimension-kind-by-token-type-id-map.d.ts.map +1 -0
- package/dist/src/ast/build/util/array-dimension-kind-by-token-type-id-map.js +152 -0
- package/dist/src/ast/build/util/binary-operator-kind-by-token-type-id-map.d.ts +3 -0
- package/dist/src/ast/build/util/binary-operator-kind-by-token-type-id-map.d.ts.map +1 -0
- package/dist/src/ast/build/util/binary-operator-kind-by-token-type-id-map.js +145 -0
- package/dist/src/ast/build/util/build-context.d.ts +35 -0
- package/dist/src/ast/build/util/build-context.d.ts.map +1 -0
- package/dist/src/ast/build/util/build-context.js +1 -0
- package/dist/src/ast/build/util/class-id-kind-by-token-type-id-map.d.ts +3 -0
- package/dist/src/ast/build/util/class-id-kind-by-token-type-id-map.d.ts.map +1 -0
- package/dist/src/ast/build/util/class-id-kind-by-token-type-id-map.js +152 -0
- package/dist/src/ast/build/util/expression-kind-by-token-type-id-map.d.ts +3 -0
- package/dist/src/ast/build/util/expression-kind-by-token-type-id-map.d.ts.map +1 -0
- package/dist/src/ast/build/util/expression-kind-by-token-type-id-map.js +152 -0
- package/dist/src/ast/build/util/fetch-node.d.ts +13 -0
- package/dist/src/ast/build/util/fetch-node.d.ts.map +1 -0
- package/dist/src/ast/build/util/fetch-node.js +285 -0
- package/dist/src/ast/build/util/node-kind-by-token-type-id-map.d.ts +3 -0
- package/dist/src/ast/build/util/node-kind-by-token-type-id-map.d.ts.map +1 -0
- package/dist/src/ast/build/util/node-kind-by-token-type-id-map.js +193 -0
- package/dist/src/ast/build/util/statement-kind-by-token-type-id-map.d.ts +3 -0
- package/dist/src/ast/build/util/statement-kind-by-token-type-id-map.d.ts.map +1 -0
- package/dist/src/ast/build/util/statement-kind-by-token-type-id-map.js +178 -0
- package/dist/src/ast/build/util/string-literal-kind-by-token-type-id-map.d.ts +3 -0
- package/dist/src/ast/build/util/string-literal-kind-by-token-type-id-map.d.ts.map +1 -0
- package/dist/src/ast/build/util/string-literal-kind-by-token-type-id-map.js +150 -0
- package/dist/src/ast/build/util/token-kind-by-token-type-id-map.d.ts +3 -0
- package/dist/src/ast/build/util/token-kind-by-token-type-id-map.d.ts.map +1 -0
- package/dist/src/ast/build/util/token-kind-by-token-type-id-map.js +309 -0
- package/dist/src/ast/build-ast.d.ts +13 -0
- package/dist/src/ast/build-ast.d.ts.map +1 -0
- package/dist/src/ast/build-ast.js +65 -0
- package/dist/src/ast/node/abstract-array-definition.d.ts +12 -0
- package/dist/src/ast/node/abstract-array-definition.d.ts.map +1 -0
- package/dist/src/ast/node/abstract-array-definition.js +10 -0
- package/dist/src/ast/node/abstract-array-dimension.d.ts +12 -0
- package/dist/src/ast/node/abstract-array-dimension.d.ts.map +1 -0
- package/dist/src/ast/node/abstract-array-dimension.js +14 -0
- package/dist/src/ast/node/abstract-class-id.d.ts +8 -0
- package/dist/src/ast/node/abstract-class-id.d.ts.map +1 -0
- package/dist/src/ast/node/abstract-class-id.js +10 -0
- package/dist/src/ast/node/abstract-composite-node.d.ts +17 -0
- package/dist/src/ast/node/abstract-composite-node.d.ts.map +1 -0
- package/dist/src/ast/node/abstract-composite-node.js +47 -0
- package/dist/src/ast/node/abstract-elementary-type-definition.d.ts +19 -0
- package/dist/src/ast/node/abstract-elementary-type-definition.d.ts.map +1 -0
- package/dist/src/ast/node/abstract-elementary-type-definition.js +18 -0
- package/dist/src/ast/node/abstract-expression.d.ts +8 -0
- package/dist/src/ast/node/abstract-expression.d.ts.map +1 -0
- package/dist/src/ast/node/abstract-expression.js +10 -0
- package/dist/src/ast/node/abstract-leaf-node.d.ts +6 -0
- package/dist/src/ast/node/abstract-leaf-node.d.ts.map +1 -0
- package/dist/src/ast/node/abstract-leaf-node.js +6 -0
- package/dist/src/ast/node/abstract-node.d.ts +12 -0
- package/dist/src/ast/node/abstract-node.d.ts.map +1 -0
- package/dist/src/ast/node/abstract-node.js +11 -0
- package/dist/src/ast/node/abstract-statement.d.ts +9 -0
- package/dist/src/ast/node/abstract-statement.d.ts.map +1 -0
- package/dist/src/ast/node/abstract-statement.js +12 -0
- package/dist/src/ast/node/aggregate-output-value.d.ts +14 -0
- package/dist/src/ast/node/aggregate-output-value.d.ts.map +1 -0
- package/dist/src/ast/node/aggregate-output-value.js +15 -0
- package/dist/src/ast/node/aligned-modifier.d.ts +13 -0
- package/dist/src/ast/node/aligned-modifier.d.ts.map +1 -0
- package/dist/src/ast/node/aligned-modifier.js +17 -0
- package/dist/src/ast/node/array-definition.d.ts +24 -0
- package/dist/src/ast/node/array-definition.d.ts.map +1 -0
- package/dist/src/ast/node/array-definition.js +25 -0
- package/dist/src/ast/node/array-element-access.d.ts +14 -0
- package/dist/src/ast/node/array-element-access.d.ts.map +1 -0
- package/dist/src/ast/node/array-element-access.js +13 -0
- package/dist/src/ast/node/binary-expression.d.ts +15 -0
- package/dist/src/ast/node/binary-expression.d.ts.map +1 -0
- package/dist/src/ast/node/binary-expression.js +15 -0
- package/dist/src/ast/node/bit-modifier.d.ts +19 -0
- package/dist/src/ast/node/bit-modifier.d.ts.map +1 -0
- package/dist/src/ast/node/bit-modifier.js +23 -0
- package/dist/src/ast/node/case-clause.d.ts +18 -0
- package/dist/src/ast/node/case-clause.d.ts.map +1 -0
- package/dist/src/ast/node/case-clause.js +23 -0
- package/dist/src/ast/node/class-declaration.d.ts +25 -0
- package/dist/src/ast/node/class-declaration.d.ts.map +1 -0
- package/dist/src/ast/node/class-declaration.js +29 -0
- package/dist/src/ast/node/class-definition.d.ts +15 -0
- package/dist/src/ast/node/class-definition.d.ts.map +1 -0
- package/dist/src/ast/node/class-definition.js +17 -0
- package/dist/src/ast/node/class-id-range.d.ts +12 -0
- package/dist/src/ast/node/class-id-range.d.ts.map +1 -0
- package/dist/src/ast/node/class-id-range.js +13 -0
- package/dist/src/ast/node/class-id.d.ts +9 -0
- package/dist/src/ast/node/class-id.d.ts.map +1 -0
- package/dist/src/ast/node/class-id.js +9 -0
- package/dist/src/ast/node/class-member-access.d.ts +11 -0
- package/dist/src/ast/node/class-member-access.d.ts.map +1 -0
- package/dist/src/ast/node/class-member-access.js +11 -0
- package/dist/src/ast/node/compound-statement.d.ts +11 -0
- package/dist/src/ast/node/compound-statement.d.ts.map +1 -0
- package/dist/src/ast/node/compound-statement.js +13 -0
- package/dist/src/ast/node/computed-array-definition.d.ts +14 -0
- package/dist/src/ast/node/computed-array-definition.d.ts.map +1 -0
- package/dist/src/ast/node/computed-array-definition.js +13 -0
- package/dist/src/ast/node/computed-elementary-type-definition.d.ts +13 -0
- package/dist/src/ast/node/computed-elementary-type-definition.d.ts.map +1 -0
- package/dist/src/ast/node/computed-elementary-type-definition.js +9 -0
- package/dist/src/ast/node/default-clause.d.ts +14 -0
- package/dist/src/ast/node/default-clause.d.ts.map +1 -0
- package/dist/src/ast/node/default-clause.js +17 -0
- package/dist/src/ast/node/do-statement.d.ts +19 -0
- package/dist/src/ast/node/do-statement.d.ts.map +1 -0
- package/dist/src/ast/node/do-statement.js +21 -0
- package/dist/src/ast/node/elementary-type-definition.d.ts +21 -0
- package/dist/src/ast/node/elementary-type-definition.d.ts.map +1 -0
- package/dist/src/ast/node/elementary-type-definition.js +21 -0
- package/dist/src/ast/node/elementary-type-output-value.d.ts +11 -0
- package/dist/src/ast/node/elementary-type-output-value.d.ts.map +1 -0
- package/dist/src/ast/node/elementary-type-output-value.js +11 -0
- package/dist/src/ast/node/elementary-type.d.ts +10 -0
- package/dist/src/ast/node/elementary-type.d.ts.map +1 -0
- package/dist/src/ast/node/elementary-type.js +11 -0
- package/dist/src/ast/node/enum/array-dimension-kind.d.ts +12 -0
- package/dist/src/ast/node/enum/array-dimension-kind.d.ts.map +1 -0
- package/dist/src/ast/node/enum/array-dimension-kind.js +12 -0
- package/dist/src/ast/node/enum/binary-operator-kind.d.ts +42 -0
- package/dist/src/ast/node/enum/binary-operator-kind.d.ts.map +1 -0
- package/dist/src/ast/node/enum/binary-operator-kind.js +42 -0
- package/dist/src/ast/node/enum/class-id-kind.d.ts +13 -0
- package/dist/src/ast/node/enum/class-id-kind.d.ts.map +1 -0
- package/dist/src/ast/node/enum/class-id-kind.js +13 -0
- package/dist/src/ast/node/enum/elementary-type-kind.d.ts +14 -0
- package/dist/src/ast/node/enum/elementary-type-kind.d.ts.map +1 -0
- package/dist/src/ast/node/enum/elementary-type-kind.js +14 -0
- package/dist/src/ast/node/enum/expression-kind.d.ts +12 -0
- package/dist/src/ast/node/enum/expression-kind.d.ts.map +1 -0
- package/dist/src/ast/node/enum/expression-kind.js +12 -0
- package/dist/src/ast/node/enum/node-kind.d.ts +58 -0
- package/dist/src/ast/node/enum/node-kind.d.ts.map +1 -0
- package/dist/src/ast/node/enum/node-kind.js +58 -0
- package/dist/src/ast/node/enum/number-literal-kind.d.ts +18 -0
- package/dist/src/ast/node/enum/number-literal-kind.d.ts.map +1 -0
- package/dist/src/ast/node/enum/number-literal-kind.js +18 -0
- package/dist/src/ast/node/enum/statement-kind.d.ts +38 -0
- package/dist/src/ast/node/enum/statement-kind.d.ts.map +1 -0
- package/dist/src/ast/node/enum/statement-kind.js +38 -0
- package/dist/src/ast/node/enum/string-literal-kind.d.ts +14 -0
- package/dist/src/ast/node/enum/string-literal-kind.d.ts.map +1 -0
- package/dist/src/ast/node/enum/string-literal-kind.js +14 -0
- package/dist/src/ast/node/enum/string-variable-kind.d.ts +26 -0
- package/dist/src/ast/node/enum/string-variable-kind.d.ts.map +1 -0
- package/dist/src/ast/node/enum/string-variable-kind.js +26 -0
- package/dist/src/ast/node/enum/token-kind.d.ts +88 -0
- package/dist/src/ast/node/enum/token-kind.d.ts.map +1 -0
- package/dist/src/ast/node/enum/token-kind.js +88 -0
- package/dist/src/ast/node/expandable-modifier.d.ts +13 -0
- package/dist/src/ast/node/expandable-modifier.d.ts.map +1 -0
- package/dist/src/ast/node/expandable-modifier.js +15 -0
- package/dist/src/ast/node/explicit-array-dimension.d.ts +12 -0
- package/dist/src/ast/node/explicit-array-dimension.d.ts.map +1 -0
- package/dist/src/ast/node/explicit-array-dimension.js +9 -0
- package/dist/src/ast/node/expression-statement.d.ts +13 -0
- package/dist/src/ast/node/expression-statement.d.ts.map +1 -0
- package/dist/src/ast/node/expression-statement.js +11 -0
- package/dist/src/ast/node/extended-class-id-range.d.ts +12 -0
- package/dist/src/ast/node/extended-class-id-range.d.ts.map +1 -0
- package/dist/src/ast/node/extended-class-id-range.js +11 -0
- package/dist/src/ast/node/extends-modifier.d.ts +13 -0
- package/dist/src/ast/node/extends-modifier.d.ts.map +1 -0
- package/dist/src/ast/node/extends-modifier.js +13 -0
- package/dist/src/ast/node/for-statement.d.ts +20 -0
- package/dist/src/ast/node/for-statement.d.ts.map +1 -0
- package/dist/src/ast/node/for-statement.js +31 -0
- package/dist/src/ast/node/identifier.d.ts +7 -0
- package/dist/src/ast/node/identifier.d.ts.map +1 -0
- package/dist/src/ast/node/identifier.js +9 -0
- package/dist/src/ast/node/if-statement.d.ts +18 -0
- package/dist/src/ast/node/if-statement.d.ts.map +1 -0
- package/dist/src/ast/node/if-statement.js +21 -0
- package/dist/src/ast/node/implicit-array-dimension.d.ts +14 -0
- package/dist/src/ast/node/implicit-array-dimension.d.ts.map +1 -0
- package/dist/src/ast/node/implicit-array-dimension.js +13 -0
- package/dist/src/ast/node/length-attribute.d.ts +14 -0
- package/dist/src/ast/node/length-attribute.d.ts.map +1 -0
- package/dist/src/ast/node/length-attribute.js +13 -0
- package/dist/src/ast/node/length-of-expression.d.ts +13 -0
- package/dist/src/ast/node/length-of-expression.d.ts.map +1 -0
- package/dist/src/ast/node/length-of-expression.js +15 -0
- package/dist/src/ast/node/map-declaration.d.ts +21 -0
- package/dist/src/ast/node/map-declaration.d.ts.map +1 -0
- package/dist/src/ast/node/map-declaration.js +27 -0
- package/dist/src/ast/node/map-definition.d.ts +19 -0
- package/dist/src/ast/node/map-definition.d.ts.map +1 -0
- package/dist/src/ast/node/map-definition.js +25 -0
- package/dist/src/ast/node/map-entry.d.ts +13 -0
- package/dist/src/ast/node/map-entry.d.ts.map +1 -0
- package/dist/src/ast/node/map-entry.js +13 -0
- package/dist/src/ast/node/missing-error.d.ts +6 -0
- package/dist/src/ast/node/missing-error.d.ts.map +1 -0
- package/dist/src/ast/node/missing-error.js +7 -0
- package/dist/src/ast/node/number-literal.d.ts +11 -0
- package/dist/src/ast/node/number-literal.d.ts.map +1 -0
- package/dist/src/ast/node/number-literal.js +15 -0
- package/dist/src/ast/node/parameter-list.d.ts +13 -0
- package/dist/src/ast/node/parameter-list.d.ts.map +1 -0
- package/dist/src/ast/node/parameter-list.js +15 -0
- package/dist/src/ast/node/parameter-value-list.d.ts +15 -0
- package/dist/src/ast/node/parameter-value-list.d.ts.map +1 -0
- package/dist/src/ast/node/parameter-value-list.js +15 -0
- package/dist/src/ast/node/parameter.d.ts +12 -0
- package/dist/src/ast/node/parameter.d.ts.map +1 -0
- package/dist/src/ast/node/parameter.js +13 -0
- package/dist/src/ast/node/partial-array-dimension.d.ts +14 -0
- package/dist/src/ast/node/partial-array-dimension.d.ts.map +1 -0
- package/dist/src/ast/node/partial-array-dimension.js +13 -0
- package/dist/src/ast/node/specification.d.ts +9 -0
- package/dist/src/ast/node/specification.d.ts.map +1 -0
- package/dist/src/ast/node/specification.js +7 -0
- package/dist/src/ast/node/string-definition.d.ts +20 -0
- package/dist/src/ast/node/string-definition.d.ts.map +1 -0
- package/dist/src/ast/node/string-definition.js +25 -0
- package/dist/src/ast/node/string-literal.d.ts +12 -0
- package/dist/src/ast/node/string-literal.d.ts.map +1 -0
- package/dist/src/ast/node/string-literal.js +16 -0
- package/dist/src/ast/node/switch-statement.d.ts +21 -0
- package/dist/src/ast/node/switch-statement.d.ts.map +1 -0
- package/dist/src/ast/node/switch-statement.js +23 -0
- package/dist/src/ast/node/token.d.ts +11 -0
- package/dist/src/ast/node/token.d.ts.map +1 -0
- package/dist/src/ast/node/token.js +16 -0
- package/dist/src/ast/node/trivia.d.ts +13 -0
- package/dist/src/ast/node/trivia.d.ts.map +1 -0
- package/dist/src/ast/node/trivia.js +1 -0
- package/dist/src/ast/node/unary-expression.d.ts +19 -0
- package/dist/src/ast/node/unary-expression.d.ts.map +1 -0
- package/dist/src/ast/node/unary-expression.js +21 -0
- package/dist/src/ast/node/unexpected-error.d.ts +8 -0
- package/dist/src/ast/node/unexpected-error.d.ts.map +1 -0
- package/dist/src/ast/node/unexpected-error.js +9 -0
- package/dist/src/ast/node/while-statement.d.ts +16 -0
- package/dist/src/ast/node/while-statement.d.ts.map +1 -0
- package/dist/src/ast/node/while-statement.js +17 -0
- package/dist/src/ast/util/types.d.ts +39 -0
- package/dist/src/ast/util/types.d.ts.map +1 -0
- package/dist/src/ast/util/types.js +58 -0
- package/dist/src/ast/visitor/node-handler.d.ts +13 -0
- package/dist/src/ast/visitor/node-handler.d.ts.map +1 -0
- package/dist/src/ast/visitor/node-handler.js +1 -0
- package/dist/src/ast/visitor/node-visitor.d.ts +13 -0
- package/dist/src/ast/visitor/node-visitor.d.ts.map +1 -0
- package/dist/src/ast/visitor/node-visitor.js +1 -0
- package/dist/src/ast/visitor/traversing-visitor.d.ts +17 -0
- package/dist/src/ast/visitor/traversing-visitor.d.ts.map +1 -0
- package/dist/src/ast/visitor/traversing-visitor.js +51 -0
- package/dist/src/completion/completion-rules.d.ts +10 -0
- package/dist/src/completion/completion-rules.d.ts.map +1 -0
- package/dist/src/completion/completion-rules.js +345 -0
- package/dist/src/completion/get-potential-syntactic-tokens.d.ts +10 -0
- package/dist/src/completion/get-potential-syntactic-tokens.d.ts.map +1 -0
- package/dist/src/completion/get-potential-syntactic-tokens.js +33 -0
- package/dist/src/completion/get-potential-token-type-ids.d.ts +10 -0
- package/dist/src/completion/get-potential-token-type-ids.d.ts.map +1 -0
- package/dist/src/completion/get-potential-token-type-ids.js +74 -0
- package/dist/src/completion/hierarchical-map.d.ts +11 -0
- package/dist/src/completion/hierarchical-map.d.ts.map +1 -0
- package/dist/src/completion/hierarchical-map.js +35 -0
- package/dist/src/completion/rules/abstract-types.d.ts +7 -0
- package/dist/src/completion/rules/abstract-types.d.ts.map +1 -0
- package/dist/src/completion/rules/abstract-types.js +165 -0
- package/dist/src/completion/rules/aggregate-output-value-rules.d.ts +8 -0
- package/dist/src/completion/rules/aggregate-output-value-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/aggregate-output-value-rules.js +29 -0
- package/dist/src/completion/rules/aligned-modifier-rules.d.ts +8 -0
- package/dist/src/completion/rules/aligned-modifier-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/aligned-modifier-rules.js +42 -0
- package/dist/src/completion/rules/array-definition-rules.d.ts +14 -0
- package/dist/src/completion/rules/array-definition-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/array-definition-rules.js +78 -0
- package/dist/src/completion/rules/array-element-access-rules.d.ts +8 -0
- package/dist/src/completion/rules/array-element-access-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/array-element-access-rules.js +17 -0
- package/dist/src/completion/rules/assignment-expression-rules.d.ts +8 -0
- package/dist/src/completion/rules/assignment-expression-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/assignment-expression-rules.js +17 -0
- package/dist/src/completion/rules/binary-expression-rules.d.ts +8 -0
- package/dist/src/completion/rules/binary-expression-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/binary-expression-rules.js +21 -0
- package/dist/src/completion/rules/bit-modifier-rules.d.ts +8 -0
- package/dist/src/completion/rules/bit-modifier-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/bit-modifier-rules.js +24 -0
- package/dist/src/completion/rules/case-clause-rules.d.ts +8 -0
- package/dist/src/completion/rules/case-clause-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/case-clause-rules.js +37 -0
- package/dist/src/completion/rules/class-declaration-rules.d.ts +8 -0
- package/dist/src/completion/rules/class-declaration-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/class-declaration-rules.js +59 -0
- package/dist/src/completion/rules/class-definition-rules.d.ts +11 -0
- package/dist/src/completion/rules/class-definition-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/class-definition-rules.js +24 -0
- package/dist/src/completion/rules/class-id-range-rules.d.ts +5 -0
- package/dist/src/completion/rules/class-id-range-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/class-id-range-rules.js +16 -0
- package/dist/src/completion/rules/class-id-rules.d.ts +5 -0
- package/dist/src/completion/rules/class-id-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/class-id-rules.js +8 -0
- package/dist/src/completion/rules/class-member-access-rules.d.ts +5 -0
- package/dist/src/completion/rules/class-member-access-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/class-member-access-rules.js +6 -0
- package/dist/src/completion/rules/compound-statement-rules.d.ts +8 -0
- package/dist/src/completion/rules/compound-statement-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/compound-statement-rules.js +17 -0
- package/dist/src/completion/rules/computed-array-definition-rules.d.ts +8 -0
- package/dist/src/completion/rules/computed-array-definition-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/computed-array-definition-rules.js +24 -0
- package/dist/src/completion/rules/computed-elementary-type-rules.d.ts +14 -0
- package/dist/src/completion/rules/computed-elementary-type-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/computed-elementary-type-rules.js +35 -0
- package/dist/src/completion/rules/default-clause-rules.d.ts +8 -0
- package/dist/src/completion/rules/default-clause-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/default-clause-rules.js +21 -0
- package/dist/src/completion/rules/do-statement-rules.d.ts +8 -0
- package/dist/src/completion/rules/do-statement-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/do-statement-rules.js +33 -0
- package/dist/src/completion/rules/elementary-type-definition-rules.d.ts +11 -0
- package/dist/src/completion/rules/elementary-type-definition-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/elementary-type-definition-rules.js +52 -0
- package/dist/src/completion/rules/elementary-type-output-value-rules.d.ts +5 -0
- package/dist/src/completion/rules/elementary-type-output-value-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/elementary-type-output-value-rules.js +12 -0
- package/dist/src/completion/rules/elementary-type-rules.d.ts +8 -0
- package/dist/src/completion/rules/elementary-type-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/elementary-type-rules.js +12 -0
- package/dist/src/completion/rules/expandable-modifier-rules.d.ts +5 -0
- package/dist/src/completion/rules/expandable-modifier-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/expandable-modifier-rules.js +20 -0
- package/dist/src/completion/rules/explicit-array-dimension-rules.d.ts +8 -0
- package/dist/src/completion/rules/explicit-array-dimension-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/explicit-array-dimension-rules.js +17 -0
- package/dist/src/completion/rules/expression-statement-rules.d.ts +8 -0
- package/dist/src/completion/rules/expression-statement-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/expression-statement-rules.js +17 -0
- package/dist/src/completion/rules/extended-class-id-range-rules.d.ts +8 -0
- package/dist/src/completion/rules/extended-class-id-range-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/extended-class-id-range-rules.js +16 -0
- package/dist/src/completion/rules/extends-modifier-rules.d.ts +5 -0
- package/dist/src/completion/rules/extends-modifier-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/extends-modifier-rules.js +16 -0
- package/dist/src/completion/rules/for-statement-rules.d.ts +11 -0
- package/dist/src/completion/rules/for-statement-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/for-statement-rules.js +37 -0
- package/dist/src/completion/rules/if-statement-rules.d.ts +8 -0
- package/dist/src/completion/rules/if-statement-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/if-statement-rules.js +33 -0
- package/dist/src/completion/rules/implicit-array-dimension-rules.d.ts +11 -0
- package/dist/src/completion/rules/implicit-array-dimension-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/implicit-array-dimension-rules.js +20 -0
- package/dist/src/completion/rules/length-attribute-rules.d.ts +8 -0
- package/dist/src/completion/rules/length-attribute-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/length-attribute-rules.js +14 -0
- package/dist/src/completion/rules/lengthof-expression-rules.d.ts +8 -0
- package/dist/src/completion/rules/lengthof-expression-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/lengthof-expression-rules.js +21 -0
- package/dist/src/completion/rules/map-declaration-rules.d.ts +11 -0
- package/dist/src/completion/rules/map-declaration-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/map-declaration-rules.js +44 -0
- package/dist/src/completion/rules/map-definition-rules.d.ts +11 -0
- package/dist/src/completion/rules/map-definition-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/map-definition-rules.js +45 -0
- package/dist/src/completion/rules/map-entry-rules.d.ts +5 -0
- package/dist/src/completion/rules/map-entry-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/map-entry-rules.js +16 -0
- package/dist/src/completion/rules/parameter-list-rules.d.ts +8 -0
- package/dist/src/completion/rules/parameter-list-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/parameter-list-rules.js +20 -0
- package/dist/src/completion/rules/parameter-rules.d.ts +11 -0
- package/dist/src/completion/rules/parameter-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/parameter-rules.js +16 -0
- package/dist/src/completion/rules/parameter-value-list-rules.d.ts +8 -0
- package/dist/src/completion/rules/parameter-value-list-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/parameter-value-list-rules.js +21 -0
- package/dist/src/completion/rules/partial-array-dimension-rules.d.ts +14 -0
- package/dist/src/completion/rules/partial-array-dimension-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/partial-array-dimension-rules.js +25 -0
- package/dist/src/completion/rules/specification-rules.d.ts +5 -0
- package/dist/src/completion/rules/specification-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/specification-rules.js +36 -0
- package/dist/src/completion/rules/string-definition-rules.d.ts +11 -0
- package/dist/src/completion/rules/string-definition-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/string-definition-rules.js +74 -0
- package/dist/src/completion/rules/switch-statement-rules.d.ts +8 -0
- package/dist/src/completion/rules/switch-statement-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/switch-statement-rules.js +37 -0
- package/dist/src/completion/rules/unary-expression-rules.d.ts +5 -0
- package/dist/src/completion/rules/unary-expression-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/unary-expression-rules.js +33 -0
- package/dist/src/completion/rules/utf-string-literal-rules.d.ts +5 -0
- package/dist/src/completion/rules/utf-string-literal-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/utf-string-literal-rules.js +16 -0
- package/dist/src/completion/rules/while-statement-rules.d.ts +8 -0
- package/dist/src/completion/rules/while-statement-rules.d.ts.map +1 -0
- package/dist/src/completion/rules/while-statement-rules.js +29 -0
- package/dist/src/lezer/context-tracker.d.ts +4 -0
- package/dist/src/lezer/context-tracker.d.ts.map +1 -0
- package/dist/src/lezer/context-tracker.js +35 -0
- package/dist/src/lezer/create-sdl-parser.d.ts +10 -0
- package/dist/src/lezer/create-sdl-parser.d.ts.map +1 -0
- package/dist/src/lezer/create-sdl-parser.js +76 -0
- package/dist/src/lezer/create-syntax-error-from-text-and-cursor.d.ts +12 -0
- package/dist/src/lezer/create-syntax-error-from-text-and-cursor.d.ts.map +1 -0
- package/dist/src/lezer/create-syntax-error-from-text-and-cursor.js +68 -0
- package/dist/src/lezer/create-syntax-error-from-text-and-position.d.ts +11 -0
- package/dist/src/lezer/create-syntax-error-from-text-and-position.d.ts.map +1 -0
- package/dist/src/lezer/create-syntax-error-from-text-and-position.js +24 -0
- package/dist/src/lezer/parser.d.ts +3 -0
- package/dist/src/lezer/parser.d.ts.map +1 -0
- package/dist/src/lezer/parser.js +60 -0
- package/dist/src/lezer/parser.terms.d.ts +2 -0
- package/dist/src/lezer/parser.terms.d.ts.map +1 -0
- package/dist/src/lezer/parser.terms.js +2 -0
- package/dist/src/lezer/props/fold-node-prop-source.d.ts +2 -0
- package/dist/src/lezer/props/fold-node-prop-source.d.ts.map +1 -0
- package/dist/src/lezer/props/fold-node-prop-source.js +24 -0
- package/dist/src/lezer/props/primitive-node-prop-source.d.ts +4 -0
- package/dist/src/lezer/props/primitive-node-prop-source.d.ts.map +1 -0
- package/dist/src/lezer/props/primitive-node-prop-source.js +13 -0
- package/dist/src/lezer/props/style-tags-node-prop-source.d.ts +2 -0
- package/dist/src/lezer/props/style-tags-node-prop-source.d.ts.map +1 -0
- package/dist/src/lezer/props/style-tags-node-prop-source.js +181 -0
- package/dist/src/lezer/props/syntactic-token-node-prop-source.d.ts +5 -0
- package/dist/src/lezer/props/syntactic-token-node-prop-source.d.ts.map +1 -0
- package/dist/src/lezer/props/syntactic-token-node-prop-source.js +290 -0
- package/dist/src/lezer/sdl-string-input.d.ts +33 -0
- package/dist/src/lezer/sdl-string-input.d.ts.map +1 -0
- package/dist/src/lezer/sdl-string-input.js +39 -0
- package/dist/src/location.d.ts +14 -0
- package/dist/src/location.d.ts.map +1 -0
- package/dist/src/location.js +1 -0
- package/dist/src/parse-helper.d.ts +28 -0
- package/dist/src/parse-helper.d.ts.map +1 -0
- package/dist/src/parse-helper.js +67 -0
- package/dist/src/prettier/prettier-plugin-sdl.d.ts +3 -0
- package/dist/src/prettier/prettier-plugin-sdl.d.ts.map +1 -0
- package/dist/src/prettier/prettier-plugin-sdl.js +70 -0
- package/dist/src/prettier/print-abstract-array-dimension.d.ts +5 -0
- package/dist/src/prettier/print-abstract-array-dimension.d.ts.map +1 -0
- package/dist/src/prettier/print-abstract-array-dimension.js +41 -0
- package/dist/src/prettier/print-abstract-class-id.d.ts +5 -0
- package/dist/src/prettier/print-abstract-class-id.d.ts.map +1 -0
- package/dist/src/prettier/print-abstract-class-id.js +27 -0
- package/dist/src/prettier/print-abstract-expression.d.ts +5 -0
- package/dist/src/prettier/print-abstract-expression.d.ts.map +1 -0
- package/dist/src/prettier/print-abstract-expression.js +74 -0
- package/dist/src/prettier/print-abstract-node.d.ts +5 -0
- package/dist/src/prettier/print-abstract-node.d.ts.map +1 -0
- package/dist/src/prettier/print-abstract-node.js +144 -0
- package/dist/src/prettier/print-abstract-statement.d.ts +5 -0
- package/dist/src/prettier/print-abstract-statement.d.ts.map +1 -0
- package/dist/src/prettier/print-abstract-statement.js +70 -0
- package/dist/src/prettier/print-aggregate-output-value.d.ts +5 -0
- package/dist/src/prettier/print-aggregate-output-value.d.ts.map +1 -0
- package/dist/src/prettier/print-aggregate-output-value.js +11 -0
- package/dist/src/prettier/print-aligned-modifier.d.ts +5 -0
- package/dist/src/prettier/print-aligned-modifier.d.ts.map +1 -0
- package/dist/src/prettier/print-aligned-modifier.js +16 -0
- package/dist/src/prettier/print-array-definition.d.ts +5 -0
- package/dist/src/prettier/print-array-definition.d.ts.map +1 -0
- package/dist/src/prettier/print-array-definition.js +40 -0
- package/dist/src/prettier/print-array-element-access.d.ts +5 -0
- package/dist/src/prettier/print-array-element-access.d.ts.map +1 -0
- package/dist/src/prettier/print-array-element-access.js +7 -0
- package/dist/src/prettier/print-bit-modifier.d.ts +5 -0
- package/dist/src/prettier/print-bit-modifier.d.ts.map +1 -0
- package/dist/src/prettier/print-bit-modifier.js +22 -0
- package/dist/src/prettier/print-case-clause.d.ts +5 -0
- package/dist/src/prettier/print-case-clause.d.ts.map +1 -0
- package/dist/src/prettier/print-case-clause.js +28 -0
- package/dist/src/prettier/print-class-declaration.d.ts +5 -0
- package/dist/src/prettier/print-class-declaration.d.ts.map +1 -0
- package/dist/src/prettier/print-class-declaration.js +39 -0
- package/dist/src/prettier/print-class-definition.d.ts +5 -0
- package/dist/src/prettier/print-class-definition.d.ts.map +1 -0
- package/dist/src/prettier/print-class-definition.js +20 -0
- package/dist/src/prettier/print-class-member-access.d.ts +5 -0
- package/dist/src/prettier/print-class-member-access.d.ts.map +1 -0
- package/dist/src/prettier/print-class-member-access.js +3 -0
- package/dist/src/prettier/print-computed-array-definition.d.ts +5 -0
- package/dist/src/prettier/print-computed-array-definition.d.ts.map +1 -0
- package/dist/src/prettier/print-computed-array-definition.js +15 -0
- package/dist/src/prettier/print-computed-elementary-type-definition.d.ts +5 -0
- package/dist/src/prettier/print-computed-elementary-type-definition.d.ts.map +1 -0
- package/dist/src/prettier/print-computed-elementary-type-definition.js +24 -0
- package/dist/src/prettier/print-default-clause.d.ts +5 -0
- package/dist/src/prettier/print-default-clause.d.ts.map +1 -0
- package/dist/src/prettier/print-default-clause.js +15 -0
- package/dist/src/prettier/print-do-statement.d.ts +5 -0
- package/dist/src/prettier/print-do-statement.d.ts.map +1 -0
- package/dist/src/prettier/print-do-statement.js +19 -0
- package/dist/src/prettier/print-elementary-type-definition.d.ts +5 -0
- package/dist/src/prettier/print-elementary-type-definition.d.ts.map +1 -0
- package/dist/src/prettier/print-elementary-type-definition.js +42 -0
- package/dist/src/prettier/print-elementary-type-output-value.d.ts +5 -0
- package/dist/src/prettier/print-elementary-type-output-value.d.ts.map +1 -0
- package/dist/src/prettier/print-elementary-type-output-value.js +3 -0
- package/dist/src/prettier/print-elementary-type.d.ts +5 -0
- package/dist/src/prettier/print-elementary-type.d.ts.map +1 -0
- package/dist/src/prettier/print-elementary-type.js +12 -0
- package/dist/src/prettier/print-expandable-modifier.d.ts +5 -0
- package/dist/src/prettier/print-expandable-modifier.d.ts.map +1 -0
- package/dist/src/prettier/print-expandable-modifier.js +13 -0
- package/dist/src/prettier/print-extends-modifier.d.ts +5 -0
- package/dist/src/prettier/print-extends-modifier.d.ts.map +1 -0
- package/dist/src/prettier/print-extends-modifier.js +12 -0
- package/dist/src/prettier/print-for-statement.d.ts +5 -0
- package/dist/src/prettier/print-for-statement.d.ts.map +1 -0
- package/dist/src/prettier/print-for-statement.js +33 -0
- package/dist/src/prettier/print-identifier.d.ts +5 -0
- package/dist/src/prettier/print-identifier.d.ts.map +1 -0
- package/dist/src/prettier/print-identifier.js +3 -0
- package/dist/src/prettier/print-if-statement.d.ts +5 -0
- package/dist/src/prettier/print-if-statement.d.ts.map +1 -0
- package/dist/src/prettier/print-if-statement.js +44 -0
- package/dist/src/prettier/print-length-attribute.d.ts +5 -0
- package/dist/src/prettier/print-length-attribute.d.ts.map +1 -0
- package/dist/src/prettier/print-length-attribute.js +7 -0
- package/dist/src/prettier/print-map-declaration.d.ts +5 -0
- package/dist/src/prettier/print-map-declaration.d.ts.map +1 -0
- package/dist/src/prettier/print-map-declaration.js +31 -0
- package/dist/src/prettier/print-map-definition.d.ts +5 -0
- package/dist/src/prettier/print-map-definition.d.ts.map +1 -0
- package/dist/src/prettier/print-map-definition.js +28 -0
- package/dist/src/prettier/print-map-entry.d.ts +5 -0
- package/dist/src/prettier/print-map-entry.d.ts.map +1 -0
- package/dist/src/prettier/print-map-entry.js +9 -0
- package/dist/src/prettier/print-number-literal.d.ts +5 -0
- package/dist/src/prettier/print-number-literal.d.ts.map +1 -0
- package/dist/src/prettier/print-number-literal.js +62 -0
- package/dist/src/prettier/print-parameter-list.d.ts +5 -0
- package/dist/src/prettier/print-parameter-list.d.ts.map +1 -0
- package/dist/src/prettier/print-parameter-list.js +9 -0
- package/dist/src/prettier/print-parameter-value-list.d.ts +5 -0
- package/dist/src/prettier/print-parameter-value-list.d.ts.map +1 -0
- package/dist/src/prettier/print-parameter-value-list.js +9 -0
- package/dist/src/prettier/print-parameter.d.ts +5 -0
- package/dist/src/prettier/print-parameter.d.ts.map +1 -0
- package/dist/src/prettier/print-parameter.js +15 -0
- package/dist/src/prettier/print-specification.d.ts +5 -0
- package/dist/src/prettier/print-specification.d.ts.map +1 -0
- package/dist/src/prettier/print-specification.js +30 -0
- package/dist/src/prettier/print-string-definition.d.ts +5 -0
- package/dist/src/prettier/print-string-definition.d.ts.map +1 -0
- package/dist/src/prettier/print-string-definition.js +57 -0
- package/dist/src/prettier/print-string-literal.d.ts +5 -0
- package/dist/src/prettier/print-string-literal.d.ts.map +1 -0
- package/dist/src/prettier/print-string-literal.js +50 -0
- package/dist/src/prettier/print-switch-statement.d.ts +5 -0
- package/dist/src/prettier/print-switch-statement.d.ts.map +1 -0
- package/dist/src/prettier/print-switch-statement.js +20 -0
- package/dist/src/prettier/print-token.d.ts +4 -0
- package/dist/src/prettier/print-token.d.ts.map +1 -0
- package/dist/src/prettier/print-token.js +4 -0
- package/dist/src/prettier/print-unexpected-error.d.ts +5 -0
- package/dist/src/prettier/print-unexpected-error.d.ts.map +1 -0
- package/dist/src/prettier/print-unexpected-error.js +3 -0
- package/dist/src/prettier/print-while-statement.d.ts +5 -0
- package/dist/src/prettier/print-while-statement.d.ts.map +1 -0
- package/dist/src/prettier/print-while-statement.js +15 -0
- package/dist/src/prettier/util/print-utils.d.ts +56 -0
- package/dist/src/prettier/util/print-utils.d.ts.map +1 -0
- package/dist/src/prettier/util/print-utils.js +456 -0
- package/dist/src/prettier/util/types.d.ts +13 -0
- package/dist/src/prettier/util/types.d.ts.map +1 -0
- package/dist/src/prettier/util/types.js +20 -0
- package/dist/src/scanner-error.d.ts +36 -0
- package/dist/src/scanner-error.d.ts.map +1 -0
- package/dist/src/scanner-error.js +51 -0
- package/dist/src/util/location-utils.d.ts +4 -0
- package/dist/src/util/location-utils.d.ts.map +1 -0
- package/dist/src/util/location-utils.js +11 -0
- package/dist/src/util/logger.d.ts +22 -0
- package/dist/src/util/logger.d.ts.map +1 -0
- package/dist/src/util/logger.js +94 -0
- package/package.json +34 -30
- package/src/analyser/checks/check-array-definition.ts +5 -15
- package/src/analyser/checks/check-array-element-access.ts +1 -5
- package/src/analyser/checks/check-class-declaration.ts +26 -83
- package/src/analyser/checks/check-computed-array-definition.ts +3 -12
- package/src/analyser/checks/check-computed-elementary-type-definition.ts +2 -7
- package/src/analyser/checks/check-elementary-type-definition.ts +41 -48
- package/src/analyser/checks/check-expression-binary.ts +66 -60
- package/src/analyser/checks/check-expression-lengthof.ts +2 -7
- package/src/analyser/checks/check-expression-unary.ts +9 -19
- package/src/analyser/checks/check-identifier.ts +2 -7
- package/src/analyser/checks/check-if-statement.ts +4 -15
- package/src/analyser/checks/check-map-declaration.ts +15 -17
- package/src/analyser/checks/check-map-definition.ts +9 -22
- package/src/analyser/checks/check-number-literal-float.ts +2 -7
- package/src/analyser/checks/check-parameter-list.ts +3 -12
- package/src/analyser/checks/check-specification.ts +4 -13
- package/src/analyser/checks/check-switch-statement.ts +11 -27
- package/src/analyser/checks/check.ts +1 -5
- package/src/analyser/create-sdl-analyser.ts +2 -6
- package/src/analyser/node-handler/abstract-analysis-node-handler.ts +76 -154
- package/src/analyser/node-handler/build-symbol-table-node-handler.ts +39 -112
- package/src/analyser/node-handler/specific-check-node-handler.ts +14 -24
- package/src/analyser/node-handler/validate-scope-node-handler.ts +26 -55
- package/src/analyser/node-handler/validate-type-node-handler.ts +45 -108
- package/src/analyser/sdl-analyser.ts +5 -16
- package/src/analyser/symbol-table.ts +14 -25
- package/src/analyser/util/symbol-table-utils.ts +28 -80
- package/src/analyser/util/type-utils.ts +38 -78
- package/src/ast/build/consume/consume-abstract-node.ts +10 -13
- package/src/ast/build/consume/consume-ast-node.ts +16 -44
- package/src/ast/build/consume/consume-primitive.ts +4 -6
- package/src/ast/build/consume/consume-trivia.ts +5 -15
- package/src/ast/build/consume/consume-white-space-and-missing-errors.ts +3 -6
- package/src/ast/build/node/build-aggregate-output-value.ts +9 -15
- package/src/ast/build/node/build-aligned-modifier.ts +9 -19
- package/src/ast/build/node/build-array-definition.ts +10 -38
- package/src/ast/build/node/build-array-element-access.ts +7 -15
- package/src/ast/build/node/build-base64-string-literal.ts +9 -19
- package/src/ast/build/node/build-binary-expression.ts +32 -38
- package/src/ast/build/node/build-binary-literal.ts +3 -12
- package/src/ast/build/node/build-bit-modifier.ts +6 -25
- package/src/ast/build/node/build-case-clause.ts +8 -34
- package/src/ast/build/node/build-class-declaration.ts +7 -29
- package/src/ast/build/node/build-class-definition.ts +4 -16
- package/src/ast/build/node/build-class-id-range.ts +5 -14
- package/src/ast/build/node/build-class-id.ts +3 -11
- package/src/ast/build/node/build-class-member-access.ts +4 -10
- package/src/ast/build/node/build-compound-statement.ts +5 -11
- package/src/ast/build/node/build-computed-array-definition.ts +4 -18
- package/src/ast/build/node/build-computed-elementary-type-definition.ts +9 -25
- package/src/ast/build/node/build-decimal-literal.ts +2 -8
- package/src/ast/build/node/build-default-clause.ts +5 -22
- package/src/ast/build/node/build-do-statement.ts +4 -16
- package/src/ast/build/node/build-elementary-type-definition.ts +16 -32
- package/src/ast/build/node/build-elementary-type-output-value.ts +3 -7
- package/src/ast/build/node/build-elementary-type.ts +7 -13
- package/src/ast/build/node/build-expandable-modifier.ts +2 -7
- package/src/ast/build/node/build-explicit-array-dimension.ts +9 -13
- package/src/ast/build/node/build-expression-statement.ts +4 -9
- package/src/ast/build/node/build-extended-class-id-range.ts +5 -14
- package/src/ast/build/node/build-extends-modifier.ts +4 -18
- package/src/ast/build/node/build-floating-point-literal.ts +2 -8
- package/src/ast/build/node/build-for-statement.ts +9 -33
- package/src/ast/build/node/build-hexadecimal-literal.ts +3 -12
- package/src/ast/build/node/build-identifier.ts +1 -3
- package/src/ast/build/node/build-if-statement.ts +6 -24
- package/src/ast/build/node/build-implicit-array-dimension.ts +8 -15
- package/src/ast/build/node/build-integer-literal.ts +2 -8
- package/src/ast/build/node/build-length-attribute.ts +6 -9
- package/src/ast/build/node/build-lengthof-expression.ts +6 -13
- package/src/ast/build/node/build-map-declaration.ts +8 -21
- package/src/ast/build/node/build-map-definition.ts +6 -24
- package/src/ast/build/node/build-map-entry.ts +5 -15
- package/src/ast/build/node/build-multiple-character-literal.ts +18 -23
- package/src/ast/build/node/build-parameter-list.ts +6 -11
- package/src/ast/build/node/build-parameter-value-list.ts +6 -14
- package/src/ast/build/node/build-parameter.ts +5 -21
- package/src/ast/build/node/build-partial-array-dimension.ts +6 -9
- package/src/ast/build/node/build-specification.ts +2 -6
- package/src/ast/build/node/build-string-definition.ts +11 -31
- package/src/ast/build/node/build-switch-statement.ts +6 -24
- package/src/ast/build/node/build-token.ts +3 -5
- package/src/ast/build/node/build-unary-expression.ts +13 -19
- package/src/ast/build/node/build-unexpected-error.ts +2 -6
- package/src/ast/build/node/build-utf-string-literal.ts +43 -66
- package/src/ast/build/node/build-while-statement.ts +5 -22
- package/src/ast/build/util/array-dimension-kind-by-token-type-id-map.ts +5 -17
- package/src/ast/build/util/binary-operator-kind-by-token-type-id-map.ts +2 -5
- package/src/ast/build/util/class-id-kind-by-token-type-id-map.ts +2 -7
- package/src/ast/build/util/expression-kind-by-token-type-id-map.ts +5 -17
- package/src/ast/build/util/fetch-node.ts +73 -108
- package/src/ast/build/util/node-kind-by-token-type-id-map.ts +2 -7
- package/src/ast/build/util/statement-kind-by-token-type-id-map.ts +9 -35
- package/src/ast/build/util/string-literal-kind-by-token-type-id-map.ts +4 -13
- package/src/ast/build/util/token-kind-by-token-type-id-map.ts +8 -31
- package/src/ast/build-ast.ts +9 -24
- package/src/ast/node/abstract-array-dimension.ts +1 -4
- package/src/ast/node/abstract-composite-node.ts +2 -4
- package/src/ast/node/abstract-elementary-type-definition.ts +2 -7
- package/src/ast/node/abstract-leaf-node.ts +1 -3
- package/src/ast/node/abstract-node.ts +1 -2
- package/src/ast/node/aggregate-output-value.ts +2 -9
- package/src/ast/node/aligned-modifier.ts +1 -4
- package/src/ast/node/array-definition.ts +4 -18
- package/src/ast/node/array-element-access.ts +2 -7
- package/src/ast/node/binary-expression.ts +2 -10
- package/src/ast/node/case-clause.ts +2 -9
- package/src/ast/node/class-declaration.ts +3 -12
- package/src/ast/node/class-definition.ts +1 -4
- package/src/ast/node/class-member-access.ts +1 -4
- package/src/ast/node/compound-statement.ts +1 -4
- package/src/ast/node/computed-array-definition.ts +1 -6
- package/src/ast/node/computed-elementary-type-definition.ts +1 -2
- package/src/ast/node/default-clause.ts +2 -9
- package/src/ast/node/do-statement.ts +1 -5
- package/src/ast/node/elementary-type-definition.ts +2 -10
- package/src/ast/node/elementary-type-output-value.ts +1 -4
- package/src/ast/node/elementary-type.ts +1 -4
- package/src/ast/node/expandable-modifier.ts +1 -4
- package/src/ast/node/explicit-array-dimension.ts +2 -9
- package/src/ast/node/expression-statement.ts +2 -7
- package/src/ast/node/extended-class-id-range.ts +1 -4
- package/src/ast/node/extends-modifier.ts +1 -4
- package/src/ast/node/for-statement.ts +1 -3
- package/src/ast/node/if-statement.ts +2 -7
- package/src/ast/node/implicit-array-dimension.ts +3 -16
- package/src/ast/node/length-attribute.ts +2 -7
- package/src/ast/node/length-of-expression.ts +1 -4
- package/src/ast/node/map-declaration.ts +2 -10
- package/src/ast/node/map-definition.ts +1 -4
- package/src/ast/node/number-literal.ts +0 -2
- package/src/ast/node/parameter-list.ts +2 -9
- package/src/ast/node/parameter-value-list.ts +3 -12
- package/src/ast/node/parameter.ts +1 -4
- package/src/ast/node/partial-array-dimension.ts +2 -9
- package/src/ast/node/specification.ts +2 -9
- package/src/ast/node/string-definition.ts +1 -4
- package/src/ast/node/string-literal.ts +1 -4
- package/src/ast/node/switch-statement.ts +2 -8
- package/src/ast/node/token.ts +1 -3
- package/src/ast/node/unary-expression.ts +2 -9
- package/src/ast/node/unexpected-error.ts +1 -3
- package/src/ast/node/while-statement.ts +2 -7
- package/src/ast/util/types.ts +31 -59
- package/src/ast/visitor/traversing-visitor.ts +7 -14
- package/src/completion/completion-rules.ts +25 -93
- package/src/completion/get-potential-syntactic-tokens.ts +7 -18
- package/src/completion/get-potential-token-type-ids.ts +11 -22
- package/src/completion/rules/abstract-types.ts +1 -3
- package/src/completion/rules/aggregate-output-value-rules.ts +5 -22
- package/src/completion/rules/aligned-modifier-rules.ts +1 -3
- package/src/completion/rules/array-definition-rules.ts +2 -10
- package/src/completion/rules/array-element-access-rules.ts +1 -4
- package/src/completion/rules/class-declaration-rules.ts +6 -26
- package/src/completion/rules/class-definition-rules.ts +1 -4
- package/src/completion/rules/compound-statement-rules.ts +2 -8
- package/src/completion/rules/computed-elementary-type-rules.ts +2 -9
- package/src/completion/rules/do-statement-rules.ts +1 -4
- package/src/completion/rules/elementary-type-definition-rules.ts +2 -10
- package/src/completion/rules/elementary-type-rules.ts +1 -6
- package/src/completion/rules/explicit-array-dimension-rules.ts +1 -4
- package/src/completion/rules/expression-statement-rules.ts +1 -4
- package/src/completion/rules/for-statement-rules.ts +5 -17
- package/src/completion/rules/if-statement-rules.ts +2 -9
- package/src/completion/rules/length-attribute-rules.ts +1 -4
- package/src/completion/rules/parameter-value-list-rules.ts +1 -5
- package/src/completion/rules/partial-array-dimension-rules.ts +2 -8
- package/src/completion/rules/string-definition-rules.ts +8 -36
- package/src/completion/rules/switch-statement-rules.ts +3 -14
- package/src/completion/rules/while-statement-rules.ts +2 -9
- package/src/lezer/create-sdl-parser.ts +1 -3
- package/src/lezer/create-syntax-error-from-text-and-cursor.ts +15 -39
- package/src/lezer/create-syntax-error-from-text-and-position.ts +1 -6
- package/src/lezer/parser.ts +8 -7
- package/src/lezer/props/primitive-node-prop-source.ts +2 -2
- package/src/lezer/props/style-tags-node-prop-source.ts +2 -5
- package/src/lezer/props/syntactic-token-node-prop-source.ts +3 -5
- package/src/parse-helper.ts +3 -10
- package/src/prettier/prettier-plugin-sdl.ts +7 -18
- package/src/prettier/print-abstract-array-dimension.ts +7 -30
- package/src/prettier/print-abstract-class-id.ts +3 -11
- package/src/prettier/print-abstract-expression.ts +17 -49
- package/src/prettier/print-abstract-node.ts +16 -45
- package/src/prettier/print-abstract-statement.ts +4 -16
- package/src/prettier/print-aggregate-output-value.ts +3 -13
- package/src/prettier/print-aligned-modifier.ts +3 -12
- package/src/prettier/print-array-definition.ts +9 -45
- package/src/prettier/print-bit-modifier.ts +3 -16
- package/src/prettier/print-case-clause.ts +10 -23
- package/src/prettier/print-class-declaration.ts +13 -35
- package/src/prettier/print-class-definition.ts +3 -13
- package/src/prettier/print-class-member-access.ts +1 -4
- package/src/prettier/print-computed-array-definition.ts +1 -4
- package/src/prettier/print-computed-elementary-type-definition.ts +4 -19
- package/src/prettier/print-default-clause.ts +3 -12
- package/src/prettier/print-do-statement.ts +1 -4
- package/src/prettier/print-elementary-type-definition.ts +10 -46
- package/src/prettier/print-elementary-type-output-value.ts +1 -4
- package/src/prettier/print-elementary-type.ts +1 -3
- package/src/prettier/print-expandable-modifier.ts +12 -23
- package/src/prettier/print-extends-modifier.ts +1 -6
- package/src/prettier/print-for-statement.ts +6 -20
- package/src/prettier/print-if-statement.ts +8 -19
- package/src/prettier/print-map-declaration.ts +5 -20
- package/src/prettier/print-map-definition.ts +6 -29
- package/src/prettier/print-map-entry.ts +1 -4
- package/src/prettier/print-number-literal.ts +2 -7
- package/src/prettier/print-parameter.ts +2 -12
- package/src/prettier/print-specification.ts +4 -4
- package/src/prettier/print-string-definition.ts +9 -43
- package/src/prettier/print-string-literal.ts +1 -1
- package/src/prettier/print-switch-statement.ts +3 -11
- package/src/prettier/util/print-utils.ts +23 -61
- package/src/prettier/util/types.ts +12 -19
- package/src/scanner-error.ts +2 -8
- package/src/util/location-utils.ts +1 -4
- package/src/util/logger.ts +13 -43
- package/bun.lock +0 -65
- package/tests/analyser/create-sdl-analyser.test.ts +0 -54
- package/tests/analyser/get-sdl-analyser-test-scenarios.ts +0 -80
- package/tests/analyser/sdl-analyser-scenarios.test.ts +0 -67
- package/tests/analyser/semantic-error-scenarios.test.ts +0 -40
- package/tests/analyser/symbol-table.test.ts +0 -188
- package/tests/analyser/test-cases/array_definition.txt +0 -50
- package/tests/analyser/test-cases/class_declaration.txt +0 -112
- package/tests/analyser/test-cases/class_definition.txt +0 -60
- package/tests/analyser/test-cases/compound_statement.txt +0 -63
- package/tests/analyser/test-cases/computed_array_definition.txt +0 -12
- package/tests/analyser/test-cases/computed_elementary_type_definition.txt +0 -39
- package/tests/analyser/test-cases/do_statement.txt +0 -16
- package/tests/analyser/test-cases/elementary_type_definition.txt +0 -58
- package/tests/analyser/test-cases/expression.txt +0 -159
- package/tests/analyser/test-cases/for_statement.txt +0 -55
- package/tests/analyser/test-cases/if_statement.txt +0 -57
- package/tests/analyser/test-cases/map_declaration.txt +0 -89
- package/tests/analyser/test-cases/map_definition.txt +0 -35
- package/tests/analyser/test-cases/number_literal.txt +0 -31
- package/tests/analyser/test-cases/parameter_list.txt +0 -16
- package/tests/analyser/test-cases/scopes.txt +0 -239
- package/tests/analyser/test-cases/specification.txt +0 -28
- package/tests/analyser/test-cases/string_definition.txt +0 -40
- package/tests/analyser/test-cases/switch_statement.txt +0 -96
- package/tests/analyser/test-cases/while_statement.txt +0 -16
- package/tests/analyser/util/symbol-table-utils.test.ts +0 -65
- package/tests/ast/__snapshots__/build-ast.test.ts.snap +0 -38897
- package/tests/ast/build-ast.test.ts +0 -463
- package/tests/ast/visitor/traversing-visitor.test.ts +0 -36
- package/tests/completion/get-potential-syntactic-tokens.test.ts +0 -89
- package/tests/completion/get-potential-token-type-ids.test.ts +0 -76
- package/tests/completion/test-potential-syntactic-tokens-scenario.ts +0 -24
- package/tests/completion/test-potential-token-type-ids-scenario.ts +0 -33
- package/tests/fixtures/history-recording-node-handler.ts +0 -232
- package/tests/lezer/create-parse-error-from-text-and-position.test.ts +0 -129
- package/tests/lezer/create-sdl-parser.test.ts +0 -15
- package/tests/lezer/sdl-parser-scenarios.test.ts +0 -24
- package/tests/lezer/sdl-string-input.test.ts +0 -12
- package/tests/lezer/syntax-error-scenarios.test.ts +0 -114
- package/tests/lezer/test-cases/array_definition.txt +0 -109
- package/tests/lezer/test-cases/class_declaration.txt +0 -141
- package/tests/lezer/test-cases/class_definition.txt +0 -89
- package/tests/lezer/test-cases/comment.txt +0 -335
- package/tests/lezer/test-cases/compound_statement.txt +0 -109
- package/tests/lezer/test-cases/computed_array_definition.txt +0 -33
- package/tests/lezer/test-cases/computed_elementary_type_definition.txt +0 -59
- package/tests/lezer/test-cases/do_statement.txt +0 -48
- package/tests/lezer/test-cases/elementary_type_definition.txt +0 -158
- package/tests/lezer/test-cases/expression.txt +0 -1203
- package/tests/lezer/test-cases/for_statement.txt +0 -183
- package/tests/lezer/test-cases/if_statement.txt +0 -183
- package/tests/lezer/test-cases/invalid.txt +0 -97
- package/tests/lezer/test-cases/map_declaration.txt +0 -152
- package/tests/lezer/test-cases/map_definition.txt +0 -59
- package/tests/lezer/test-cases/number_literal.txt +0 -273
- package/tests/lezer/test-cases/specification.txt +0 -38
- package/tests/lezer/test-cases/string_definition.txt +0 -263
- package/tests/lezer/test-cases/string_literal.txt +0 -303
- package/tests/lezer/test-cases/switch_statement.txt +0 -407
- package/tests/lezer/test-cases/while_statement.txt +0 -45
- package/tests/parse-helper.test.ts +0 -361
- package/tests/prettier/__snapshots__/prettier-plugin-sdl.test.ts.snap +0 -127
- package/tests/prettier/prettier-plugin-sdl.test.ts +0 -58
- package/tests/prettier/print-array.test.ts +0 -29
- package/tests/prettier/print-class.test.ts +0 -15
- package/tests/prettier/print-do.test.ts +0 -25
- package/tests/prettier/print-elementary-type.test.ts +0 -62
- package/tests/prettier/print-error.test.ts +0 -40
- package/tests/prettier/print-expression.test.ts +0 -17
- package/tests/prettier/print-for.test.ts +0 -23
- package/tests/prettier/print-if.test.ts +0 -71
- package/tests/prettier/print-number-literal.test.ts +0 -28
- package/tests/prettier/print-specification.test.ts +0 -54
- package/tests/prettier/print-string.test.ts +0 -36
- package/tests/prettier/print-switch.test.ts +0 -69
- package/tests/prettier/print-while.test.ts +0 -23
- package/tests/prettier/test-prettier-scenario.ts +0 -41
- package/tests/prettier/util/print-utils.test.ts +0 -665
- package/tests/prettier/util/types.test.ts +0 -38
- package/tests/sample-specifications/invalid.sdl +0 -24
- package/tests/sample-specifications/prettified-invalid.sdl +0 -28
- package/tests/sample-specifications/prettified-various-elements-narrow.sdl +0 -97
- package/tests/sample-specifications/prettified-various-elements.sdl +0 -90
- package/tests/sample-specifications/sample.sdl +0 -24
- package/tests/sample-specifications/various-elements.sdl +0 -88
- package/tests/util/logger.test.ts +0 -36
- package/tsconfig.json +0 -29
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { createSyntaxErrorFromTextAndCursor } from "../../../lezer/create-syntax-error-from-text-and-cursor.js";
|
|
2
|
+
import { primitiveNodeProp } from "../../../lezer/props/primitive-node-prop-source.js";
|
|
3
|
+
import { buildToken } from "../node/build-token.js";
|
|
4
|
+
import { consumeTrivia } from "./consume-trivia.js";
|
|
5
|
+
import { InternalScannerError } from "../../../scanner-error.js";
|
|
6
|
+
import getLogger from "../../../util/logger.js";
|
|
7
|
+
import { buildMissingError } from "../node/build-missing-error.js";
|
|
8
|
+
import { consumePrimitive } from "./consume-primitive.js";
|
|
9
|
+
import { consumeAstNode } from "./consume-ast-node.js";
|
|
10
|
+
import { Specification } from "../../node/specification.js";
|
|
11
|
+
import { NodeKind } from "../../node/enum/node-kind.js";
|
|
12
|
+
import { tokenKindByTokenTypeId } from "../util/token-kind-by-token-type-id-map.js";
|
|
13
|
+
import { nodeKindByTokenTypeId } from "../util/node-kind-by-token-type-id-map.js";
|
|
14
|
+
import { UnexpectedError } from "../../node/unexpected-error.js";
|
|
15
|
+
const logger = getLogger("consumeAbstractNode");
|
|
16
|
+
export var NodeScenario;
|
|
17
|
+
(function (NodeScenario) {
|
|
18
|
+
/** Missing Error Node */
|
|
19
|
+
NodeScenario[NodeScenario["MISSING_NODE"] = 0] = "MISSING_NODE";
|
|
20
|
+
/** Unexpected Error Node containing a child which is the unexpected token */
|
|
21
|
+
NodeScenario[NodeScenario["UNEXPECTED_NODE"] = 1] = "UNEXPECTED_NODE";
|
|
22
|
+
/** Unknown Error Node which has text of an unknown token */
|
|
23
|
+
NodeScenario[NodeScenario["UNKNOWN_TOKEN"] = 2] = "UNKNOWN_TOKEN";
|
|
24
|
+
/** Primitive Node e.g. Identifier, IntegerLiteral... */
|
|
25
|
+
NodeScenario[NodeScenario["PRIMITIVE"] = 3] = "PRIMITIVE";
|
|
26
|
+
/** Terminal Token Node e.g. class, int... */
|
|
27
|
+
NodeScenario[NodeScenario["TOKEN"] = 4] = "TOKEN";
|
|
28
|
+
/** Non-Terminal AST Node e.g. ClassDeclaration, ExpressionStatement... */
|
|
29
|
+
NodeScenario[NodeScenario["AST_NODE"] = 5] = "AST_NODE";
|
|
30
|
+
/** Terminal AST Node with missing children e.g. ClassDeclaration, ExpressionStatement... */
|
|
31
|
+
NodeScenario[NodeScenario["EMPTY_AST_NODE"] = 6] = "EMPTY_AST_NODE";
|
|
32
|
+
})(NodeScenario || (NodeScenario = {}));
|
|
33
|
+
function determineNodeScenario(buildContext) {
|
|
34
|
+
const { cursor, text, lenient } = buildContext;
|
|
35
|
+
const isError = cursor.type.isError;
|
|
36
|
+
if (isError && !lenient) {
|
|
37
|
+
throw createSyntaxErrorFromTextAndCursor(text, cursor);
|
|
38
|
+
}
|
|
39
|
+
// Check if current sytax node is a terminal token by attempting to move to first child
|
|
40
|
+
const childExists = cursor.firstChild();
|
|
41
|
+
if (isError) {
|
|
42
|
+
// If the cursor was an error and it has a child, it is an unexpected token error
|
|
43
|
+
// In this case the child is the unexpected token, we can treat it like an AST node
|
|
44
|
+
// so move back to parent
|
|
45
|
+
if (childExists) {
|
|
46
|
+
cursor.parent();
|
|
47
|
+
return NodeScenario.UNEXPECTED_NODE;
|
|
48
|
+
}
|
|
49
|
+
// If it is an error and no child exists, check if there is text, if so treat this as an
|
|
50
|
+
// unknown token error.
|
|
51
|
+
if (cursor.to > cursor.from) {
|
|
52
|
+
return NodeScenario.UNKNOWN_TOKEN;
|
|
53
|
+
}
|
|
54
|
+
// Otherwise it is a missing node error.
|
|
55
|
+
return NodeScenario.MISSING_NODE;
|
|
56
|
+
}
|
|
57
|
+
// If we have a child, we should not use it yet, so move back to parent
|
|
58
|
+
if (childExists) {
|
|
59
|
+
cursor.parent();
|
|
60
|
+
}
|
|
61
|
+
// Primitive is a terminal custom text rather than a syntax token, this will be treated slightly differently
|
|
62
|
+
if (cursor.type.prop(primitiveNodeProp)) {
|
|
63
|
+
return NodeScenario.PRIMITIVE;
|
|
64
|
+
}
|
|
65
|
+
// Check if it is a token type
|
|
66
|
+
if (tokenKindByTokenTypeId.get(cursor.type.id) !== undefined) {
|
|
67
|
+
return NodeScenario.TOKEN;
|
|
68
|
+
}
|
|
69
|
+
// If it has no children, it is an empty AST node
|
|
70
|
+
if (!childExists) {
|
|
71
|
+
return NodeScenario.EMPTY_AST_NODE;
|
|
72
|
+
}
|
|
73
|
+
// Otherwise it is a non-terminal AST node
|
|
74
|
+
return NodeScenario.AST_NODE;
|
|
75
|
+
}
|
|
76
|
+
/*
|
|
77
|
+
* Iterate through the syntax tree and consume parse tree tokens to create an AST node.
|
|
78
|
+
*/
|
|
79
|
+
export function consumeAbstractNode(buildContext) {
|
|
80
|
+
const { cursor } = buildContext;
|
|
81
|
+
const currentState = buildContext.stateStack[buildContext.stateStack.length - 1];
|
|
82
|
+
// Get any leading trivia for the node
|
|
83
|
+
const leadingTrivia = consumeTrivia(buildContext, false);
|
|
84
|
+
// If no siblings remain to be consumed, return undefined
|
|
85
|
+
if (currentState.isEndOfSiblings) {
|
|
86
|
+
if (leadingTrivia.length > 0) {
|
|
87
|
+
if (buildContext.unconsumedTrivia) {
|
|
88
|
+
throw new InternalScannerError(`Expected no unconsumed trivia, but found some.`);
|
|
89
|
+
}
|
|
90
|
+
buildContext.unconsumedTrivia = leadingTrivia;
|
|
91
|
+
}
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
// Determine what kind of node we are about to consume
|
|
95
|
+
const nodeScenario = determineNodeScenario(buildContext);
|
|
96
|
+
logger.debug(currentState.indent +
|
|
97
|
+
"consuming node: " +
|
|
98
|
+
cursor.name +
|
|
99
|
+
` (scenario: ${NodeScenario[nodeScenario]})`);
|
|
100
|
+
let node;
|
|
101
|
+
switch (nodeScenario) {
|
|
102
|
+
case NodeScenario.MISSING_NODE:
|
|
103
|
+
node = buildMissingError(buildContext);
|
|
104
|
+
break;
|
|
105
|
+
case NodeScenario.PRIMITIVE:
|
|
106
|
+
node = consumePrimitive(buildContext);
|
|
107
|
+
break;
|
|
108
|
+
case NodeScenario.UNKNOWN_TOKEN: {
|
|
109
|
+
const unknownToken = buildToken(buildContext);
|
|
110
|
+
// wrap unknown token in unexpected node
|
|
111
|
+
node = new UnexpectedError(unknownToken);
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
case NodeScenario.TOKEN:
|
|
115
|
+
node = buildToken(buildContext);
|
|
116
|
+
break;
|
|
117
|
+
case NodeScenario.UNEXPECTED_NODE:
|
|
118
|
+
case NodeScenario.AST_NODE:
|
|
119
|
+
node = consumeAstNode(buildContext);
|
|
120
|
+
break;
|
|
121
|
+
case NodeScenario.EMPTY_AST_NODE: {
|
|
122
|
+
const nodeKind = nodeKindByTokenTypeId.get(cursor.type.id);
|
|
123
|
+
if (nodeKind === undefined) {
|
|
124
|
+
throw new InternalScannerError(`No nodeKind mapping found for token type id: ${cursor.type.id} (${cursor.type.name})`);
|
|
125
|
+
}
|
|
126
|
+
// Allow specification to have no children
|
|
127
|
+
if (nodeKind == NodeKind.SPECIFICATION) {
|
|
128
|
+
return new Specification([]);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
throw new InternalScannerError(`Expected node to have at least one child: ${NodeKind[nodeKind]}`);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
default: {
|
|
135
|
+
const exhaustiveCheck = nodeScenario;
|
|
136
|
+
throw new InternalScannerError("Unreachable code reached, nodeScenario == " + exhaustiveCheck);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
// Set any leading trivia now we have the node
|
|
140
|
+
if (leadingTrivia.length > 0) {
|
|
141
|
+
node.leadingTrivia = leadingTrivia;
|
|
142
|
+
}
|
|
143
|
+
// Now that we have consumed a node, move to next sibling
|
|
144
|
+
if (cursor.nextSibling()) {
|
|
145
|
+
currentState.isEndOfSiblings = false;
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
currentState.isEndOfSiblings = true;
|
|
149
|
+
}
|
|
150
|
+
// Get any trailing trivia for the node
|
|
151
|
+
const trailingTrivia = consumeTrivia(buildContext, true);
|
|
152
|
+
if (trailingTrivia.length > 0) {
|
|
153
|
+
node.trailingTrivia = trailingTrivia;
|
|
154
|
+
}
|
|
155
|
+
logger.debug(currentState.indent +
|
|
156
|
+
"current node: " +
|
|
157
|
+
cursor.name +
|
|
158
|
+
(currentState.isEndOfSiblings ? ": end of siblings" : ""));
|
|
159
|
+
return node;
|
|
160
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consume-ast-node.d.ts","sourceRoot":"","sources":["../../../../../src/ast/build/consume/consume-ast-node.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAgDhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAoL7D,wBAAgB,cAAc,CAAC,YAAY,EAAE,YAAY,GAAG,YAAY,CA8IvE"}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import getLogger from "../../../util/logger.js";
|
|
2
|
+
import { buildAggregateOutputValue } from "../node/build-aggregate-output-value.js";
|
|
3
|
+
import { buildAlignedModifier } from "../node/build-aligned-modifier.js";
|
|
4
|
+
import { buildArrayDefinition } from "../node/build-array-definition.js";
|
|
5
|
+
import { buildArrayElementAccess } from "../node/build-array-element-access.js";
|
|
6
|
+
import { buildBase64StringLiteral } from "../node/build-base64-string-literal.js";
|
|
7
|
+
import { buildBinaryExpression } from "../node/build-binary-expression.js";
|
|
8
|
+
import { buildBitModifier } from "../node/build-bit-modifier.js";
|
|
9
|
+
import { buildCaseClause } from "../node/build-case-clause.js";
|
|
10
|
+
import { buildClassDeclaration } from "../node/build-class-declaration.js";
|
|
11
|
+
import { buildClassDefinition } from "../node/build-class-definition.js";
|
|
12
|
+
import { buildClassIdRange } from "../node/build-class-id-range.js";
|
|
13
|
+
import { buildClassId } from "../node/build-class-id.js";
|
|
14
|
+
import { buildClassMemberAccess } from "../node/build-class-member-access.js";
|
|
15
|
+
import { buildCompoundStatement } from "../node/build-compound-statement.js";
|
|
16
|
+
import { buildComputedArrayDefinition } from "../node/build-computed-array-definition.js";
|
|
17
|
+
import { buildComputedElementaryTypeDefinition } from "../node/build-computed-elementary-type-definition.js";
|
|
18
|
+
import { buildDefaultClause } from "../node/build-default-clause.js";
|
|
19
|
+
import { buildDoStatement } from "../node/build-do-statement.js";
|
|
20
|
+
import { buildElementaryTypeDefinition } from "../node/build-elementary-type-definition.js";
|
|
21
|
+
import { buildElementaryTypeOutputValue } from "../node/build-elementary-type-output-value.js";
|
|
22
|
+
import { buildElementaryType } from "../node/build-elementary-type.js";
|
|
23
|
+
import { buildExpandableModifier } from "../node/build-expandable-modifier.js";
|
|
24
|
+
import { buildExplicitArrayDimension } from "../node/build-explicit-array-dimension.js";
|
|
25
|
+
import { buildExpressionStatement } from "../node/build-expression-statement.js";
|
|
26
|
+
import { buildExtendedClassIdRange } from "../node/build-extended-class-id-range.js";
|
|
27
|
+
import { buildExtendsModifier } from "../node/build-extends-modifier.js";
|
|
28
|
+
import { buildForStatement } from "../node/build-for-statement.js";
|
|
29
|
+
import { buildIfStatement } from "../node/build-if-statement.js";
|
|
30
|
+
import { buildImplicitArrayDimension } from "../node/build-implicit-array-dimension.js";
|
|
31
|
+
import { buildLengthAttribute } from "../node/build-length-attribute.js";
|
|
32
|
+
import { buildLengthofExpression } from "../node/build-lengthof-expression.js";
|
|
33
|
+
import { buildMapDeclaration } from "../node/build-map-declaration.js";
|
|
34
|
+
import { buildMapEntry } from "../node/build-map-entry.js";
|
|
35
|
+
import { buildMultipleCharacterLiteral } from "../node/build-multiple-character-literal.js";
|
|
36
|
+
import { buildParameterList } from "../node/build-parameter-list.js";
|
|
37
|
+
import { buildParameterValueList } from "../node/build-parameter-value-list.js";
|
|
38
|
+
import { buildParameter } from "../node/build-parameter.js";
|
|
39
|
+
import { buildPartialArrayDimension } from "../node/build-partial-array-dimension.js";
|
|
40
|
+
import { buildSpecification } from "../node/build-specification.js";
|
|
41
|
+
import { buildStringDefinition } from "../node/build-string-definition.js";
|
|
42
|
+
import { buildSwitchStatement } from "../node/build-switch-statement.js";
|
|
43
|
+
import { buildUnaryExpression } from "../node/build-unary-expression.js";
|
|
44
|
+
import { buildUtfStringLiteral } from "../node/build-utf-string-literal.js";
|
|
45
|
+
import { buildWhileStatement } from "../node/build-while-statement.js";
|
|
46
|
+
import { InternalScannerError } from "../../../scanner-error.js";
|
|
47
|
+
import { NodeKind } from "../../node/enum/node-kind.js";
|
|
48
|
+
import { buildUnexpectedError } from "../node/build-unexpected-error.js";
|
|
49
|
+
import { nodeKindByTokenTypeId } from "../util/node-kind-by-token-type-id-map.js";
|
|
50
|
+
import { ArrayDimensionKind } from "../../node/enum/array-dimension-kind.js";
|
|
51
|
+
import { arrayDimensionKindByTokenTypeId } from "../util/array-dimension-kind-by-token-type-id-map.js";
|
|
52
|
+
import { stringLiteralKindByTokenTypeId } from "../util/string-literal-kind-by-token-type-id-map.js";
|
|
53
|
+
import { statementKindByTokenTypeId } from "../util/statement-kind-by-token-type-id-map.js";
|
|
54
|
+
import { expressionKindByTokenTypeId } from "../util/expression-kind-by-token-type-id-map.js";
|
|
55
|
+
import { classIdKindByTokenTypeId } from "../util/class-id-kind-by-token-type-id-map.js";
|
|
56
|
+
import { ClassIdKind } from "../../node/enum/class-id-kind.js";
|
|
57
|
+
import { ExpressionKind } from "../../node/enum/expression-kind.js";
|
|
58
|
+
import { StatementKind } from "../../node/enum/statement-kind.js";
|
|
59
|
+
import { buildMapDefinition } from "../node/build-map-definition.js";
|
|
60
|
+
import { StringLiteralKind } from "../../node/enum/string-literal-kind.js";
|
|
61
|
+
import { consumeWhiteSpaceAndMissingErrors } from "./consume-white-space-and-missing-errors.js";
|
|
62
|
+
const logger = getLogger("consumeAstNode");
|
|
63
|
+
function consumeArrayDimension(buildContext, parentTypeId, parentTypeName) {
|
|
64
|
+
const arrayDimensionKind = arrayDimensionKindByTokenTypeId.get(parentTypeId);
|
|
65
|
+
if (arrayDimensionKind === undefined) {
|
|
66
|
+
throw new InternalScannerError(`No arrayDimensionKind mapping found for token type id: ${parentTypeId} (${parentTypeName})`);
|
|
67
|
+
}
|
|
68
|
+
switch (arrayDimensionKind) {
|
|
69
|
+
case ArrayDimensionKind.EXPLICIT:
|
|
70
|
+
return buildExplicitArrayDimension(buildContext);
|
|
71
|
+
case ArrayDimensionKind.IMPLICIT:
|
|
72
|
+
return buildImplicitArrayDimension(buildContext);
|
|
73
|
+
case ArrayDimensionKind.PARTIAL:
|
|
74
|
+
return buildPartialArrayDimension(buildContext);
|
|
75
|
+
default: {
|
|
76
|
+
const exhaustiveCheck = arrayDimensionKind;
|
|
77
|
+
throw new InternalScannerError("Unreachable code reached, arrayDimensionKind == " + exhaustiveCheck);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function consumeClassId(buildContext, parentTypeId, parentTypeName) {
|
|
82
|
+
const classIdKind = classIdKindByTokenTypeId.get(parentTypeId);
|
|
83
|
+
if (classIdKind === undefined) {
|
|
84
|
+
throw new InternalScannerError(`No classIdKind mapping found for token type id: ${parentTypeId} (${parentTypeName})`);
|
|
85
|
+
}
|
|
86
|
+
switch (classIdKind) {
|
|
87
|
+
case ClassIdKind.SINGLE:
|
|
88
|
+
return buildClassId(buildContext);
|
|
89
|
+
case ClassIdKind.RANGE:
|
|
90
|
+
return buildClassIdRange(buildContext);
|
|
91
|
+
case ClassIdKind.EXTENDED_RANGE:
|
|
92
|
+
return buildExtendedClassIdRange(buildContext);
|
|
93
|
+
default: {
|
|
94
|
+
const exhaustiveCheck = classIdKind;
|
|
95
|
+
throw new InternalScannerError("Unreachable code reached, classIdKind == " + exhaustiveCheck);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function consumeExpression(buildContext, parentTypeId, parentTypeName) {
|
|
100
|
+
const expressionKind = expressionKindByTokenTypeId.get(parentTypeId);
|
|
101
|
+
if (expressionKind === undefined) {
|
|
102
|
+
throw new InternalScannerError(`No expressionKind mapping found for token type id: ${parentTypeId} (${parentTypeName})`);
|
|
103
|
+
}
|
|
104
|
+
switch (expressionKind) {
|
|
105
|
+
case ExpressionKind.BINARY:
|
|
106
|
+
return buildBinaryExpression(buildContext);
|
|
107
|
+
case ExpressionKind.UNARY:
|
|
108
|
+
return buildUnaryExpression(buildContext);
|
|
109
|
+
case ExpressionKind.LENGTHOF:
|
|
110
|
+
return buildLengthofExpression(buildContext);
|
|
111
|
+
default: {
|
|
112
|
+
const exhaustiveCheck = expressionKind;
|
|
113
|
+
throw new InternalScannerError("Unreachable code reached, expressionKind == " + exhaustiveCheck);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function consumeStatement(buildContext, parentTypeId, parentTypeName) {
|
|
118
|
+
const statementKind = statementKindByTokenTypeId.get(parentTypeId);
|
|
119
|
+
if (statementKind === undefined) {
|
|
120
|
+
throw new InternalScannerError(`No statementKind mapping found for token type id: ${parentTypeId} (${parentTypeName})`);
|
|
121
|
+
}
|
|
122
|
+
switch (statementKind) {
|
|
123
|
+
case StatementKind.ARRAY_DEFINITION:
|
|
124
|
+
return buildArrayDefinition(buildContext);
|
|
125
|
+
case StatementKind.CLASS_DECLARATION:
|
|
126
|
+
return buildClassDeclaration(buildContext);
|
|
127
|
+
case StatementKind.CLASS_DEFINITION:
|
|
128
|
+
return buildClassDefinition(buildContext);
|
|
129
|
+
case StatementKind.COMPOUND:
|
|
130
|
+
return buildCompoundStatement(buildContext);
|
|
131
|
+
case StatementKind.COMPUTED_ARRAY_DEFINITION:
|
|
132
|
+
return buildComputedArrayDefinition(buildContext);
|
|
133
|
+
case StatementKind.COMPUTED_ELEMENTARY_TYPE_DEFINITION:
|
|
134
|
+
return buildComputedElementaryTypeDefinition(buildContext);
|
|
135
|
+
case StatementKind.DO:
|
|
136
|
+
return buildDoStatement(buildContext);
|
|
137
|
+
case StatementKind.ELEMENTARY_TYPE_DEFINITION:
|
|
138
|
+
return buildElementaryTypeDefinition(buildContext);
|
|
139
|
+
case StatementKind.EXPRESSION:
|
|
140
|
+
return buildExpressionStatement(buildContext);
|
|
141
|
+
case StatementKind.FOR:
|
|
142
|
+
return buildForStatement(buildContext);
|
|
143
|
+
case StatementKind.IF:
|
|
144
|
+
return buildIfStatement(buildContext);
|
|
145
|
+
case StatementKind.MAP_DECLARATION:
|
|
146
|
+
return buildMapDeclaration(buildContext);
|
|
147
|
+
case StatementKind.MAP_DEFINITION:
|
|
148
|
+
return buildMapDefinition(buildContext);
|
|
149
|
+
case StatementKind.STRING_DEFINITION:
|
|
150
|
+
return buildStringDefinition(buildContext);
|
|
151
|
+
case StatementKind.SWITCH:
|
|
152
|
+
return buildSwitchStatement(buildContext);
|
|
153
|
+
case StatementKind.WHILE:
|
|
154
|
+
return buildWhileStatement(buildContext);
|
|
155
|
+
default: {
|
|
156
|
+
const exhaustiveCheck = statementKind;
|
|
157
|
+
throw new InternalScannerError("Unreachable code reached, statementKind == " + exhaustiveCheck);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
function consumeStringLiteral(buildContext, parentTypeId, parentTypeName) {
|
|
162
|
+
const stringLiteralKind = stringLiteralKindByTokenTypeId.get(parentTypeId);
|
|
163
|
+
if (stringLiteralKind === undefined) {
|
|
164
|
+
throw new InternalScannerError(`No stringLiteralKind mapping found for token type id: ${parentTypeId} (${parentTypeName})`);
|
|
165
|
+
}
|
|
166
|
+
switch (stringLiteralKind) {
|
|
167
|
+
case StringLiteralKind.BASIC:
|
|
168
|
+
return buildBase64StringLiteral(buildContext);
|
|
169
|
+
case StringLiteralKind.UTF:
|
|
170
|
+
return buildUtfStringLiteral(buildContext);
|
|
171
|
+
default: {
|
|
172
|
+
const exhaustiveCheck = stringLiteralKind;
|
|
173
|
+
throw new InternalScannerError("Unreachable code reached, stringLiteralKind == " + exhaustiveCheck);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
export function consumeAstNode(buildContext) {
|
|
178
|
+
const { cursor } = buildContext;
|
|
179
|
+
const currentState = buildContext.stateStack[buildContext.stateStack.length - 1];
|
|
180
|
+
const parentTypeId = cursor.type.id;
|
|
181
|
+
const parentTypeName = cursor.type.name;
|
|
182
|
+
let nodeKind;
|
|
183
|
+
if (cursor.type.isError) {
|
|
184
|
+
nodeKind = NodeKind.UNEXPECTED_ERROR;
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
nodeKind = nodeKindByTokenTypeId.get(parentTypeId);
|
|
188
|
+
}
|
|
189
|
+
if (nodeKind === undefined) {
|
|
190
|
+
throw new InternalScannerError(`No nodeKind mapping found for token type id: ${parentTypeId} (${parentTypeName})`);
|
|
191
|
+
}
|
|
192
|
+
logger.debug(currentState.indent + "consuming AST node: " + NodeKind[nodeKind] + "...");
|
|
193
|
+
const childStack = {
|
|
194
|
+
isEndOfSiblings: false,
|
|
195
|
+
indent: currentState.indent + " ",
|
|
196
|
+
};
|
|
197
|
+
buildContext.stateStack.push(childStack);
|
|
198
|
+
if (!cursor.firstChild()) {
|
|
199
|
+
throw new InternalScannerError(`Expected AST node to have children: ${NodeKind[nodeKind]}`);
|
|
200
|
+
}
|
|
201
|
+
let node;
|
|
202
|
+
switch (nodeKind) {
|
|
203
|
+
case NodeKind.ARRAY_DIMENSION:
|
|
204
|
+
node = consumeArrayDimension(buildContext, parentTypeId, parentTypeName);
|
|
205
|
+
break;
|
|
206
|
+
case NodeKind.CLASS_ID:
|
|
207
|
+
node = consumeClassId(buildContext, parentTypeId, parentTypeName);
|
|
208
|
+
break;
|
|
209
|
+
case NodeKind.EXPRESSION:
|
|
210
|
+
node = consumeExpression(buildContext, parentTypeId, parentTypeName);
|
|
211
|
+
break;
|
|
212
|
+
case NodeKind.STATEMENT:
|
|
213
|
+
node = consumeStatement(buildContext, parentTypeId, parentTypeName);
|
|
214
|
+
break;
|
|
215
|
+
case NodeKind.STRING_LITERAL:
|
|
216
|
+
node = consumeStringLiteral(buildContext, parentTypeId, parentTypeName);
|
|
217
|
+
break;
|
|
218
|
+
case NodeKind.AGGREGATE_OUTPUT_VALUE:
|
|
219
|
+
node = buildAggregateOutputValue(buildContext);
|
|
220
|
+
break;
|
|
221
|
+
case NodeKind.ALIGNED_MODIFIER:
|
|
222
|
+
node = buildAlignedModifier(buildContext);
|
|
223
|
+
break;
|
|
224
|
+
case NodeKind.ARRAY_ELEMENT_ACCESS:
|
|
225
|
+
node = buildArrayElementAccess(buildContext);
|
|
226
|
+
break;
|
|
227
|
+
case NodeKind.BIT_MODIFIER:
|
|
228
|
+
node = buildBitModifier(buildContext);
|
|
229
|
+
break;
|
|
230
|
+
case NodeKind.CASE_CLAUSE:
|
|
231
|
+
node = buildCaseClause(buildContext);
|
|
232
|
+
break;
|
|
233
|
+
case NodeKind.CLASS_MEMBER_ACCESS:
|
|
234
|
+
node = buildClassMemberAccess(buildContext);
|
|
235
|
+
break;
|
|
236
|
+
case NodeKind.DEFAULT_CLAUSE:
|
|
237
|
+
node = buildDefaultClause(buildContext);
|
|
238
|
+
break;
|
|
239
|
+
case NodeKind.ELEMENTARY_TYPE:
|
|
240
|
+
node = buildElementaryType(buildContext);
|
|
241
|
+
break;
|
|
242
|
+
case NodeKind.ELEMENTARY_TYPE_OUTPUT_VALUE:
|
|
243
|
+
node = buildElementaryTypeOutputValue(buildContext);
|
|
244
|
+
break;
|
|
245
|
+
case NodeKind.EXPANDABLE_MODIFIER:
|
|
246
|
+
node = buildExpandableModifier(buildContext);
|
|
247
|
+
break;
|
|
248
|
+
case NodeKind.EXTENDS_MODIFIER:
|
|
249
|
+
node = buildExtendsModifier(buildContext);
|
|
250
|
+
break;
|
|
251
|
+
case NodeKind.LENGTH_ATTRIBUTE:
|
|
252
|
+
node = buildLengthAttribute(buildContext);
|
|
253
|
+
break;
|
|
254
|
+
case NodeKind.MAP_ENTRY:
|
|
255
|
+
node = buildMapEntry(buildContext);
|
|
256
|
+
break;
|
|
257
|
+
case NodeKind.NUMBER_LITERAL:
|
|
258
|
+
node = buildMultipleCharacterLiteral(buildContext);
|
|
259
|
+
break;
|
|
260
|
+
case NodeKind.PARAMETER:
|
|
261
|
+
node = buildParameter(buildContext);
|
|
262
|
+
break;
|
|
263
|
+
case NodeKind.PARAMETER_LIST:
|
|
264
|
+
node = buildParameterList(buildContext);
|
|
265
|
+
break;
|
|
266
|
+
case NodeKind.PARAMETER_VALUE_LIST:
|
|
267
|
+
node = buildParameterValueList(buildContext);
|
|
268
|
+
break;
|
|
269
|
+
case NodeKind.SPECIFICATION:
|
|
270
|
+
node = buildSpecification(buildContext);
|
|
271
|
+
break;
|
|
272
|
+
case NodeKind.UNEXPECTED_ERROR:
|
|
273
|
+
node = buildUnexpectedError(buildContext);
|
|
274
|
+
break;
|
|
275
|
+
// These are node types that should be handled by other consumers
|
|
276
|
+
case NodeKind.IDENTIFIER:
|
|
277
|
+
case NodeKind.TOKEN:
|
|
278
|
+
throw new InternalScannerError(`consumeAstNode cannot consume node of kind: ${NodeKind[nodeKind]}`);
|
|
279
|
+
default: {
|
|
280
|
+
const exhaustiveCheck = nodeKind;
|
|
281
|
+
throw new InternalScannerError("Unreachable code reached, nodeKind == " + exhaustiveCheck);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
if (!childStack.isEndOfSiblings) {
|
|
285
|
+
// skip any whitespace or missing error nodes as these are inserted by parser when recovering
|
|
286
|
+
consumeWhiteSpaceAndMissingErrors(buildContext);
|
|
287
|
+
if (!childStack.isEndOfSiblings) {
|
|
288
|
+
throw new InternalScannerError(`Expected to have consumed all child nodes of ${NodeKind[nodeKind]}, but some remain.`);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
buildContext.stateStack.pop();
|
|
292
|
+
if (!cursor.parent()) {
|
|
293
|
+
throw new InternalScannerError(`Expected to move cursor back to parent of ${NodeKind[nodeKind]}, but failed.`);
|
|
294
|
+
}
|
|
295
|
+
logger.debug(currentState.indent + "...consumed node: " + NodeKind[nodeKind]);
|
|
296
|
+
return node;
|
|
297
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consume-primitive.d.ts","sourceRoot":"","sources":["../../../../../src/ast/build/consume/consume-primitive.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAU7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAQhE,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,YAAY,GAAG,YAAY,CAsCzE"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import getLogger from "../../../util/logger.js";
|
|
2
|
+
import { buildToken } from "../node/build-token.js";
|
|
3
|
+
import { NodeKind } from "../../node/enum/node-kind.js";
|
|
4
|
+
import { buildBinaryLiteral } from "../node/build-binary-literal.js";
|
|
5
|
+
import { buildDecimalLiteral } from "../node/build-decimal-literal.js";
|
|
6
|
+
import { buildFloatingPointLiteral } from "../node/build-floating-point-literal.js";
|
|
7
|
+
import { buildHexadecimalLiteral } from "../node/build-hexadecimal-literal.js";
|
|
8
|
+
import { buildIdentifier } from "../node/build-identifier.js";
|
|
9
|
+
import { buildIntegerLiteral } from "../node/build-integer-literal.js";
|
|
10
|
+
import { InternalScannerError } from "../../../scanner-error.js";
|
|
11
|
+
// Generated by Lezer from the SDL grammar
|
|
12
|
+
import * as TokenTypeId from "../../../lezer/parser.terms.js";
|
|
13
|
+
const logger = getLogger("consumePrimitive");
|
|
14
|
+
export function consumePrimitive(buildContext) {
|
|
15
|
+
const { cursor } = buildContext;
|
|
16
|
+
const currentState = buildContext.stateStack[buildContext.stateStack.length - 1];
|
|
17
|
+
const token = buildToken(buildContext);
|
|
18
|
+
let node;
|
|
19
|
+
switch (cursor.type.id) {
|
|
20
|
+
case TokenTypeId.Identifier:
|
|
21
|
+
node = buildIdentifier(token);
|
|
22
|
+
break;
|
|
23
|
+
case TokenTypeId.HexadecimalLiteral:
|
|
24
|
+
node = buildHexadecimalLiteral(token);
|
|
25
|
+
break;
|
|
26
|
+
case TokenTypeId.IntegerLiteral:
|
|
27
|
+
node = buildIntegerLiteral(token);
|
|
28
|
+
break;
|
|
29
|
+
case TokenTypeId.BinaryLiteral:
|
|
30
|
+
node = buildBinaryLiteral(token);
|
|
31
|
+
break;
|
|
32
|
+
case TokenTypeId.DecimalLiteral:
|
|
33
|
+
node = buildDecimalLiteral(token);
|
|
34
|
+
break;
|
|
35
|
+
case TokenTypeId.FloatingPointLiteral:
|
|
36
|
+
node = buildFloatingPointLiteral(token);
|
|
37
|
+
break;
|
|
38
|
+
default:
|
|
39
|
+
throw new InternalScannerError(`Unsupported primitive type: ${cursor.type.name}`);
|
|
40
|
+
}
|
|
41
|
+
logger.debug(currentState.indent +
|
|
42
|
+
"consumed primitive node: " +
|
|
43
|
+
NodeKind[node.nodeKind] +
|
|
44
|
+
" " +
|
|
45
|
+
token.text.replaceAll("\n", "\\n"));
|
|
46
|
+
return node;
|
|
47
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Trivia } from "../../node/trivia.ts";
|
|
2
|
+
import type { BuildContext } from "../util/build-context.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Iterate through the syntax tree and convert comments or whitespace to Trivia
|
|
5
|
+
* until a non-comment or non-whitespace parse node is found.
|
|
6
|
+
*/
|
|
7
|
+
export declare function consumeTrivia(buildContext: BuildContext, isTrailing: boolean): Trivia[];
|
|
8
|
+
//# sourceMappingURL=consume-trivia.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consume-trivia.d.ts","sourceRoot":"","sources":["../../../../../src/ast/build/consume/consume-trivia.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAsB7D;;;GAGG;AACH,wBAAgB,aAAa,CAAC,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,GAAG,MAAM,EAAE,CAuDvF"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Text } from "@codemirror/state";
|
|
2
|
+
import { TreeCursor } from "@lezer/common";
|
|
3
|
+
import { getLocationFromTextPosition } from "../../../util/location-utils.js";
|
|
4
|
+
import getLogger from "../../../util/logger.js";
|
|
5
|
+
// Generated by Lezer from the SDL grammar
|
|
6
|
+
import { Comment, Whitespace } from "../../../lezer/parser.terms.js";
|
|
7
|
+
const logger = getLogger("consumeTrivia");
|
|
8
|
+
function getCommentTrivia(cursor, text) {
|
|
9
|
+
return {
|
|
10
|
+
text: text.sliceString(cursor.from, cursor.to),
|
|
11
|
+
location: getLocationFromTextPosition(text, cursor.from),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function getBlankLineTrivia(cursor, text) {
|
|
15
|
+
return {
|
|
16
|
+
text: "\n",
|
|
17
|
+
location: getLocationFromTextPosition(text, cursor.from),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Iterate through the syntax tree and convert comments or whitespace to Trivia
|
|
22
|
+
* until a non-comment or non-whitespace parse node is found.
|
|
23
|
+
*/
|
|
24
|
+
export function consumeTrivia(buildContext, isTrailing) {
|
|
25
|
+
const { cursor, text } = buildContext;
|
|
26
|
+
const currentState = buildContext.stateStack[buildContext.stateStack.length - 1];
|
|
27
|
+
if (currentState.isEndOfSiblings) {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
const trivia = [];
|
|
31
|
+
let noSibling = true;
|
|
32
|
+
do {
|
|
33
|
+
// Save comments
|
|
34
|
+
if (cursor.type.id === Comment) {
|
|
35
|
+
trivia.push(getCommentTrivia(cursor, text));
|
|
36
|
+
// If trailing, stop after first comment
|
|
37
|
+
if (isTrailing) {
|
|
38
|
+
// advance the cursor as we consumed the comment
|
|
39
|
+
noSibling = !cursor.nextSibling();
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
} // Skip whitespace except for multiple new lines which are collapsed into a single blank line trivia
|
|
43
|
+
else if (cursor.type.id === Whitespace) {
|
|
44
|
+
const whitespace = text.sliceString(cursor.from, cursor.to);
|
|
45
|
+
const newLineCount = (whitespace.match(/\n/g) || []).length;
|
|
46
|
+
// If trailing, stop at first line break
|
|
47
|
+
if (isTrailing && newLineCount > 0) {
|
|
48
|
+
noSibling = false;
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
if (newLineCount > 1) {
|
|
52
|
+
trivia.push(getBlankLineTrivia(cursor, text));
|
|
53
|
+
}
|
|
54
|
+
} // Otherwise stop at the first non-comment, non-whitespace node
|
|
55
|
+
else if (cursor.type.id !== Comment && cursor.type.id !== Whitespace) {
|
|
56
|
+
noSibling = false;
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
} while (cursor.nextSibling());
|
|
60
|
+
currentState.isEndOfSiblings = noSibling;
|
|
61
|
+
if (trivia.length > 0) {
|
|
62
|
+
logger.debug(currentState.indent +
|
|
63
|
+
`consumed ${isTrailing ? "trailing" : "leading"} trivia: ` +
|
|
64
|
+
trivia.map((triviaEntry) => triviaEntry.text.replaceAll("\n", "\\n")).join(", "));
|
|
65
|
+
}
|
|
66
|
+
return trivia;
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consume-white-space-and-missing-errors.d.ts","sourceRoot":"","sources":["../../../../../src/ast/build/consume/consume-white-space-and-missing-errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAK7D,wBAAgB,iCAAiC,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAkBlF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Generated by Lezer from the SDL grammar
|
|
2
|
+
import { Whitespace } from "../../../lezer/parser.terms.js";
|
|
3
|
+
export function consumeWhiteSpaceAndMissingErrors(buildContext) {
|
|
4
|
+
const { cursor } = buildContext;
|
|
5
|
+
const currentState = buildContext.stateStack[buildContext.stateStack.length - 1];
|
|
6
|
+
if (currentState.isEndOfSiblings) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
let noSibling = true;
|
|
10
|
+
do {
|
|
11
|
+
if (cursor.type.id !== Whitespace && !cursor.type.isError) {
|
|
12
|
+
noSibling = false;
|
|
13
|
+
break;
|
|
14
|
+
}
|
|
15
|
+
} while (cursor.nextSibling());
|
|
16
|
+
currentState.isEndOfSiblings = noSibling;
|
|
17
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AggregateOutputValue } from "../../node/aggregate-output-value.ts";
|
|
2
|
+
import type { BuildContext } from "../util/build-context.ts";
|
|
3
|
+
export declare function buildAggregateOutputValue(buildContext: BuildContext): AggregateOutputValue;
|
|
4
|
+
//# sourceMappingURL=build-aggregate-output-value.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-aggregate-output-value.d.ts","sourceRoot":"","sources":["../../../../../src/ast/build/node/build-aggregate-output-value.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAG5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAM7D,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,YAAY,GAAG,oBAAoB,CAwC1F"}
|