Skip to content

Commit d69ec71

Browse files
author
runrevali
committed
[[ StdMlc ]] Various tweaks to docs for mlc
1 parent 525e8ad commit d69ec71

File tree

6 files changed

+29
-39
lines changed

6 files changed

+29
-39
lines changed

libscript/src/arithmetic.mlc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ begin
407407
end syntax
408408

409409
syntax IsNot is neutral binary operator with precedence 5
410-
<Left: Expression> "is" "not" <Right: Expression>
410+
<Left: Expression> "is not" <Right: Expression>
411411
begin
412412
MCArithmeticEvalNotEqualToInteger(Left, Right, output)
413413
MCArithmeticEvalNotEqualToReal(Left, Right, output)

libscript/src/logic.mlc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ output: If the left hand expression evaluates to false, the value of the exp
1616
Note that the right hand expression is only evaluated if the left hand expression is true.
1717
*/
1818

19-
//syntax LogicOr is left binary operator of precedence 2
19+
//syntax LogicOr is left binary operator of precedence 4
2020
// <Left: Expression> "or" <Right: Expression>
2121
//begin
2222
// EvalOr(Left, Right, output)
@@ -32,7 +32,7 @@ output: If the left hand expression evaluates to true, the value of the expr
3232
Note that the right hand expression is only evaluated if the left hand expression is false.
3333
*/
3434

35-
//syntax LogicAnd is left binary operator of precedence 1
35+
//syntax LogicAnd is left binary operator of precedence 3
3636
// <Left: Expression> "and" <Right: Expression>
3737
//begin
3838
// EvalAnd(Left, Right, output)
@@ -46,7 +46,7 @@ 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 with precedence 1
49+
syntax LogicNot is prefix operator with precedence 3
5050
"not" <Operand: Expression>
5151
begin
5252
MCLogicEvalNot(Operand, output)

libscript/src/map.mlc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module com.livecode.map
1+
//module com.livecode.map
22

33
public foreign handler EvalKeysOf(in Target as array, out Value as list) as undefined binds to "<builtin>"
44
public foreign handler EvalElementsOf(in Target as array, out Value as list) as undefined binds to "<builtin>"

libscript/src/module-type.cpp

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,45 +40,32 @@ void MCTypeEvalIntAsReal(integer_t p_target, real64_t r_output)
4040
r_output = p_target;
4141
}
4242

43-
void MCTypeEvalIsEmpty(MCValueRef p_target, bool& r_output)
43+
extern "C" void MCTypeEvalIsEmpty(MCValueRef p_target, bool& r_output)
4444
{
45-
//r_output = MCValueIsEmpty(p_target);
45+
//r_output = p_target != kMCNull && MCValueIsEmpty(p_target);
4646
}
4747

48-
void MCTypeEvalIsNotEmpty(MCValueRef p_target, bool& r_output)
48+
extern "C" void MCTypeEvalIsNotEmpty(MCValueRef p_target, bool& r_output)
4949
{
5050
bool t_empty;
5151
MCTypeEvalIsEmpty(p_target, t_empty);
5252

5353
r_output = !t_empty;
5454
}
5555

56-
void MCTypeEvalIsDefined(MCValueRef p_target, bool& r_output)
56+
extern "C" void MCTypeEvalIsDefined(MCValueRef p_target, bool& r_output)
5757
{
5858
r_output = p_target == kMCNull;
5959
}
6060

61-
void MCTypeEvalIsNotDefined(MCValueRef p_target, bool p_is_not, bool& r_output)
61+
extern "C" void MCTypeEvalIsNotDefined(MCValueRef p_target, bool p_is_not, bool& r_output)
6262
{
6363
bool t_defined;
6464
MCTypeEvalIsDefined(p_target, t_defined);
6565

6666
r_output = !t_defined;
6767
}
6868

69-
void MCTypeEvalIsEqual(MCValueRef p_left, MCValueRef p_right, bool& r_output)
70-
{
71-
r_output = MCValueIsEqualTo(p_left, p_right);
72-
}
73-
74-
void MCTypeEvalIsNotEqual(MCValueRef p_left, MCValueRef p_right, bool& r_output)
75-
{
76-
bool t_equal;
77-
MCTypeEvalIsEqual(p_left, p_right, t_equal);
78-
79-
r_output = !t_equal;
80-
}
81-
8269
////////////////////////////////////////////////////////////////////////////////////////////////////
8370

8471
#ifdef _TEST

libscript/src/string.mlc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ The ```is not``` operator is case sensitive.
201201
*/
202202

203203
syntax IsNotEqualTo is neutral binary operator with precedence 1
204-
<Left: Expression> "is" "not" <Right: Expression>
204+
<Left: Expression> "is not" <Right: Expression>
205205
begin
206206
MCStringEvalIsNotEqualTo(Left, Right, output)
207207
end syntax

libscript/src/type.mlc

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ public foreign handler EvalStringAsBool(in Target as string, out Value as bool)
1212
public foreign handler EvalStringAsReal(in Target as string, out Value as real) as undefined binds to "<builtin>"
1313
public foreign handler EvalStringAsInt(in Target as string, out Value as int) as undefined binds to "<builtin>"
1414

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>"
1919

2020
--
2121

@@ -28,13 +28,15 @@ output: The converted value if there is a valid conversion from the type of
2828
Example: put true as string into tVar // tVar contains the string "true"
2929
*/
3030

31+
/*
3132
syntax AsString is postfix operator with precedence 1
3233
<Target: Expression> "as" "string"
3334
begin
3435
EvalBoolAsString(Target, output)
3536
EvalIntAsString(Target, output)
3637
EvalRealAsString(Target, output)
3738
end syntax
39+
*/
3840

3941
/*
4042
Summary: Converts <Target> to a real.
@@ -46,14 +48,14 @@ output: The converted value if there is a valid conversion from the type of
4648

4749
Example: put "8.0" as real into tVar // tVar contains the real number 8.0
4850
*/
49-
51+
/*
5052
syntax AsReal is postfix operator with precedence 1
5153
<Target: Expression> "as" "real"
5254
begin
5355
EvalIntAsReal(Target, output)
5456
EvalStringAsReal(Target, output)
5557
end syntax
56-
58+
*/
5759
/*
5860
Summary: Converts <Target> to an integer.
5961

@@ -62,12 +64,13 @@ output: The converted value if there is a valid conversion the string <Targe
6264
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.
6365
Example: put "8" as integer into tVar // tVar contains the integer 8
6466
*/
65-
67+
/*
6668
syntax AsInt is postfix operator with precedence 1
6769
<Target: Expression> "as" "int"
6870
begin
6971
EvalStringAsInt(Target, output)
7072
end syntax
73+
*/
7174

7275
/*
7376
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
7780

7881
Example: put "true" as bool into tVar // tVar contains the boolean value true
7982
*/
80-
83+
/*
8184
syntax AsBool is postfix operator with precedence 1
8285
<Target: Expression> "as" "bool"
8386
begin
8487
EvalStringAsBool(Target, output)
8588
end syntax
86-
89+
*/
8790
--
8891

8992
/*
@@ -97,7 +100,7 @@ output: Returns true if the given expression <Target> evaluates to the empty
97100
syntax IsEmpty is postfix operator with precedence 1
98101
<Target: Expression> "is" "empty"
99102
begin
100-
EvalIsEmpty(Target, output)
103+
MCTypeEvalIsEmpty(Target, output)
101104
end syntax
102105

103106
/*
@@ -109,9 +112,9 @@ output: Returns false if the given expression <Target> evaluates to the empt
109112
*/
110113

111114
syntax IsNotEmpty is postfix operator with precedence 1
112-
<Target: Expression> "is" "not" "empty"
115+
<Target: Expression> "is not" "empty"
113116
begin
114-
EvalIsNotEmpty(Target, output)
117+
MCTypeEvalIsNotEmpty(Target, output)
115118
end syntax
116119

117120
--
@@ -127,7 +130,7 @@ output: Returns true if the given expression <Target> is defined, and false
127130
syntax IsDefined is postfix operator with precedence 1
128131
<Target: Expression> "is" "defined"
129132
begin
130-
EvalIsDefined(Target, output)
133+
MCTypeEvalIsDefined(Target, output)
131134
end syntax
132135

133136
/*
@@ -139,9 +142,9 @@ output: Returns false if the given expression <Target> is defined, and true
139142
*/
140143

141144
syntax IsNotDefined is postfix operator with precedence 1
142-
<Target: Expression> "is" "not" "defined"
145+
<Target: Expression> "is not" "defined"
143146
begin
144-
EvalIsNotDefined(Target, output)
147+
MCTypeEvalIsNotDefined(Target, output)
145148
end syntax
146149

147150
--

0 commit comments

Comments
 (0)