-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b83dc23
commit 03139e3
Showing
12 changed files
with
484 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
pkg/composableschemadsl/parser/tests/localimport_import_path_with_keyword.zed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from .path.definition.user import user, persona | ||
|
||
definition resource { | ||
relation user: user | ||
relation persona: persona | ||
permission view = user + persona | ||
} |
50 changes: 50 additions & 0 deletions
50
pkg/composableschemadsl/parser/tests/localimport_import_path_with_keyword.zed.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
NodeTypeFile | ||
end-rune = 20 | ||
input-source = local imports with keyword in import path test | ||
start-rune = 0 | ||
child-node => | ||
NodeTypeImport | ||
end-rune = 10 | ||
input-source = local imports with keyword in import path test | ||
start-rune = 0 | ||
child-node => | ||
NodeTypeError | ||
end-rune = 10 | ||
error-message = Expected keyword import, found token TokenTypeKeyword | ||
error-source = definition | ||
input-source = local imports with keyword in import path test | ||
start-rune = 11 | ||
path-segment => | ||
NodeTypeIdentifier | ||
end-rune = 9 | ||
identifier-value = path | ||
input-source = local imports with keyword in import path test | ||
start-rune = 6 | ||
NodeTypeIdentifier | ||
end-rune = 10 | ||
input-source = local imports with keyword in import path test | ||
start-rune = 11 | ||
child-node => | ||
NodeTypeError | ||
end-rune = 10 | ||
error-message = Expected identifier, found token TokenTypeKeyword | ||
error-source = definition | ||
input-source = local imports with keyword in import path test | ||
start-rune = 11 | ||
NodeTypeDefinition | ||
end-rune = 20 | ||
input-source = local imports with keyword in import path test | ||
start-rune = 11 | ||
child-node => | ||
NodeTypeError | ||
end-rune = 20 | ||
error-message = Expected identifier, found token TokenTypePeriod | ||
error-source = . | ||
input-source = local imports with keyword in import path test | ||
start-rune = 21 | ||
NodeTypeError | ||
end-rune = 20 | ||
error-message = Unexpected token at root level: TokenTypePeriod | ||
error-source = . | ||
input-source = local imports with keyword in import path test | ||
start-rune = 21 |
7 changes: 7 additions & 0 deletions
7
pkg/composableschemadsl/parser/tests/localimport_keyword_in_identifiers.zed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from .path.to.user import user, caveat | ||
|
||
definition resource { | ||
relation user: user | ||
relation persona: persona | ||
permission view = user + persona | ||
} |
121 changes: 121 additions & 0 deletions
121
pkg/composableschemadsl/parser/tests/localimport_keyword_in_identifiers.zed.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
NodeTypeFile | ||
end-rune = 154 | ||
input-source = local imports with keyword in identifiers test | ||
start-rune = 0 | ||
child-node => | ||
NodeTypeImport | ||
end-rune = 30 | ||
input-source = local imports with keyword in identifiers test | ||
start-rune = 0 | ||
child-node => | ||
NodeTypeError | ||
end-rune = 30 | ||
error-message = Expected one of: [TokenTypeComma], found: TokenTypeKeyword | ||
error-source = caveat | ||
input-source = local imports with keyword in identifiers test | ||
start-rune = 32 | ||
imported-definition => | ||
NodeTypeIdentifier | ||
end-rune = 29 | ||
identifier-value = user | ||
input-source = local imports with keyword in identifiers test | ||
start-rune = 26 | ||
NodeTypeIdentifier | ||
end-rune = 30 | ||
input-source = local imports with keyword in identifiers test | ||
start-rune = 32 | ||
child-node => | ||
NodeTypeError | ||
end-rune = 30 | ||
error-message = Expected identifier, found token TokenTypeKeyword | ||
error-source = caveat | ||
input-source = local imports with keyword in identifiers test | ||
start-rune = 32 | ||
path-segment => | ||
NodeTypeIdentifier | ||
end-rune = 9 | ||
identifier-value = path | ||
input-source = local imports with keyword in identifiers test | ||
start-rune = 6 | ||
NodeTypeIdentifier | ||
end-rune = 12 | ||
identifier-value = to | ||
input-source = local imports with keyword in identifiers test | ||
start-rune = 11 | ||
NodeTypeIdentifier | ||
end-rune = 17 | ||
identifier-value = user | ||
input-source = local imports with keyword in identifiers test | ||
start-rune = 14 | ||
NodeTypeCaveatDefinition | ||
end-rune = 37 | ||
input-source = local imports with keyword in identifiers test | ||
start-rune = 32 | ||
child-node => | ||
NodeTypeError | ||
end-rune = 37 | ||
error-message = Expected identifier, found token TokenTypeSyntheticSemicolon | ||
error-source = | ||
|
||
input-source = local imports with keyword in identifiers test | ||
start-rune = 38 | ||
NodeTypeDefinition | ||
definition-name = resource | ||
end-rune = 153 | ||
input-source = local imports with keyword in identifiers test | ||
start-rune = 40 | ||
child-node => | ||
NodeTypeRelation | ||
end-rune = 84 | ||
input-source = local imports with keyword in identifiers test | ||
relation-name = user | ||
start-rune = 66 | ||
allowed-types => | ||
NodeTypeTypeReference | ||
end-rune = 84 | ||
input-source = local imports with keyword in identifiers test | ||
start-rune = 81 | ||
type-ref-type => | ||
NodeTypeSpecificTypeReference | ||
end-rune = 84 | ||
input-source = local imports with keyword in identifiers test | ||
start-rune = 81 | ||
type-name = user | ||
NodeTypeRelation | ||
end-rune = 114 | ||
input-source = local imports with keyword in identifiers test | ||
relation-name = persona | ||
start-rune = 90 | ||
allowed-types => | ||
NodeTypeTypeReference | ||
end-rune = 114 | ||
input-source = local imports with keyword in identifiers test | ||
start-rune = 108 | ||
type-ref-type => | ||
NodeTypeSpecificTypeReference | ||
end-rune = 114 | ||
input-source = local imports with keyword in identifiers test | ||
start-rune = 108 | ||
type-name = persona | ||
NodeTypePermission | ||
end-rune = 151 | ||
input-source = local imports with keyword in identifiers test | ||
relation-name = view | ||
start-rune = 120 | ||
compute-expression => | ||
NodeTypeUnionExpression | ||
end-rune = 151 | ||
input-source = local imports with keyword in identifiers test | ||
start-rune = 138 | ||
left-expr => | ||
NodeTypeIdentifier | ||
end-rune = 141 | ||
identifier-value = user | ||
input-source = local imports with keyword in identifiers test | ||
start-rune = 138 | ||
right-expr => | ||
NodeTypeIdentifier | ||
end-rune = 151 | ||
identifier-value = persona | ||
input-source = local imports with keyword in identifiers test | ||
start-rune = 145 |
7 changes: 7 additions & 0 deletions
7
pkg/composableschemadsl/parser/tests/localimport_malformed_identifier_set.zed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from .path.to.user import user, | ||
|
||
definition resource { | ||
relation user: user | ||
relation persona: persona | ||
permission view = user + persona | ||
} |
109 changes: 109 additions & 0 deletions
109
pkg/composableschemadsl/parser/tests/localimport_malformed_identifier_set.zed.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
NodeTypeFile | ||
end-rune = 147 | ||
input-source = local imports with malformed identifiers set test | ||
start-rune = 0 | ||
child-node => | ||
NodeTypeImport | ||
end-rune = 30 | ||
input-source = local imports with malformed identifiers set test | ||
start-rune = 0 | ||
child-node => | ||
NodeTypeError | ||
end-rune = 30 | ||
error-message = Expected one of: [TokenTypeComma], found: TokenTypeKeyword | ||
error-source = definition | ||
input-source = local imports with malformed identifiers set test | ||
start-rune = 33 | ||
imported-definition => | ||
NodeTypeIdentifier | ||
end-rune = 29 | ||
identifier-value = user | ||
input-source = local imports with malformed identifiers set test | ||
start-rune = 26 | ||
NodeTypeIdentifier | ||
end-rune = 30 | ||
input-source = local imports with malformed identifiers set test | ||
start-rune = 33 | ||
child-node => | ||
NodeTypeError | ||
end-rune = 30 | ||
error-message = Expected identifier, found token TokenTypeKeyword | ||
error-source = definition | ||
input-source = local imports with malformed identifiers set test | ||
start-rune = 33 | ||
path-segment => | ||
NodeTypeIdentifier | ||
end-rune = 9 | ||
identifier-value = path | ||
input-source = local imports with malformed identifiers set test | ||
start-rune = 6 | ||
NodeTypeIdentifier | ||
end-rune = 12 | ||
identifier-value = to | ||
input-source = local imports with malformed identifiers set test | ||
start-rune = 11 | ||
NodeTypeIdentifier | ||
end-rune = 17 | ||
identifier-value = user | ||
input-source = local imports with malformed identifiers set test | ||
start-rune = 14 | ||
NodeTypeDefinition | ||
definition-name = resource | ||
end-rune = 146 | ||
input-source = local imports with malformed identifiers set test | ||
start-rune = 33 | ||
child-node => | ||
NodeTypeRelation | ||
end-rune = 77 | ||
input-source = local imports with malformed identifiers set test | ||
relation-name = user | ||
start-rune = 59 | ||
allowed-types => | ||
NodeTypeTypeReference | ||
end-rune = 77 | ||
input-source = local imports with malformed identifiers set test | ||
start-rune = 74 | ||
type-ref-type => | ||
NodeTypeSpecificTypeReference | ||
end-rune = 77 | ||
input-source = local imports with malformed identifiers set test | ||
start-rune = 74 | ||
type-name = user | ||
NodeTypeRelation | ||
end-rune = 107 | ||
input-source = local imports with malformed identifiers set test | ||
relation-name = persona | ||
start-rune = 83 | ||
allowed-types => | ||
NodeTypeTypeReference | ||
end-rune = 107 | ||
input-source = local imports with malformed identifiers set test | ||
start-rune = 101 | ||
type-ref-type => | ||
NodeTypeSpecificTypeReference | ||
end-rune = 107 | ||
input-source = local imports with malformed identifiers set test | ||
start-rune = 101 | ||
type-name = persona | ||
NodeTypePermission | ||
end-rune = 144 | ||
input-source = local imports with malformed identifiers set test | ||
relation-name = view | ||
start-rune = 113 | ||
compute-expression => | ||
NodeTypeUnionExpression | ||
end-rune = 144 | ||
input-source = local imports with malformed identifiers set test | ||
start-rune = 131 | ||
left-expr => | ||
NodeTypeIdentifier | ||
end-rune = 134 | ||
identifier-value = user | ||
input-source = local imports with malformed identifiers set test | ||
start-rune = 131 | ||
right-expr => | ||
NodeTypeIdentifier | ||
end-rune = 144 | ||
identifier-value = persona | ||
input-source = local imports with malformed identifiers set test | ||
start-rune = 138 |
7 changes: 7 additions & 0 deletions
7
pkg/composableschemadsl/parser/tests/localimport_malformed_import_path.zed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from .path.to. import user, persona | ||
|
||
definition resource { | ||
relation user: user | ||
relation persona: persona | ||
permission view = user + persona | ||
} |
Oops, something went wrong.