@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
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { type Doc, doc } from "prettier";
|
|
2
2
|
import type { Trivia } from "../../ast/node/trivia.ts";
|
|
3
3
|
import type { AbstractNode } from "../../ast/node/abstract-node.ts";
|
|
4
|
-
import {
|
|
5
|
-
isBreakParent,
|
|
6
|
-
isFill,
|
|
7
|
-
isHardline,
|
|
8
|
-
isIndent,
|
|
9
|
-
isLabel,
|
|
10
|
-
} from "./types.ts";
|
|
4
|
+
import { isBreakParent, isFill, isHardline, isIndent, isLabel } from "./types.ts";
|
|
11
5
|
import { InternalScannerError } from "../../scanner-error.ts";
|
|
12
6
|
|
|
13
7
|
const { hardline, ifBreak, label, line, indent } = doc.builders;
|
|
@@ -15,8 +9,7 @@ const { hardline, ifBreak, label, line, indent } = doc.builders;
|
|
|
15
9
|
function getCommentString(trivia: Trivia): string {
|
|
16
10
|
if (!trivia.text.startsWith("//")) {
|
|
17
11
|
throw new InternalScannerError(
|
|
18
|
-
"Logic Error: Expected comment to start with // : " +
|
|
19
|
-
JSON.stringify(trivia),
|
|
12
|
+
"Logic Error: Expected comment to start with // : " + JSON.stringify(trivia),
|
|
20
13
|
);
|
|
21
14
|
}
|
|
22
15
|
// Remove leading "//" from the comment text
|
|
@@ -44,7 +37,7 @@ function addTrivia(doc: Doc, trivia: Trivia): Doc[] {
|
|
|
44
37
|
* Gets the leading trivia doc for the given node if it has any leading trivia.
|
|
45
38
|
*/
|
|
46
39
|
export function getLeadingTriviaDoc(node: AbstractNode): Doc | undefined {
|
|
47
|
-
if (!node || !node.leadingTrivia ||
|
|
40
|
+
if (!node || !node.leadingTrivia || node.leadingTrivia.length === 0) {
|
|
48
41
|
return undefined;
|
|
49
42
|
}
|
|
50
43
|
|
|
@@ -62,7 +55,7 @@ export function getLeadingTriviaDoc(node: AbstractNode): Doc | undefined {
|
|
|
62
55
|
* Gets the trailing trivia doc for the given node if it has any trailing trivia.
|
|
63
56
|
*/
|
|
64
57
|
export function getTrailingTriviaDoc(node: AbstractNode): Doc | undefined {
|
|
65
|
-
if (!node || !node.trailingTrivia ||
|
|
58
|
+
if (!node || !node.trailingTrivia || node.trailingTrivia.length === 0) {
|
|
66
59
|
return undefined;
|
|
67
60
|
}
|
|
68
61
|
|
|
@@ -79,22 +72,17 @@ export function getTrailingTriviaDoc(node: AbstractNode): Doc | undefined {
|
|
|
79
72
|
/**
|
|
80
73
|
* Adds the trailing trivia doc to the given doc.
|
|
81
74
|
*/
|
|
82
|
-
export function addTrailingTriviaDoc(
|
|
83
|
-
doc: Doc,
|
|
84
|
-
trailingTriviaDoc: Doc,
|
|
85
|
-
): Doc {
|
|
75
|
+
export function addTrailingTriviaDoc(doc: Doc, trailingTriviaDoc: Doc): Doc {
|
|
86
76
|
if (Array.isArray(doc)) {
|
|
87
77
|
if (doc.length === 0) {
|
|
88
|
-
doc = [
|
|
89
|
-
trailingTriviaDoc,
|
|
90
|
-
];
|
|
78
|
+
doc = [trailingTriviaDoc];
|
|
91
79
|
|
|
92
80
|
return doc;
|
|
93
81
|
}
|
|
94
82
|
|
|
95
83
|
// find last element which is not a break-parent and not a hardline
|
|
96
84
|
let i = doc.length - 1;
|
|
97
|
-
while (
|
|
85
|
+
while (i >= 0 && (isBreakParent(doc[i]) || isHardline(doc[i]))) {
|
|
98
86
|
i--;
|
|
99
87
|
}
|
|
100
88
|
|
|
@@ -104,19 +92,13 @@ export function addTrailingTriviaDoc(
|
|
|
104
92
|
const lastNonBreakParentElement = doc[i];
|
|
105
93
|
|
|
106
94
|
if (Array.isArray(lastNonBreakParentElement)) {
|
|
107
|
-
doc[i] = addTrailingTriviaDoc(
|
|
108
|
-
lastNonBreakParentElement,
|
|
109
|
-
trailingTriviaDoc,
|
|
110
|
-
);
|
|
95
|
+
doc[i] = addTrailingTriviaDoc(lastNonBreakParentElement, trailingTriviaDoc);
|
|
111
96
|
|
|
112
97
|
return doc;
|
|
113
98
|
}
|
|
114
99
|
|
|
115
100
|
// element might be an indent or label
|
|
116
|
-
if (
|
|
117
|
-
isIndent(lastNonBreakParentElement) ||
|
|
118
|
-
isLabel(lastNonBreakParentElement)
|
|
119
|
-
) {
|
|
101
|
+
if (isIndent(lastNonBreakParentElement) || isLabel(lastNonBreakParentElement)) {
|
|
120
102
|
lastNonBreakParentElement.contents = addTrailingTriviaDoc(
|
|
121
103
|
lastNonBreakParentElement.contents,
|
|
122
104
|
trailingTriviaDoc,
|
|
@@ -130,17 +112,9 @@ export function addTrailingTriviaDoc(
|
|
|
130
112
|
} // otherwise we found the last element to add trivia after
|
|
131
113
|
// behavior is different if the token is a close brace
|
|
132
114
|
else if (lastNonBreakParentElement === "}") {
|
|
133
|
-
doc[i] = [
|
|
134
|
-
lastNonBreakParentElement,
|
|
135
|
-
ifBreak([line, ""], " "),
|
|
136
|
-
trailingTriviaDoc,
|
|
137
|
-
];
|
|
115
|
+
doc[i] = [lastNonBreakParentElement, ifBreak([line, ""], " "), trailingTriviaDoc];
|
|
138
116
|
} else {
|
|
139
|
-
doc[i] = [
|
|
140
|
-
lastNonBreakParentElement,
|
|
141
|
-
ifBreak([line, " "], " "),
|
|
142
|
-
trailingTriviaDoc,
|
|
143
|
-
];
|
|
117
|
+
doc[i] = [lastNonBreakParentElement, ifBreak([line, " "], " "), trailingTriviaDoc];
|
|
144
118
|
}
|
|
145
119
|
|
|
146
120
|
return doc;
|
|
@@ -172,7 +146,7 @@ export function endsWithHardline(doc: Doc): boolean {
|
|
|
172
146
|
|
|
173
147
|
// find last element which is not a break-parent as we ignore trailing break-parents
|
|
174
148
|
let i = doc.length - 1;
|
|
175
|
-
while (
|
|
149
|
+
while (i >= 0 && isBreakParent(doc[i])) {
|
|
176
150
|
i--;
|
|
177
151
|
}
|
|
178
152
|
|
|
@@ -209,7 +183,7 @@ export function startsWithBlankLine(doc: Doc): boolean {
|
|
|
209
183
|
|
|
210
184
|
// check if the array starts with ["", hardline, ...]
|
|
211
185
|
if (doc.length >= 2) {
|
|
212
|
-
if (
|
|
186
|
+
if (doc[0] === "" && isHardline(doc[1])) {
|
|
213
187
|
return true;
|
|
214
188
|
}
|
|
215
189
|
}
|
|
@@ -238,7 +212,7 @@ function removeLeadingBlankline(doc: Doc): Doc {
|
|
|
238
212
|
|
|
239
213
|
// check if the array starts with ["", hardline, ...]
|
|
240
214
|
if (doc.length >= 2) {
|
|
241
|
-
if (
|
|
215
|
+
if (doc[0] === "" && isHardline(doc[1])) {
|
|
242
216
|
// remove the first two elements
|
|
243
217
|
doc.splice(0, 2);
|
|
244
218
|
|
|
@@ -255,7 +229,7 @@ function removeLeadingBlankline(doc: Doc): Doc {
|
|
|
255
229
|
const firstItem = removeLeadingBlankline(doc[0]);
|
|
256
230
|
|
|
257
231
|
// don't leave an empty array at the start
|
|
258
|
-
if (Array.isArray(firstItem) &&
|
|
232
|
+
if (Array.isArray(firstItem) && firstItem.length === 0) {
|
|
259
233
|
doc.splice(0, 1);
|
|
260
234
|
} else {
|
|
261
235
|
doc[0] = firstItem;
|
|
@@ -273,10 +247,7 @@ function removeLeadingBlankline(doc: Doc): Doc {
|
|
|
273
247
|
if (isIndent(doc) || isLabel(doc)) {
|
|
274
248
|
doc.contents = removeLeadingBlankline(doc.contents);
|
|
275
249
|
|
|
276
|
-
if (
|
|
277
|
-
(doc.contents === "") ||
|
|
278
|
-
(Array.isArray(doc.contents) && (doc.contents.length === 0))
|
|
279
|
-
) {
|
|
250
|
+
if (doc.contents === "" || (Array.isArray(doc.contents) && doc.contents.length === 0)) {
|
|
280
251
|
doc = "";
|
|
281
252
|
}
|
|
282
253
|
} else if (isFill(doc)) {
|
|
@@ -312,7 +283,7 @@ export function removeTrailingBlankline(doc: Doc): Doc {
|
|
|
312
283
|
|
|
313
284
|
// check if the array ends with [..., "", hardline]
|
|
314
285
|
if (doc.length >= 2) {
|
|
315
|
-
if (
|
|
286
|
+
if (doc[doc.length - 2] === "" && isHardline(doc[doc.length - 1])) {
|
|
316
287
|
// remove the last two elements
|
|
317
288
|
doc.splice(doc.length - 2, 2);
|
|
318
289
|
|
|
@@ -331,7 +302,7 @@ export function removeTrailingBlankline(doc: Doc): Doc {
|
|
|
331
302
|
lastItem = removeTrailingBlankline(lastItem);
|
|
332
303
|
|
|
333
304
|
// don't leave an empty array at the end
|
|
334
|
-
if (Array.isArray(lastItem) &&
|
|
305
|
+
if (Array.isArray(lastItem) && lastItem.length === 0) {
|
|
335
306
|
doc.splice(doc.length - 1, 1);
|
|
336
307
|
} else {
|
|
337
308
|
doc[doc.length - 1] = lastItem;
|
|
@@ -349,10 +320,7 @@ export function removeTrailingBlankline(doc: Doc): Doc {
|
|
|
349
320
|
if (isIndent(doc) || isLabel(doc)) {
|
|
350
321
|
doc.contents = removeTrailingBlankline(doc.contents);
|
|
351
322
|
|
|
352
|
-
if (
|
|
353
|
-
(doc.contents === "") ||
|
|
354
|
-
(Array.isArray(doc.contents) && (doc.contents.length === 0))
|
|
355
|
-
) {
|
|
323
|
+
if (doc.contents === "" || (Array.isArray(doc.contents) && doc.contents.length === 0)) {
|
|
356
324
|
doc = "";
|
|
357
325
|
}
|
|
358
326
|
} else if (isFill(doc)) {
|
|
@@ -409,10 +377,7 @@ export function removeTrailingHardline(doc: Doc): Doc {
|
|
|
409
377
|
if (isIndent(doc) || isLabel(doc)) {
|
|
410
378
|
doc.contents = removeTrailingHardline(doc.contents);
|
|
411
379
|
|
|
412
|
-
if (
|
|
413
|
-
(doc.contents === "") ||
|
|
414
|
-
(Array.isArray(doc.contents) && (doc.contents.length === 0))
|
|
415
|
-
) {
|
|
380
|
+
if (doc.contents === "" || (Array.isArray(doc.contents) && doc.contents.length === 0)) {
|
|
416
381
|
doc = "";
|
|
417
382
|
}
|
|
418
383
|
} else if (isFill(doc)) {
|
|
@@ -487,7 +452,7 @@ export function addIndentedStatements(
|
|
|
487
452
|
}
|
|
488
453
|
|
|
489
454
|
indentedDoc.push(statementDoc);
|
|
490
|
-
if (
|
|
455
|
+
if (i < statementDocs.length - 1 && !endsWithHardline(indentedDoc)) {
|
|
491
456
|
indentedDoc.push(hardline);
|
|
492
457
|
}
|
|
493
458
|
}
|
|
@@ -496,7 +461,7 @@ export function addIndentedStatements(
|
|
|
496
461
|
// look for leading trivia element and remove it from closeBracePunctuatorDoc array
|
|
497
462
|
let firstElement = closeBracePunctuatorDoc[0];
|
|
498
463
|
|
|
499
|
-
if (isLabel(firstElement) &&
|
|
464
|
+
if (isLabel(firstElement) && firstElement.label === "leadingTrivia") {
|
|
500
465
|
// remove leading trivia from closeBracePunctuatorDoc to inside indented block
|
|
501
466
|
closeBracePunctuatorDoc.splice(0, 1);
|
|
502
467
|
|
|
@@ -568,10 +533,7 @@ export function addNonBreakingWhitespace(doc: Doc): Doc[] {
|
|
|
568
533
|
/**
|
|
569
534
|
* Interleaves the given value docs with the given comma separator docs and adds breaking whitespace after each comma separator.
|
|
570
535
|
*/
|
|
571
|
-
export function interleaveCommaSeparatorDocs(
|
|
572
|
-
valueDocs: Doc[],
|
|
573
|
-
commaSeparatorDocs: Doc[],
|
|
574
|
-
): Doc {
|
|
536
|
+
export function interleaveCommaSeparatorDocs(valueDocs: Doc[], commaSeparatorDocs: Doc[]): Doc {
|
|
575
537
|
if (commaSeparatorDocs.length === 0) {
|
|
576
538
|
if (valueDocs.length > 1) {
|
|
577
539
|
throw new InternalScannerError(
|
|
@@ -6,35 +6,28 @@ type Indent = doc.builders.Indent;
|
|
|
6
6
|
type Hardline = doc.builders.Hardline;
|
|
7
7
|
type BreakParent = doc.builders.BreakParent;
|
|
8
8
|
|
|
9
|
-
export function isIndent(
|
|
10
|
-
doc: Doc,
|
|
11
|
-
): doc is Indent {
|
|
9
|
+
export function isIndent(doc: Doc): doc is Indent {
|
|
12
10
|
return (doc as Indent).type === "indent";
|
|
13
11
|
}
|
|
14
12
|
|
|
15
|
-
export function isFill(
|
|
16
|
-
doc: Doc,
|
|
17
|
-
): doc is Fill {
|
|
13
|
+
export function isFill(doc: Doc): doc is Fill {
|
|
18
14
|
return (doc as Fill).type === "fill";
|
|
19
15
|
}
|
|
20
16
|
|
|
21
|
-
export function isLabel(
|
|
22
|
-
doc: Doc,
|
|
23
|
-
): doc is Label {
|
|
17
|
+
export function isLabel(doc: Doc): doc is Label {
|
|
24
18
|
return (doc as Label).type === "label";
|
|
25
19
|
}
|
|
26
20
|
|
|
27
|
-
export function isBreakParent(
|
|
28
|
-
doc: Doc,
|
|
29
|
-
): doc is BreakParent {
|
|
21
|
+
export function isBreakParent(doc: Doc): doc is BreakParent {
|
|
30
22
|
return (doc as BreakParent).type === "break-parent";
|
|
31
23
|
}
|
|
32
24
|
|
|
33
|
-
export function isHardline(
|
|
34
|
-
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
(
|
|
38
|
-
(
|
|
39
|
-
(
|
|
25
|
+
export function isHardline(doc: Doc): doc is Hardline {
|
|
26
|
+
return (
|
|
27
|
+
Array.isArray(doc) &&
|
|
28
|
+
doc.length === 2 &&
|
|
29
|
+
(doc as Hardline)[0].type === "line" &&
|
|
30
|
+
(doc as Hardline)[0].hard === true &&
|
|
31
|
+
(doc as Hardline)[1].type === "break-parent"
|
|
32
|
+
);
|
|
40
33
|
}
|
package/src/scanner-error.ts
CHANGED
|
@@ -44,10 +44,7 @@ export class SyntaxError extends ScannerError {
|
|
|
44
44
|
* Indicates a semantic error in the provided AST.
|
|
45
45
|
*/
|
|
46
46
|
export class SemanticError extends ScannerError {
|
|
47
|
-
constructor(
|
|
48
|
-
errorMessage: string,
|
|
49
|
-
location?: Location,
|
|
50
|
-
) {
|
|
47
|
+
constructor(errorMessage: string, location?: Location) {
|
|
51
48
|
super(`SEMANTIC ERROR: ${errorMessage}`.trim(), location);
|
|
52
49
|
}
|
|
53
50
|
}
|
|
@@ -56,10 +53,7 @@ export class SemanticError extends ScannerError {
|
|
|
56
53
|
* Indicates a semantic warning in the provided AST.
|
|
57
54
|
*/
|
|
58
55
|
export class SemanticWarning extends ScannerError {
|
|
59
|
-
constructor(
|
|
60
|
-
warningMessage: string,
|
|
61
|
-
location?: Location,
|
|
62
|
-
) {
|
|
56
|
+
constructor(warningMessage: string, location?: Location) {
|
|
63
57
|
super(`SEMANTIC WARNING: ${warningMessage}`.trim(), location);
|
|
64
58
|
}
|
|
65
59
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { Text } from "@codemirror/state";
|
|
2
2
|
import type { Location } from "../location.ts";
|
|
3
3
|
|
|
4
|
-
export function getLocationFromTextPosition(
|
|
5
|
-
text: Text,
|
|
6
|
-
position: number,
|
|
7
|
-
): Location {
|
|
4
|
+
export function getLocationFromTextPosition(text: Text, position: number): Location {
|
|
8
5
|
const line = text.lineAt(position);
|
|
9
6
|
const row = line.number;
|
|
10
7
|
const column = position - line.from + 1;
|
package/src/util/logger.ts
CHANGED
|
@@ -33,7 +33,7 @@ export const debugEnabled = (() => {
|
|
|
33
33
|
if (typeof localStorage !== "undefined") {
|
|
34
34
|
try {
|
|
35
35
|
return localStorage.getItem("MPEG_SDL_PARSER_DEBUG") !== null;
|
|
36
|
-
} catch
|
|
36
|
+
} catch {
|
|
37
37
|
// Ignore SecurityError if localStorage is disabled.
|
|
38
38
|
return false;
|
|
39
39
|
}
|
|
@@ -71,26 +71,22 @@ function wrapDefaultLogger(
|
|
|
71
71
|
return (message, ...optionalParams) => {
|
|
72
72
|
if (message instanceof Function) {
|
|
73
73
|
loggerFunction(
|
|
74
|
-
`${levelPadding} [${loggerName}]${
|
|
75
|
-
LOGGER_NAME_PADDINGS[loggerName]
|
|
76
|
-
} ${message()}`,
|
|
74
|
+
`${levelPadding} [${loggerName}]${LOGGER_NAME_PADDINGS[loggerName]} ${message()}`,
|
|
77
75
|
...optionalParams,
|
|
78
76
|
);
|
|
79
77
|
return;
|
|
80
78
|
}
|
|
81
79
|
if (message instanceof Object) {
|
|
82
80
|
loggerFunction(
|
|
83
|
-
`${levelPadding} [${loggerName}]${LOGGER_NAME_PADDINGS[loggerName]} ${
|
|
84
|
-
|
|
85
|
-
}`,
|
|
81
|
+
`${levelPadding} [${loggerName}]${LOGGER_NAME_PADDINGS[loggerName]} ${JSON.stringify(
|
|
82
|
+
message,
|
|
83
|
+
)}`,
|
|
86
84
|
...optionalParams,
|
|
87
85
|
);
|
|
88
86
|
return;
|
|
89
87
|
}
|
|
90
88
|
loggerFunction(
|
|
91
|
-
`${levelPadding} [${loggerName}]${
|
|
92
|
-
LOGGER_NAME_PADDINGS[loggerName]
|
|
93
|
-
} ${message}`,
|
|
89
|
+
`${levelPadding} [${loggerName}]${LOGGER_NAME_PADDINGS[loggerName]} ${message}`,
|
|
94
90
|
...optionalParams,
|
|
95
91
|
);
|
|
96
92
|
};
|
|
@@ -117,38 +113,16 @@ export default function getLogger(loggerName: string): Logger {
|
|
|
117
113
|
|
|
118
114
|
LOGGER_NAME_PADDINGS[loggerName] = "";
|
|
119
115
|
} else if (LOGGER_NAME_PADDINGS[loggerName] === undefined) {
|
|
120
|
-
LOGGER_NAME_PADDINGS[loggerName] = " ".repeat(
|
|
121
|
-
maxLoggerNameLength - loggerName.length,
|
|
122
|
-
);
|
|
116
|
+
LOGGER_NAME_PADDINGS[loggerName] = " ".repeat(maxLoggerNameLength - loggerName.length);
|
|
123
117
|
}
|
|
124
118
|
|
|
125
119
|
if (debugEnabled) {
|
|
126
120
|
return {
|
|
127
|
-
trace: wrapDefaultLogger(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
),
|
|
132
|
-
debug: wrapDefaultLogger(
|
|
133
|
-
loggerName,
|
|
134
|
-
LEVEL_PADDINGS.DEBUG,
|
|
135
|
-
globalThis.defaultLogger.debug,
|
|
136
|
-
),
|
|
137
|
-
info: wrapDefaultLogger(
|
|
138
|
-
loggerName,
|
|
139
|
-
LEVEL_PADDINGS.INFO,
|
|
140
|
-
globalThis.defaultLogger.info,
|
|
141
|
-
),
|
|
142
|
-
warn: wrapDefaultLogger(
|
|
143
|
-
loggerName,
|
|
144
|
-
LEVEL_PADDINGS.WARN,
|
|
145
|
-
globalThis.defaultLogger.warn,
|
|
146
|
-
),
|
|
147
|
-
error: wrapDefaultLogger(
|
|
148
|
-
loggerName,
|
|
149
|
-
LEVEL_PADDINGS.ERROR,
|
|
150
|
-
globalThis.defaultLogger.error,
|
|
151
|
-
),
|
|
121
|
+
trace: wrapDefaultLogger(loggerName, LEVEL_PADDINGS.TRACE, globalThis.defaultLogger.trace),
|
|
122
|
+
debug: wrapDefaultLogger(loggerName, LEVEL_PADDINGS.DEBUG, globalThis.defaultLogger.debug),
|
|
123
|
+
info: wrapDefaultLogger(loggerName, LEVEL_PADDINGS.INFO, globalThis.defaultLogger.info),
|
|
124
|
+
warn: wrapDefaultLogger(loggerName, LEVEL_PADDINGS.WARN, globalThis.defaultLogger.warn),
|
|
125
|
+
error: wrapDefaultLogger(loggerName, LEVEL_PADDINGS.ERROR, globalThis.defaultLogger.error),
|
|
152
126
|
};
|
|
153
127
|
}
|
|
154
128
|
return {
|
|
@@ -156,10 +130,6 @@ export default function getLogger(loggerName: string): Logger {
|
|
|
156
130
|
debug: () => {},
|
|
157
131
|
info: () => {},
|
|
158
132
|
warn: () => {},
|
|
159
|
-
error: wrapDefaultLogger(
|
|
160
|
-
loggerName,
|
|
161
|
-
LEVEL_PADDINGS.ERROR,
|
|
162
|
-
globalThis.defaultLogger.error,
|
|
163
|
-
),
|
|
133
|
+
error: wrapDefaultLogger(loggerName, LEVEL_PADDINGS.ERROR, globalThis.defaultLogger.error),
|
|
164
134
|
};
|
|
165
135
|
}
|
package/bun.lock
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"lockfileVersion": 1,
|
|
3
|
-
"configVersion": 0,
|
|
4
|
-
"workspaces": {
|
|
5
|
-
"": {
|
|
6
|
-
"name": "@mpeggroup/mpeg-sdl-parser",
|
|
7
|
-
"dependencies": {
|
|
8
|
-
"@codemirror/language": "6.12.3",
|
|
9
|
-
"@codemirror/state": "6.5.4",
|
|
10
|
-
"@lezer/common": "1.5.0",
|
|
11
|
-
"@lezer/generator": "1.8.0",
|
|
12
|
-
"@lezer/highlight": "1.2.3",
|
|
13
|
-
"@lezer/lr": "1.4.7",
|
|
14
|
-
"prettier": "3.8.3",
|
|
15
|
-
},
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@types/bun": "^1.3.13",
|
|
18
|
-
"@types/node": "^25.6.0",
|
|
19
|
-
},
|
|
20
|
-
"peerDependencies": {
|
|
21
|
-
"typescript": "6.0.3",
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
"overrides": {
|
|
26
|
-
"@codemirror/state": "6.5.4",
|
|
27
|
-
"@lezer/common": "1.5.0",
|
|
28
|
-
"@lezer/lr": "1.4.7",
|
|
29
|
-
},
|
|
30
|
-
"packages": {
|
|
31
|
-
"@codemirror/language": ["@codemirror/language@6.12.3", "", { "dependencies": { "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.23.0", "@lezer/common": "^1.5.0", "@lezer/highlight": "^1.0.0", "@lezer/lr": "^1.0.0", "style-mod": "^4.0.0" } }, "sha512-QwCZW6Tt1siP37Jet9Tb02Zs81TQt6qQrZR2H+eGMcFsL1zMrk2/b9CLC7/9ieP1fjIUMgviLWMmgiHoJrj+ZA=="],
|
|
32
|
-
|
|
33
|
-
"@codemirror/state": ["@codemirror/state@6.5.4", "", { "dependencies": { "@marijn/find-cluster-break": "^1.0.0" } }, "sha512-8y7xqG/hpB53l25CIoit9/ngxdfoG+fx+V3SHBrinnhOtLvKHRyAJJuHzkWrR4YXXLX8eXBsejgAAxHUOdW1yw=="],
|
|
34
|
-
|
|
35
|
-
"@codemirror/view": ["@codemirror/view@6.39.9", "", { "dependencies": { "@codemirror/state": "^6.5.0", "crelt": "^1.0.6", "style-mod": "^4.1.0", "w3c-keyname": "^2.2.4" } }, "sha512-miGSIfBOKC1s2oHoa80dp+BjtsL8sXsrgGlQnQuOcfvaedcQUtqddTmKbJSDkLl4mkgPvZyXuKic2HDNYcJLYA=="],
|
|
36
|
-
|
|
37
|
-
"@lezer/common": ["@lezer/common@1.5.0", "", {}, "sha512-PNGcolp9hr4PJdXR4ix7XtixDrClScvtSCYW3rQG106oVMOOI+jFb+0+J3mbeL/53g1Zd6s0kJzaw6Ri68GmAA=="],
|
|
38
|
-
|
|
39
|
-
"@lezer/generator": ["@lezer/generator@1.8.0", "", { "dependencies": { "@lezer/common": "^1.1.0", "@lezer/lr": "^1.3.0" }, "bin": { "lezer-generator": "src/lezer-generator.cjs" } }, "sha512-/SF4EDWowPqV1jOgoGSGTIFsE7Ezdr7ZYxyihl5eMKVO5tlnpIhFcDavgm1hHY5GEonoOAEnJ0CU0x+tvuAuUg=="],
|
|
40
|
-
|
|
41
|
-
"@lezer/highlight": ["@lezer/highlight@1.2.3", "", { "dependencies": { "@lezer/common": "^1.3.0" } }, "sha512-qXdH7UqTvGfdVBINrgKhDsVTJTxactNNxLk7+UMwZhU13lMHaOBlJe9Vqp907ya56Y3+ed2tlqzys7jDkTmW0g=="],
|
|
42
|
-
|
|
43
|
-
"@lezer/lr": ["@lezer/lr@1.4.7", "", { "dependencies": { "@lezer/common": "^1.0.0" } }, "sha512-wNIFWdSUfX9Jc6ePMzxSPVgTVB4EOfDIwLQLWASyiUdHKaMsiilj9bYiGkGQCKVodd0x6bgQCV207PILGFCF9Q=="],
|
|
44
|
-
|
|
45
|
-
"@marijn/find-cluster-break": ["@marijn/find-cluster-break@1.0.2", "", {}, "sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g=="],
|
|
46
|
-
|
|
47
|
-
"@types/bun": ["@types/bun@1.3.13", "", { "dependencies": { "bun-types": "1.3.13" } }, "sha512-9fqXWk5YIHGGnUau9TEi+qdlTYDAnOj+xLCmSTwXfAIqXr2x4tytJb43E9uCvt09zJURKXwAtkoH4nLQfzeTXw=="],
|
|
48
|
-
|
|
49
|
-
"@types/node": ["@types/node@25.6.0", "", { "dependencies": { "undici-types": "~7.19.0" } }, "sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ=="],
|
|
50
|
-
|
|
51
|
-
"bun-types": ["bun-types@1.3.13", "", { "dependencies": { "@types/node": "*" } }, "sha512-QXKeHLlOLqQX9LgYaHJfzdBaV21T63HhFJnvuRCcjZiaUDpbs5ED1MgxbMra71CsryN/1dAoXuJJJwIv/2drVA=="],
|
|
52
|
-
|
|
53
|
-
"crelt": ["crelt@1.0.6", "", {}, "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g=="],
|
|
54
|
-
|
|
55
|
-
"prettier": ["prettier@3.8.3", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw=="],
|
|
56
|
-
|
|
57
|
-
"style-mod": ["style-mod@4.1.3", "", {}, "sha512-i/n8VsZydrugj3Iuzll8+x/00GH2vnYsk1eomD8QiRrSAeW6ItbCQDtfXCeJHd0iwiNagqjQkvpvREEPtW3IoQ=="],
|
|
58
|
-
|
|
59
|
-
"typescript": ["typescript@6.0.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw=="],
|
|
60
|
-
|
|
61
|
-
"undici-types": ["undici-types@7.19.2", "", {}, "sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg=="],
|
|
62
|
-
|
|
63
|
-
"w3c-keyname": ["w3c-keyname@2.2.8", "", {}, "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ=="],
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import {
|
|
3
|
-
createLenientSdlAnalyser,
|
|
4
|
-
createStrictSdlAnalyser,
|
|
5
|
-
} from "../../src/analyser/create-sdl-analyser.ts";
|
|
6
|
-
import { createLenientSdlParser } from "../../src/lezer/create-sdl-parser.ts";
|
|
7
|
-
import { SdlStringInput } from "../../src/lezer/sdl-string-input.ts";
|
|
8
|
-
import { buildAst } from "../../src/ast/build-ast.ts";
|
|
9
|
-
import type { Specification } from "../../src/ast/node/specification.ts";
|
|
10
|
-
|
|
11
|
-
const lenientSdlParser = createLenientSdlParser();
|
|
12
|
-
|
|
13
|
-
function buildAstWithErrors() {
|
|
14
|
-
const sdlStringInput = new SdlStringInput(
|
|
15
|
-
"class A{bit transport_priority;}",
|
|
16
|
-
);
|
|
17
|
-
const parseTree = lenientSdlParser.parse(sdlStringInput);
|
|
18
|
-
const specification = buildAst(
|
|
19
|
-
parseTree,
|
|
20
|
-
sdlStringInput,
|
|
21
|
-
true,
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
return specification;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
describe("createSdlAnalyser Tests", () => {
|
|
28
|
-
test("Test lenient SDL analyser creation", () => {
|
|
29
|
-
createLenientSdlAnalyser();
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
test("Test strict SDL analyser creation", () => {
|
|
33
|
-
createStrictSdlAnalyser();
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
test("Test lenient SDL analyser handles syntactic errors in parse tree", () => {
|
|
37
|
-
const specificationWithErrors = buildAstWithErrors();
|
|
38
|
-
const sdlAnalyser = createLenientSdlAnalyser();
|
|
39
|
-
|
|
40
|
-
// The lenient analyser should not throw an error
|
|
41
|
-
sdlAnalyser.analyse(specificationWithErrors as Specification);
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
test("Test strict SDL analyser throws on syntactic errors in parse tree", () => {
|
|
45
|
-
const specificationWithErrors = buildAstWithErrors();
|
|
46
|
-
|
|
47
|
-
const sdlAnalyser = createStrictSdlAnalyser();
|
|
48
|
-
|
|
49
|
-
expect(() => sdlAnalyser.analyse(specificationWithErrors as Specification))
|
|
50
|
-
.toThrow(
|
|
51
|
-
"SEMANTIC ERROR: Required identifier property is a Token node: ERROR_MISSING_TOKEN",
|
|
52
|
-
);
|
|
53
|
-
});
|
|
54
|
-
});
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
function toLineContext(file: string, index: number): string {
|
|
2
|
-
const endEol = file.indexOf("\n", index + 80);
|
|
3
|
-
const endIndex = endEol === -1 ? file.length : endEol;
|
|
4
|
-
|
|
5
|
-
return file.substring(index, endIndex).split(/\n/).map((str) => " | " + str)
|
|
6
|
-
.join("\n");
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface TestScenario {
|
|
10
|
-
name: string;
|
|
11
|
-
text: string;
|
|
12
|
-
expected: string;
|
|
13
|
-
expectedErrors: string;
|
|
14
|
-
expectedWarnings: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function getSdlAnalyserTestScenarios(file: string, fileName: string) {
|
|
18
|
-
const scenarioExpr =
|
|
19
|
-
/\s*#[ \t]*(.*)(?:\r\n|\r|\n)([^]*?)==+>([^]*?)(?:\s*$|(?:\r\n|\r|\n)+(?=#))/gy;
|
|
20
|
-
const testScenarios: Array<TestScenario> = [];
|
|
21
|
-
let lastIndex = 0;
|
|
22
|
-
|
|
23
|
-
for (;;) {
|
|
24
|
-
const scenarioRegexResult = scenarioExpr.exec(file);
|
|
25
|
-
|
|
26
|
-
if (!scenarioRegexResult) {
|
|
27
|
-
throw new Error(
|
|
28
|
-
`Unexpected file format in ${fileName} around\n\n${
|
|
29
|
-
toLineContext(file, lastIndex)
|
|
30
|
-
}`,
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const name = scenarioRegexResult[1].trim();
|
|
35
|
-
const text = scenarioRegexResult[2].trim();
|
|
36
|
-
let rawExpected = scenarioRegexResult[3];
|
|
37
|
-
|
|
38
|
-
let expected = "";
|
|
39
|
-
let expectedErrors = "";
|
|
40
|
-
let expectedWarnings = "";
|
|
41
|
-
|
|
42
|
-
if (rawExpected.includes("errors:")) {
|
|
43
|
-
let expectedSplit = rawExpected.split(/errors:/);
|
|
44
|
-
|
|
45
|
-
expected = expectedSplit[0].trim();
|
|
46
|
-
rawExpected = expectedSplit[1] ?? "";
|
|
47
|
-
|
|
48
|
-
if (rawExpected.includes("warnings:")) {
|
|
49
|
-
expectedSplit = rawExpected.split(/warnings:/);
|
|
50
|
-
expectedErrors = (expectedSplit[0] ?? "").trim();
|
|
51
|
-
expectedWarnings = (expectedSplit[1] ?? "").trim();
|
|
52
|
-
} else {
|
|
53
|
-
expectedErrors = rawExpected.trim();
|
|
54
|
-
}
|
|
55
|
-
} else if (rawExpected.includes("warnings")) {
|
|
56
|
-
const expectedSplit = rawExpected.split(/warnings:/);
|
|
57
|
-
|
|
58
|
-
expected = expectedSplit[0].trim();
|
|
59
|
-
expectedWarnings = (expectedSplit[1] ?? "").trim();
|
|
60
|
-
} else {
|
|
61
|
-
expected = rawExpected.trim();
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
testScenarios.push({
|
|
65
|
-
name,
|
|
66
|
-
text,
|
|
67
|
-
expected,
|
|
68
|
-
expectedErrors,
|
|
69
|
-
expectedWarnings,
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
lastIndex = scenarioRegexResult.index + scenarioRegexResult[0].length;
|
|
73
|
-
|
|
74
|
-
if (lastIndex == file.length) {
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return testScenarios;
|
|
80
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import * as path from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { describe, expect, test } from "bun:test";
|
|
5
|
-
import { createStrictSdlParser } from "../../src/lezer/create-sdl-parser.ts";
|
|
6
|
-
import { getSdlAnalyserTestScenarios } from "./get-sdl-analyser-test-scenarios.ts";
|
|
7
|
-
import { createLenientSdlAnalyser } from "../../src/analyser/create-sdl-analyser.ts";
|
|
8
|
-
import { buildAst } from "../../src/ast/build-ast.ts";
|
|
9
|
-
import { SdlStringInput } from "../../src/lezer/sdl-string-input.ts";
|
|
10
|
-
import { getSymbolTableString } from "../../src/analyser/util/symbol-table-utils.ts";
|
|
11
|
-
import type { Specification } from "../../src/ast/node/specification.ts";
|
|
12
|
-
|
|
13
|
-
const sdlParser = createStrictSdlParser();
|
|
14
|
-
const sdlAnalyser = createLenientSdlAnalyser(undefined);
|
|
15
|
-
const testCaseDir = path.join(
|
|
16
|
-
path.dirname(fileURLToPath(import.meta.url)),
|
|
17
|
-
"test-cases",
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
const normalize = (s: string) => s.replace(/\r\n/g, "\n");
|
|
21
|
-
|
|
22
|
-
for (const filename of fs.readdirSync(testCaseDir)) {
|
|
23
|
-
if (!/\.txt$/.test(filename)) {
|
|
24
|
-
continue;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const scenarioName = /^[^\.]*/.exec(filename)?.[0] || "??";
|
|
28
|
-
|
|
29
|
-
describe(`SDL Analyser ${scenarioName} Tests`, () => {
|
|
30
|
-
const testCases = fs.readFileSync(path.join(testCaseDir, filename), "utf8");
|
|
31
|
-
|
|
32
|
-
for (
|
|
33
|
-
const testScenario of getSdlAnalyserTestScenarios(testCases, filename)
|
|
34
|
-
) {
|
|
35
|
-
test(`Test SDL Analyser ${scenarioName} - ${testScenario.name}`, () => {
|
|
36
|
-
const sdlString = testScenario.text.trim();
|
|
37
|
-
const expectedOutput = normalize(testScenario.expected.trim());
|
|
38
|
-
|
|
39
|
-
const sdlStringInput = new SdlStringInput(sdlString);
|
|
40
|
-
const parseTree = sdlParser.parse(sdlStringInput);
|
|
41
|
-
const specification = buildAst(parseTree, sdlStringInput);
|
|
42
|
-
const actualAnalysisResult = sdlAnalyser.analyse(
|
|
43
|
-
specification as Specification,
|
|
44
|
-
);
|
|
45
|
-
const actualOutput = normalize(getSymbolTableString(
|
|
46
|
-
actualAnalysisResult.symbolTable,
|
|
47
|
-
));
|
|
48
|
-
|
|
49
|
-
expect(actualOutput).toBe(expectedOutput);
|
|
50
|
-
|
|
51
|
-
const actualErrors = actualAnalysisResult.semanticErrors
|
|
52
|
-
.map((e) => e.errorMessage)
|
|
53
|
-
.join("\n");
|
|
54
|
-
const expectedErrors = normalize(testScenario.expectedErrors);
|
|
55
|
-
|
|
56
|
-
expect(actualErrors).toBe(expectedErrors);
|
|
57
|
-
|
|
58
|
-
const actualWarnings = actualAnalysisResult.semanticWarnings
|
|
59
|
-
.map((e) => e.errorMessage)
|
|
60
|
-
.join("\n");
|
|
61
|
-
const expectedWarnings = normalize(testScenario.expectedWarnings);
|
|
62
|
-
|
|
63
|
-
expect(actualWarnings).toBe(expectedWarnings);
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
}
|