-
Notifications
You must be signed in to change notification settings - Fork 112
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
Showing
13 changed files
with
143 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
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,4 @@ | ||
schema Values: | ||
a: int | ||
|
||
values: Values = {} |
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=os.path.join(cwd, "main.k"), | ||
line_no=4, | ||
), | ||
], | ||
arg_msg="attribute 'a' of Version is required and can't be None or Undefined") | ||
, file=sys.stdout | ||
) |
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 @@ | ||
schema Values: | ||
a: int | ||
|
||
values: Values = Values {a = 1} | {a = Undefined} |
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=os.path.join(cwd, "main.k"), | ||
line_no=4, | ||
), | ||
], | ||
arg_msg="attribute 'a' of Version is required and can't be None or Undefined") | ||
, file=sys.stdout | ||
) |
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 @@ | ||
schema Values: | ||
a: int | ||
|
||
values: Values = Values {a = 1} | {a = 2} | {a = None} |
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=os.path.join(cwd, "main.k"), | ||
line_no=4, | ||
), | ||
], | ||
arg_msg="attribute 'a' of Version is required and can't be None or Undefined") | ||
, file=sys.stdout | ||
) |
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 @@ | ||
values = { | ||
res.cpu = 2 | ||
res.no_such_attr = 2 | ||
} | ||
|
||
schema Config: | ||
res: Res | ||
|
||
schema Res: | ||
cpu: int | ||
|
||
c: Config { | ||
res: values.res | ||
res: Res { | ||
cpu = 1 | ||
} | ||
} |
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=os.path.join(cwd, "main.k"), | ||
line_no=10, | ||
), | ||
], | ||
arg_msg="No attribute named 'no_such_attr' in the schema 'Res'") | ||
, file=sys.stdout | ||
) |
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 @@ | ||
values = { | ||
res.cpu = 2 | ||
res.no_such_attr = 2 | ||
} | ||
|
||
schema Config: | ||
res: Res | ||
|
||
schema Res: | ||
cpu: int | ||
|
||
c: Config { | ||
res: Res { | ||
cpu = 1 | ||
} | ||
res: values.res | ||
} |
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=os.path.join(cwd, "main.k"), | ||
line_no=10, | ||
), | ||
], | ||
arg_msg="No attribute named 'no_such_attr' in the schema 'Res'") | ||
, file=sys.stdout | ||
) |