Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 3f664eb

Browse files
committed
[[ Script ]] Tweaks to mlc files to make them compile.
1 parent adc98b4 commit 3f664eb

9 files changed

Lines changed: 43 additions & 42 deletions

File tree

libscript/src/encoding.mlc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ foreign handler ExecDecodeUsingBase64(in Source as string, out Value as data) as
1212
foreign handler ExecEncodeUsingBinary(in Source as data, in Format as string, out Value as string) as undefined binds to "<builtin>"
1313
foreign handler ExecDecodeUsingBinary(in Source as string, in Format as string, out Value as data) as undefined binds to "<builtin>"
1414

15-
foreign handler ExecEncodeUsingUTF8(in Target as string, out Target as data) as undefined binds to "<builtin>"
16-
foreign handler ExecDecodeUsingUTF8(in Target as data, out Target as string) as undefined binds to "<builtin>"
17-
foreign handler ExecEncodeUsingUTF16(in Target as string, out Target as data) as undefined binds to "<builtin>"
18-
foreign handler ExecDecodeUsingUTF16(in Target as data, out Target as string) as undefined binds to "<builtin>"
19-
foreign handler ExecEncodeUsingUTF32(in Target as string, out Target as data) as undefined binds to "<builtin>"
20-
foreign handler ExecDecodeUsingUTF32(in Target as data, out Target as string) as undefined binds to "<builtin>"
21-
foreign handler ExecEncodeUsingASCII(in Target as string, out Target as data) as undefined binds to "<builtin>"
22-
foreign handler ExecDecodeUsingASCII(in Target as data, out Target as string) as undefined binds to "<builtin>"
15+
foreign handler ExecEncodeUsingUTF8(in Source as string, out Target as data) as undefined binds to "<builtin>"
16+
foreign handler ExecDecodeUsingUTF8(in Source as data, out Target as string) as undefined binds to "<builtin>"
17+
foreign handler ExecEncodeUsingUTF16(in Source as string, out Target as data) as undefined binds to "<builtin>"
18+
foreign handler ExecDecodeUsingUTF16(in Source as data, out Target as string) as undefined binds to "<builtin>"
19+
foreign handler ExecEncodeUsingUTF32(in Source as string, out Target as data) as undefined binds to "<builtin>"
20+
foreign handler ExecDecodeUsingUTF32(in Source as data, out Target as string) as undefined binds to "<builtin>"
21+
foreign handler ExecEncodeUsingASCII(in Source as string, out Target as data) as undefined binds to "<builtin>"
22+
foreign handler ExecDecodeUsingASCII(in Source as data, out Target as string) as undefined binds to "<builtin>"
2323

2424
foreign handler EvalURLEncoded(in Target as string, out Value as string) as undefined binds to "<builtin>"
2525
foreign handler EvalURLDecoded(in Target as string, out Value as string) as undefined binds to "<builtin>"
@@ -136,13 +136,13 @@ end syntax
136136

137137
--
138138

139-
syntax URLEncoded is prefix operator
139+
syntax URLEncoded is prefix operator with precedence 3
140140
"the" "url" "encoded" "of" <Target: Expression>
141141
begin
142142
EvalURLEncoded(Target, output)
143143
end syntax
144144

145-
syntax URLDecoded is statement
145+
syntax URLDecoded is prefix operator with precedence 3
146146
"the" "url" "decoded" "of" <Target: Expression>
147147
begin
148148
EvalURLDecoded(Target, output)

libscript/src/item.mlc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,46 @@ foreign handler StoreItemRangeOf(in Value as string, in Start as index, in Finis
77

88
foreign handler EvalNumberOfItemsIn(in Target as string, out Count as index) as undefined binds to "<builtin>"
99

10-
foreign handler EvalIsAmongTheItemsOf(in Needle as string, in Target as string, in IsNot as bool, out Result as bool) as undefined binds to "<builtin>"
10+
foreign handler EvalIsAmongTheItemsOf(in Needle as string, in Target as string, out Result as bool) as undefined binds to "<builtin>"
11+
foreign handler EvalIsNotAmongTheItemsOf(in Needle as string, in Target as string, out Result as bool) as undefined binds to "<builtin>"
1112

1213
foreign handler EvalOffsetOfItemIn(in Needle as string, in Target as string, out Offset as index) as undefined binds to "<builtin>"
1314

1415
--
1516

16-
syntax SingletonItemOf is left unary operator with precedence 1
17+
syntax SingletonItemOf is prefix operator with precedence 1
1718
"item" <Index: Expression> "of" <Target: Expression>
1819
begin
1920
FetchItemOf(Index, Target, output)
2021
StoreItemOf(input, Index, Target)
2122
end syntax
2223

23-
syntax RangeItemOf is left unary operator with precedence 1
24+
syntax RangeItemOf is prefix operator with precedence 1
2425
"item" <Start: Expression> "to" <Finish: Expression> "of" <Target: Expression>
2526
begin
2627
FetchItemRangeOf(Start, Finish, Target, output)
2728
StoreItemRangeOf(input, Start, Finish, Target)
2829
end syntax
2930

30-
syntax CountItemsOf is left unary operator with precedence 1
31+
syntax CountItemsOf is prefix operator with precedence 1
3132
"the" "number" "of" "items" "in" <Target: Expression>
3233
begin
3334
EvalNumberOfItemsIn(Target, output)
3435
end syntax
3536

36-
syntax AmongItemsOf is left unary operator with precedence 1
37+
syntax AmongItemsOf is left binary operator with precedence 1
3738
<Needle: Expression> "is" "among" "the" "items" "of" <Target: Expression>
3839
begin
3940
EvalIsAmongTheItemsOf(Needle, Target, output)
4041
end syntax
4142

42-
syntax NotAmongItemsOf is left unary operator with precedence 1
43+
syntax NotAmongItemsOf is left binary operator with precedence 1
4344
<Needle: Expression> "is" "not" "among" "the" "items" "of" <Target: Expression>
4445
begin
4546
EvalIsNotAmongTheItemsOf(Needle, Target, output)
4647
end syntax
4748

48-
syntax ItemOffset is left unary operator with precedence 1
49+
syntax ItemOffset is prefix operator with precedence 1
4950
"the" "offset" "of" "item" <Needle: Expression> "in" <Target: Expression>
5051
begin
5152
EvalOffsetOfItemIn(Needle, Target, output)

libscript/src/itemchunk.mlc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,39 @@ foreign handler EvalOffsetOfItemIn(in Needle as string, in Target as string, out
1313

1414
--
1515

16-
syntax SingletonItemOf is left unary operator with precedence 1
16+
syntax SingletonItemOf is prefix operator with precedence 1
1717
"item" <Index: Expression> "of" <Target: Expression>
1818
begin
1919
FetchItemOf(Index, Target, output)
2020
StoreItemOf(input, Index, Target)
2121
end syntax
2222

23-
syntax RangeItemOf is left unary operator with precedence 1
23+
syntax RangeItemOf is prefix operator with precedence 1
2424
"item" <Start: Expression> "to" <Finish: Expression> "of" <Target: Expression>
2525
begin
2626
FetchItemRangeOf(Start, Finish, Target, output)
2727
StoreItemRangeOf(input, Start, Finish, Target)
2828
end syntax
2929

30-
syntax CountItemsOf is left unary operator with precedence 1
30+
syntax CountItemsOf is prefix operator with precedence 1
3131
"the" "number" "of" "items" "in" <Target: Expression>
3232
begin
3333
EvalNumberOfItemsIn(Target, output)
3434
end syntax
3535

36-
syntax AmongItemsOf is left unary operator with precedence 1
36+
syntax AmongItemsOf is left binary operator with precedence 1
3737
<Needle: Expression> "is" "among" "the" "items" "of" <Target: Expression>
3838
begin
39-
EvalIsAmongTheItemsOf(Needle, Target, output)
39+
EvalIsAmongTheItemsOf(Needle, Target, false, output)
4040
end syntax
4141

42-
syntax NotAmongItemsOf is left unary operator with precedence 1
42+
syntax NotAmongItemsOf is left binary operator with precedence 1
4343
<Needle: Expression> "is" "not" "among" "the" "items" "of" <Target: Expression>
4444
begin
45-
EvalIsNotAmongTheItemsOf(Needle, Target, output)
45+
EvalIsAmongTheItemsOf(Needle, Target, true, output)
4646
end syntax
4747

48-
syntax ItemOffset is left unary operator with precedence 1
48+
syntax ItemOffset is prefix operator with precedence 1
4949
"the" "offset" "of" "item" <Needle: Expression> "in" <Target: Expression>
5050
begin
5151
EvalOffsetOfItemIn(Needle, Target, output)

libscript/src/line.mlc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ begin
3434
end syntax
3535

3636
syntax AmongLinesOf is neutral binary operator with precedence 1
37-
<Needle: Expression> "is" ["not <IsNot=true>] "among" "the" "lines" "of" <Target: Expression>
37+
<Needle: Expression> "is" [ "not" <IsNot=true> ] "among" "the" "lines" "of" <Target: Expression>
3838
begin
39-
EvalIsAmongTheLinesOf(Needle, Target, output)
39+
EvalIsAmongTheLinesOf(Needle, Target, IsNot, output)
4040
end syntax
4141

4242
syntax LineOffset is prefix operator with precedence 1

libscript/src/linechunk.mlc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ begin
3434
end syntax
3535

3636
syntax AmongLinesOf is neutral binary operator with precedence 1
37-
<Needle: Expression> "is" ["not <IsNot=true>] "among" "the" "lines" "of" <Target: Expression>
37+
<Needle: Expression> "is" ["not" <IsNot=true>] "among" "the" "lines" "of" <Target: Expression>
3838
begin
39-
EvalIsAmongTheLinesOf(Needle, Target, output)
39+
EvalIsAmongTheLinesOf(Needle, Target, IsNot, output)
4040
end syntax
4141

4242
syntax LineOffset is prefix operator with precedence 1

libscript/src/list.mlc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Target: An expression which evaluates to a list.
6161
syntax PushOntoList is statement
6262
"push" <Value: Expression> "onto" [ "front" "of" <IsFront=true> | "back" "of" <IsFront=false> ] <Target:Expression>
6363
begin
64-
MCListExecPushSingleElementOnto(Value, isFront, Target)
64+
MCListExecPushSingleElementOnto(Value, IsFront, Target)
6565
end syntax
6666

6767
/*

libscript/src/logic.mlc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ output: If the operand expression evaluates to true, the value of the expres
4646
Otherwise, the value of the expression is true.
4747
*/
4848

49-
syntax LogicNot is prefix operator of precedence 1
49+
syntax LogicNot is prefix operator with precedence 1
5050
"not" <Operand: Expression>
5151
begin
52-
EvalNot(Operand, output)
52+
MCLogicEvalNot(Operand, output)
5353
end syntax
5454

5555
--

libscript/src/math.mlc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Right: An expression that evaluates to a number.
5959
output: The result of raising <Left> to the power <Right>.
6060
*/
6161

62-
syntax ExpOperator is left binary operator with precedence 2
62+
syntax PowOperator is left binary operator with precedence 2
6363
<Left: Expression> "^" <Right: Expression>
6464
begin
6565
EvalIntegerToPowerOfInteger(Left, Right, output)
@@ -122,9 +122,9 @@ Operand: An expression that evaluates to a number.
122122
syntax Base10LogOperator is prefix operator with precedence 1
123123
"the" "log" "of" <Operand: Expression>
124124
begin
125-
EvalLogInteger(Operand, output)
126-
EvalLogReal(Operand, output)
127-
EvalLogNumber(Operand, output)
125+
EvalBase10LogInteger(Operand, output)
126+
EvalBase10LogReal(Operand, output)
127+
EvalBase10LogNumber(Operand, output)
128128
end syntax
129129

130130
--

libscript/src/segmentchunk.mlc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,39 @@ foreign handler EvalOffsetOfSegmentIn(in Needle as string, in Target as string,
1414

1515
--
1616

17-
syntax SingletonSegmentOf is left unary operator with precedence 1
17+
syntax SingletonSegmentOf is prefix operator with precedence 1
1818
"segment" <Index: Expression> "of" <Target: Expression>
1919
begin
2020
FetchSegmentOf(Index, Target, output)
2121
StoreSegmentOf(input, Index, Target)
2222
end syntax
2323

24-
syntax RangeSegmentOf is left unary operator with precedence 1
24+
syntax RangeSegmentOf is prefix operator with precedence 1
2525
"segment" <Start: Expression> "to" <Finish: Expression> "of" <Target: Expression>
2626
begin
2727
FetchSegmentRangeOf(Start, Finish, Target, output)
2828
StoreSegmentRangeOf(input, Start, Finish, Target)
2929
end syntax
3030

31-
syntax CountSegmentsOf is left unary operator with precedence 1
31+
syntax CountSegmentsOf is prefix operator with precedence 1
3232
"the" "number" "of" "segments" "in" <Target: Expression>
3333
begin
3434
EvalNumberOfSegmentsIn(Target, output)
3535
end syntax
3636

37-
syntax AmongSegmentsOf is left unary operator with precedence 1
37+
syntax AmongSegmentsOf is left binary operator with precedence 1
3838
<Needle: Expression> "is" "among" "the" "segments" "of" <Target: Expression>
3939
begin
4040
EvalIsAmongTheSegmentsOf(Needle, Target, output)
4141
end syntax
4242

43-
syntax NotAmongSegmentsOf is left unary operator with precedence 1
43+
syntax NotAmongSegmentsOf is left binary operator with precedence 1
4444
<Needle: Expression> "is" "not" "among" "the" "segments" "of" <Target: Expression>
4545
begin
4646
EvalIsNotAmongTheSegmentsOf(Needle, Target, output)
4747
end syntax
4848

49-
syntax SegmentOffset is left unary operator with precedence 1
49+
syntax SegmentOffset is prefix operator with precedence 1
5050
"the" "offset" "of" "segment" <Needle: Expression> "in" <Target: Expression>
5151
begin
5252
EvalOffsetOfSegmentIn(Needle, Target, output)

0 commit comments

Comments
 (0)