Skip to content

Commit 549a73b

Browse files
committed
feat: add kcl type modules
Signed-off-by: peefy <[email protected]>
1 parent 554891d commit 549a73b

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

kcl_type/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Introduction
2+
3+
`kcl_type` is a module for KCL type definitions
4+
5+
## Resource
6+
7+
The code source and documents are [here](https://github.com/kcl-lang/artifacthub/tree/main/kcl_type)

kcl_type/kcl.mod

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[package]
2+
name = "kcl_type"
3+
version = "0.0.1"
4+
description = "`kcl_type` is a module for KCL type definitions"

kcl_type/main.k

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
INT_TYPE: str = "int"
2+
FLOAT_TYPE: str = "float"
3+
STR_TYPE: str = "str"
4+
BOOL_TYPE: str = "bool"
5+
NONE_TYPE: str = "NoneType"
6+
UNDEFINED_TYPE: str = "UndefinedType"
7+
ANY_TYPE: str = "any"
8+
LIST_TYPE: str = "list"
9+
DICT_TYPE: str = "dict"
10+
FUNCTION_TYPE: str = "function"
11+
NUMBER_MULTIPLIER_TYPE: str = "number_multiplier"
12+
SCHEMA_TYPE: str = "schema"
13+
14+
ALL_BUILTIN_TYPES: [str] = [
15+
INT_TYPE
16+
FLOAT_TYPE
17+
STR_TYPE
18+
BOOL_TYPE
19+
NONE_TYPE
20+
UNDEFINED_TYPE
21+
ANY_TYPE
22+
LIST_TYPE
23+
DICT_TYPE
24+
FUNCTION_TYPE
25+
NUMBER_MULTIPLIER_TYPE
26+
]
27+
28+
NAME_CONSTANT_NONE: str = "None"
29+
NAME_CONSTANT_UNDEFINED: str = "Undefined"
30+
NAME_CONSTANT_TRUE: str = "True"
31+
NAME_CONSTANT_FALSE: str = "False"
32+
NAME_CONSTANTS: [str] = [
33+
NAME_CONSTANT_NONE,
34+
NAME_CONSTANT_UNDEFINED,
35+
NAME_CONSTANT_TRUE,
36+
NAME_CONSTANT_FALSE,
37+
]
38+
NUMBER_MULTIPLIER_TYPE_REGEX: str = r"^([1-9][0-9]{0,63})(E|P|T|G|M|K|k|m|u|n|Ei|Pi|Ti|Gi|Mi|Ki)$"

0 commit comments

Comments
 (0)