jaclang 0.8.2__py3-none-any.whl → 0.8.3__py3-none-any.whl
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.
Potentially problematic release.
This version of jaclang might be problematic. Click here for more details.
- jaclang/compiler/constant.py +2 -0
- jaclang/compiler/jac.lark +5 -0
- jaclang/compiler/larkparse/jac_parser.py +2 -2
- jaclang/compiler/parser.py +16 -0
- jaclang/compiler/passes/main/__init__.py +2 -0
- jaclang/compiler/passes/main/pyast_gen_pass.py +3 -0
- jaclang/compiler/passes/main/sem_def_match_pass.py +67 -0
- jaclang/compiler/passes/main/sym_tab_build_pass.py +8 -0
- jaclang/compiler/passes/main/tests/fixtures/sem_def_match.impl.jac +12 -0
- jaclang/compiler/passes/main/tests/fixtures/sem_def_match.jac +31 -0
- jaclang/compiler/passes/main/tests/test_sem_def_match_pass.py +38 -0
- jaclang/compiler/passes/tool/doc_ir_gen_pass.py +22 -1
- jaclang/compiler/passes/tool/tests/fixtures/has_frmt.jac +13 -0
- jaclang/compiler/passes/tool/tests/test_jac_format_pass.py +7 -0
- jaclang/compiler/program.py +2 -0
- jaclang/compiler/unitree.py +56 -0
- {jaclang-0.8.2.dist-info → jaclang-0.8.3.dist-info}/METADATA +1 -1
- {jaclang-0.8.2.dist-info → jaclang-0.8.3.dist-info}/RECORD +20 -15
- {jaclang-0.8.2.dist-info → jaclang-0.8.3.dist-info}/WHEEL +0 -0
- {jaclang-0.8.2.dist-info → jaclang-0.8.3.dist-info}/entry_points.txt +0 -0
jaclang/compiler/constant.py
CHANGED
|
@@ -19,6 +19,7 @@ class SymbolType(Enum):
|
|
|
19
19
|
TEST = "test" # LSP: Function
|
|
20
20
|
TYPE = "type" # LSP: TypeParameter
|
|
21
21
|
IMPL = "impl" # LSP: Interface or Property
|
|
22
|
+
SEM = "sem" # LSP: Property
|
|
22
23
|
HAS_VAR = "field" # LSP: Field
|
|
23
24
|
METHOD = "method" # LSP: Method
|
|
24
25
|
CONSTRUCTOR = "constructor" # LSP: Constructor
|
|
@@ -290,6 +291,7 @@ class Tokens(str, Enum):
|
|
|
290
291
|
KW_ROOT = "KW_ROOT"
|
|
291
292
|
KW_POST_INIT = "KW_POST_INIT"
|
|
292
293
|
KW_IMPL = "KW_IMPL"
|
|
294
|
+
KW_SEM = "KW_SEM"
|
|
293
295
|
TYPE_OP = "TYPE_OP"
|
|
294
296
|
A_PIPE_FWD = "A_PIPE_FWD"
|
|
295
297
|
A_PIPE_BKWD = "A_PIPE_BKWD"
|
jaclang/compiler/jac.lark
CHANGED
|
@@ -8,6 +8,7 @@ tl_stmt_with_doc: STRING toplevel_stmt
|
|
|
8
8
|
toplevel_stmt: import_stmt
|
|
9
9
|
| archetype
|
|
10
10
|
| impl_def
|
|
11
|
+
| sem_def
|
|
11
12
|
| ability
|
|
12
13
|
| global_var
|
|
13
14
|
| free_code
|
|
@@ -75,6 +76,9 @@ impl_def: decorators? KW_IMPL dotted_name impl_spec? impl_tail
|
|
|
75
76
|
impl_spec: inherited_archs | func_decl | event_clause
|
|
76
77
|
impl_tail: enum_block | block_tail
|
|
77
78
|
|
|
79
|
+
// [Heading]: Semstrings.
|
|
80
|
+
sem_def: KW_SEM dotted_name EQ STRING SEMI
|
|
81
|
+
|
|
78
82
|
// [Heading]: Global variables.
|
|
79
83
|
global_var: (KW_LET | KW_GLOBAL) access_tag? assignment_list SEMI
|
|
80
84
|
assignment_list: (assignment_list COMMA)? (assignment | named_ref)
|
|
@@ -521,6 +525,7 @@ KW_FLOW: "flow"
|
|
|
521
525
|
KW_WAIT: "wait"
|
|
522
526
|
KW_TEST: "test"
|
|
523
527
|
KW_IMPL: "impl"
|
|
528
|
+
KW_SEM: "sem"
|
|
524
529
|
KW_ASSERT: "assert"
|
|
525
530
|
KW_CHECK: "check"
|
|
526
531
|
KW_IF: "if"
|