You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libscript/src/type.mlc
+18-15Lines changed: 18 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -12,10 +12,10 @@ public foreign handler EvalStringAsBool(in Target as string, out Value as bool)
12
12
public foreign handler EvalStringAsReal(in Target as string, out Value as real) as undefined binds to "<builtin>"
13
13
public foreign handler EvalStringAsInt(in Target as string, out Value as int) as undefined binds to "<builtin>"
14
14
15
-
public foreign handler EvalIsEmpty(in Target as any, out Value as bool) as undefined binds to "<builtin>"
16
-
public foreign handler EvalIsNotEmpty(in Target as any, out Value as bool) as undefined binds to "<builtin>"
17
-
public foreign handler EvalIsDefined(in Target as any, out Value as bool) as undefined binds to "<builtin>"
18
-
public foreign handler EvalIsNotDefined(in Target as any, out Value as bool) as undefined binds to "<builtin>"
15
+
public foreign handler MCTypeEvalIsEmpty(in Target as any, out Value as bool) as undefined binds to "<builtin>"
16
+
public foreign handler MCTypeEvalIsNotEmpty(in Target as any, out Value as bool) as undefined binds to "<builtin>"
17
+
public foreign handler MCTypeEvalIsDefined(in Target as any, out Value as bool) as undefined binds to "<builtin>"
18
+
public foreign handler MCTypeEvalIsNotDefined(in Target as any, out Value as bool) as undefined binds to "<builtin>"
19
19
20
20
--
21
21
@@ -28,13 +28,15 @@ output: The converted value if there is a valid conversion from the type of
28
28
Example: put true as string into tVar // tVar contains the string "true"
29
29
*/
30
30
31
+
/*
31
32
syntax AsString is postfix operator with precedence 1
32
33
<Target: Expression> "as" "string"
33
34
begin
34
35
EvalBoolAsString(Target, output)
35
36
EvalIntAsString(Target, output)
36
37
EvalRealAsString(Target, output)
37
38
end syntax
39
+
*/
38
40
39
41
/*
40
42
Summary: Converts <Target> to a real.
@@ -46,14 +48,14 @@ output: The converted value if there is a valid conversion from the type of
46
48
47
49
Example: put "8.0" as real into tVar // tVar contains the real number 8.0
48
50
*/
49
-
51
+
/*
50
52
syntax AsReal is postfix operator with precedence 1
51
53
<Target: Expression> "as" "real"
52
54
begin
53
55
EvalIntAsReal(Target, output)
54
56
EvalStringAsReal(Target, output)
55
57
end syntax
56
-
58
+
*/
57
59
/*
58
60
Summary: Converts <Target> to an integer.
59
61
@@ -62,12 +64,13 @@ output: The converted value if there is a valid conversion the string <Targe
62
64
A string has a valid conversion to an int if it consists of digits, and optionally a leading minus sign, and if the resulting integer is within the valid range for a 32-bit integer.
63
65
Example: put "8" as integer into tVar // tVar contains the integer 8
64
66
*/
65
-
67
+
/*
66
68
syntax AsInt is postfix operator with precedence 1
67
69
<Target: Expression> "as" "int"
68
70
begin
69
71
EvalStringAsInt(Target, output)
70
72
end syntax
73
+
*/
71
74
72
75
/*
73
76
Summary: Converts <Target> to a bool, if there is a valid conversion.
@@ -77,13 +80,13 @@ output: The converted value if there is a valid conversion the string <Targe
77
80
78
81
Example: put "true" as bool into tVar // tVar contains the boolean value true
79
82
*/
80
-
83
+
/*
81
84
syntax AsBool is postfix operator with precedence 1
82
85
<Target: Expression> "as" "bool"
83
86
begin
84
87
EvalStringAsBool(Target, output)
85
88
end syntax
86
-
89
+
*/
87
90
--
88
91
89
92
/*
@@ -97,7 +100,7 @@ output: Returns true if the given expression <Target> evaluates to the empty
97
100
syntax IsEmpty is postfix operator with precedence 1
98
101
<Target: Expression> "is" "empty"
99
102
begin
100
-
EvalIsEmpty(Target, output)
103
+
MCTypeEvalIsEmpty(Target, output)
101
104
end syntax
102
105
103
106
/*
@@ -109,9 +112,9 @@ output: Returns false if the given expression <Target> evaluates to the empt
109
112
*/
110
113
111
114
syntax IsNotEmpty is postfix operator with precedence 1
112
-
<Target: Expression> "is" "not" "empty"
115
+
<Target: Expression> "isnot" "empty"
113
116
begin
114
-
EvalIsNotEmpty(Target, output)
117
+
MCTypeEvalIsNotEmpty(Target, output)
115
118
end syntax
116
119
117
120
--
@@ -127,7 +130,7 @@ output: Returns true if the given expression <Target> is defined, and false
127
130
syntax IsDefined is postfix operator with precedence 1
128
131
<Target: Expression> "is" "defined"
129
132
begin
130
-
EvalIsDefined(Target, output)
133
+
MCTypeEvalIsDefined(Target, output)
131
134
end syntax
132
135
133
136
/*
@@ -139,9 +142,9 @@ output: Returns false if the given expression <Target> is defined, and true
139
142
*/
140
143
141
144
syntax IsNotDefined is postfix operator with precedence 1
0 commit comments