-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: feat: support schema call expr partial eval.
- Loading branch information
Showing
11 changed files
with
81 additions
and
5 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
Binary file not shown.
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
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,17 @@ | ||
schema Spec: | ||
data: int | ||
id: int | ||
|
||
mixin AMixin: | ||
spec: Spec { | ||
id = 1 | ||
} | ||
|
||
schema A: | ||
mixin [AMixin] | ||
|
||
spec: Spec { | ||
data = 1 | ||
} | ||
|
||
a = A() |
4 changes: 4 additions & 0 deletions
4
test/grammar/schema/partial_eval/partial_eval_2/stdout.golden
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,4 @@ | ||
a: | ||
spec: | ||
data: 1 | ||
id: 1 |
17 changes: 17 additions & 0 deletions
17
test/grammar/schema/partial_eval/partial_eval_fail_2/main.k
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,17 @@ | ||
schema Spec: | ||
data: int | ||
id: int | ||
|
||
mixin AMixin: | ||
spec: Spec = { | ||
id = 1 | ||
} | ||
|
||
schema A: | ||
mixin [AMixin] | ||
|
||
spec: Spec = { | ||
data = 1 | ||
} | ||
|
||
a = A() |
18 changes: 18 additions & 0 deletions
18
test/grammar/schema/partial_eval/partial_eval_fail_2/stderr.golden.py
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,18 @@ | ||
import sys | ||
import os | ||
|
||
import kclvm.kcl.error as kcl_error | ||
|
||
cwd = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
kcl_error.print_kcl_error_message( | ||
kcl_error.get_exception(err_type=kcl_error.ErrType.EvaluationError_TYPE, | ||
file_msgs=[ | ||
kcl_error.ErrFileMsg( | ||
filename=cwd + "/main.k", | ||
line_no=17 | ||
), | ||
], | ||
arg_msg="attribute 'data' of Spec is required and can't be None or Undefined") | ||
, file=sys.stdout | ||
) |