Skip to content

Commit

Permalink
Merge pull request #1725 from aml-org/syntax-recovery
Browse files Browse the repository at this point in the history
W-12438860: syntax recovery
  • Loading branch information
nschejtman authored Feb 7, 2023
2 parents aa3aaf7 + 4ad4e52 commit b2561e3
Show file tree
Hide file tree
Showing 116 changed files with 7,324 additions and 88 deletions.
14 changes: 7 additions & 7 deletions amf-antlr-syntax/js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion amf-antlr-syntax/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"url": "https:/aml-org/amf"
},
"dependencies": {
"@aml-org/amf-antlr-parsers": "0.6.21",
"@aml-org/amf-antlr-parsers": "0.6.22",
"ajv": "6.12.6"
}
}
14 changes: 7 additions & 7 deletions amf-api-contract/js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion amf-api-contract/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"url": "https:/aml-org/amf"
},
"dependencies": {
"@aml-org/amf-antlr-parsers": "0.6.21",
"@aml-org/amf-antlr-parsers": "0.6.22",
"ajv": "6.12.6"
}
}
2 changes: 1 addition & 1 deletion amf-apicontract.versions
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
amf.apicontract=5.3.0-SNAPSHOT
amf.aml=6.3.0-SNAPSHOT
amf.model=3.8.1
antlr4Version=0.6.21
antlr4Version=0.6.22
amf.validation.profile.dialect=1.4.0-SNAPSHOT
amf.validation.report.dialect=1.2.0-SNAPSHOT
2 changes: 1 addition & 1 deletion amf-cli/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"types": "./typings/amf-client-js.d.ts",
"typings": "./typings/amf-client-js.d.ts",
"dependencies": {
"@aml-org/amf-antlr-parsers": "0.6.21",
"@aml-org/amf-antlr-parsers": "0.6.22",
"ajv": "6.12.6"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type Query {
name!: String
}

type Person {
name: String
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
[
{
"@id": "",
"@type": [
"doc:Document",
"doc:Fragment",
"doc:Module",
"doc:Unit"
],
"doc:encodes": [
{
"@id": "#/web-api",
"@type": [
"apiContract:WebAPI",
"apiContract:API",
"doc:RootDomainElement",
"doc:DomainElement"
],
"core:name": [
{
"@value": "extraneous-!-token.graphql"
}
],
"apiContract:endpoint": []
}
],
"doc:root": [
{
"@value": true
}
],
"doc:processingData": [
{
"@id": "#/BaseUnitProcessingData",
"@type": [
"doc:APIContractProcessingData"
],
"apiContract:modelVersion": [
{
"@value": "3.8.1"
}
],
"doc:sourceSpec": [
{
"@value": "GraphQL"
}
]
}
],
"doc:declares": [
{
"@id": "#/declares/shape/Person",
"@type": [
"shacl:NodeShape",
"raml-shapes:AnyShape",
"shacl:Shape",
"raml-shapes:Shape",
"doc:DomainElement"
],
"shacl:property": [
{
"@id": "#/declares/shape/Person/property/property/name",
"@type": [
"shacl:PropertyShape",
"shacl:Shape",
"raml-shapes:Shape",
"doc:DomainElement"
],
"raml-shapes:range": [
{
"@id": "#/declares/shape/Person/property/property/name/scalar/default-scalar",
"@type": [
"raml-shapes:ScalarShape",
"raml-shapes:AnyShape",
"shacl:Shape",
"raml-shapes:Shape",
"doc:DomainElement"
],
"shacl:datatype": [
{
"@id": "http://www.w3.org/2001/XMLSchema#string"
}
]
}
],
"shacl:minCount": [
{
"@value": 0
}
],
"shacl:name": [
{
"@value": "name"
}
]
}
],
"shacl:name": [
{
"@value": "Person"
}
]
}
],
"@context": {
"@base": "file://amf-cli/shared/src/test/resources/graphql/syntax-recovery/extraneous-!-token.graphql",
"raml-shapes": "http://a.ml/vocabularies/shapes#",
"shacl": "http://www.w3.org/ns/shacl#",
"doc": "http://a.ml/vocabularies/document#",
"apiContract": "http://a.ml/vocabularies/apiContract#",
"core": "http://a.ml/vocabularies/core#"
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ModelId: file://amf-cli/shared/src/test/resources/graphql/syntax-recovery/extraneous-!-token.graphql
Profile: GraphQL
Conforms: false
Number of results: 1

Level: Violation

- Constraint: http://a.ml/vocabularies/amf/parser#antlr-error
Message: Syntax error in the following text: '!'
Severity: Violation
Target:
Property:
Range: [(2,8)-(2,9)]
Location:
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type Query {
name": String
}
type Person {
name: String
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[
{
"@id": "",
"@type": [
"doc:Document",
"doc:Fragment",
"doc:Module",
"doc:Unit"
],
"doc:encodes": [
{
"@id": "#/web-api",
"@type": [
"apiContract:WebAPI",
"apiContract:API",
"doc:RootDomainElement",
"doc:DomainElement"
],
"core:name": [
{
"@value": "extraneous-%22-token.graphql"
}
],
"apiContract:endpoint": []
}
],
"doc:root": [
{
"@value": true
}
],
"doc:processingData": [
{
"@id": "#/BaseUnitProcessingData",
"@type": [
"doc:APIContractProcessingData"
],
"apiContract:modelVersion": [
{
"@value": "3.8.1"
}
],
"doc:sourceSpec": [
{
"@value": "GraphQL"
}
]
}
],
"@context": {
"@base": "file://amf-cli/shared/src/test/resources/graphql/syntax-recovery/extraneous-%22-token.graphql",
"doc": "http://a.ml/vocabularies/document#",
"apiContract": "http://a.ml/vocabularies/apiContract#",
"core": "http://a.ml/vocabularies/core#"
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ModelId: file://amf-cli/shared/src/test/resources/graphql/syntax-recovery/extraneous-"-token.graphql
Profile: GraphQL
Conforms: false
Number of results: 2

Level: Violation

- Constraint: http://a.ml/vocabularies/amf/parser#antlr-error
Message: Syntax error in the following text: '": String\n}\n\ntype Person {\n name: String\n}'
Severity: Violation
Target:
Property:
Range:
Location:

- Constraint: http://a.ml/vocabularies/amf/parser#antlr-error
Message: Syntax error: Unexpected end of file
Severity: Violation
Target:
Property:
Range: [(7,1)-(7,1)]
Location:
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type Query {
name&: String
}

type Person {
name: String
}
Loading

0 comments on commit b2561e3

Please sign in to comment.