-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17523 from github/redsun82/rust-break-up-schema
Codegen/Rust: allow breaking up schema file
- Loading branch information
Showing
8 changed files
with
74 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
---|---|---|
|
@@ -117,7 +117,7 @@ locatable_locations( | |
); | ||
|
||
|
||
// from schema.py | ||
// from schema | ||
|
||
@element = | ||
@locatable | ||
|
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,16 @@ | ||
""" | ||
Schema description | ||
This file should be kept simple: | ||
* no flow control | ||
* no aliases | ||
* only class definitions with annotations and `include` calls | ||
For how documentation of generated QL code works, please read `misc/codegen/schema_documentation.md`. | ||
""" | ||
|
||
from .prelude import * | ||
from .ast import * | ||
|
||
include("../shared/tree-sitter-extractor/src/generator/prefix.dbscheme") | ||
include("prefix.dbscheme") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from misc.codegen.lib.schemadefs import * | ||
|
||
@qltest.skip | ||
class Element: | ||
pass | ||
|
||
|
||
@qltest.skip | ||
class Locatable(Element): | ||
pass | ||
|
||
|
||
@qltest.skip | ||
class AstNode(Locatable): | ||
pass | ||
|
||
|
||
@qltest.skip | ||
class Unextracted(Element): | ||
""" | ||
The base class marking everything that was not properly extracted for some reason, such as: | ||
* syntax errors | ||
* insufficient context information | ||
* yet unimplemented parts of the extractor | ||
""" | ||
pass | ||
|
||
|
||
@qltest.skip | ||
class Missing(Unextracted): | ||
""" | ||
The base class marking errors during parsing or resolution. | ||
""" | ||
|
||
|
||
@qltest.skip | ||
class Unimplemented(Unextracted): | ||
""" | ||
The base class for unimplemented nodes. This is used to mark nodes that are not yet extracted. | ||
""" | ||
pass |