Skip to content

Commit 73870e7

Browse files
author
runrevali
committed
[[ LiveCode Builder ]] Tweak precedence values
1 parent a4e2582 commit 73870e7

File tree

9 files changed

+61
-46
lines changed

9 files changed

+61
-46
lines changed

engine/src/canvas.mlc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Example:
8080
Tags: Canvas
8181
*/
8282

83-
syntax RectangleMake is prefix operator with precedence 4
83+
syntax RectangleMake is prefix operator with precedence 2
8484
"rectangle" <mRect: Expression>
8585
begin
8686
MCCanvasRectangleMakeWithList(mRect, output)
@@ -105,14 +105,14 @@ Example:
105105
Tags: Canvas
106106
*/
107107

108-
syntax RectanglePropertyLeft is prefix operator with precedence 4
108+
syntax RectanglePropertyLeft is prefix operator with precedence 2
109109
"the" "left" "of" <mRect:Expression>
110110
begin
111111
MCCanvasRectangleGetLeft(mRect, output)
112112
MCCanvasRectangleSetLeft(input, mRect)
113113
end syntax
114114

115-
syntax RectanglePropertyX is prefix operator with precedence 4
115+
syntax RectanglePropertyX is prefix operator with precedence 2
116116
"the" "x" "of" <mRect:Expression>
117117
begin
118118
MCCanvasRectangleGetLeft(mRect, output)
@@ -138,14 +138,14 @@ Example:
138138
Tags: Canvas
139139
*/
140140

141-
syntax RectanglePropertyTop is prefix operator with precedence 4
141+
syntax RectanglePropertyTop is prefix operator with precedence 2
142142
"the" "top" "of" <mRect:Expression>
143143
begin
144144
MCCanvasRectangleGetTop(mRect, output)
145145
MCCanvasRectangleSetTop(input, mRect)
146146
end syntax
147147

148-
syntax RectanglePropertyY is prefix operator with precedence 4
148+
syntax RectanglePropertyY is prefix operator with precedence 2
149149
"the" "y" "of" <mRect:Expression>
150150
begin
151151
MCCanvasRectangleGetTop(mRect, output)
@@ -171,7 +171,7 @@ Example:
171171
Tags: Canvas
172172
*/
173173

174-
syntax RectanglePropertyRight is prefix operator with precedence 4
174+
syntax RectanglePropertyRight is prefix operator with precedence 2
175175
"the" "right" "of" <mRect:Expression>
176176
begin
177177
MCCanvasRectangleGetRight(mRect, output)
@@ -197,7 +197,7 @@ Example:
197197
Tags: Canvas
198198
*/
199199

200-
syntax RectanglePropertyBottom is prefix operator with precedence 4
200+
syntax RectanglePropertyBottom is prefix operator with precedence 2
201201
"the" "bottom" "of" <mRect:Expression>
202202
begin
203203
MCCanvasRectangleGetBottom(mRect, output)
@@ -223,7 +223,7 @@ Example:
223223
Tags: Canvas
224224
*/
225225

226-
syntax RectanglePropertyWidth is prefix operator with precedence 4
226+
syntax RectanglePropertyWidth is prefix operator with precedence 2
227227
"the" "width" "of" <mRect:Expression>
228228
begin
229229
MCCanvasRectangleGetWidth(mRect, output)
@@ -249,7 +249,7 @@ Example:
249249
Tags: Canvas
250250
*/
251251

252-
syntax RectanglePropertyHeight is prefix operator with precedence 4
252+
syntax RectanglePropertyHeight is prefix operator with precedence 2
253253
"the" "height" "of" <mRect:Expression>
254254
begin
255255
MCCanvasRectangleGetHeight(mRect, output)
@@ -282,7 +282,7 @@ Example:
282282
Tags: Canvas
283283
*/
284284

285-
syntax PointMake is prefix operator with precedence 4
285+
syntax PointMake is prefix operator with precedence 2
286286
"point" <mPoint: Expression>
287287
begin
288288
MCCanvasPointMakeWithList(mPoint, output)
@@ -304,7 +304,7 @@ Example:
304304
Tags: Canvas
305305
*/
306306

307-
syntax PointPropertyX is prefix operator with precedence 4
307+
syntax PointPropertyX is prefix operator with precedence 2
308308
"the" "x" "of" <mPoint: Expression>
309309
begin
310310
MCCanvasPointGetX(mPoint, output)
@@ -327,7 +327,7 @@ Example:
327327
Tags: Canvas
328328
*/
329329

330-
syntax PointPropertyY is prefix operator with precedence 4
330+
syntax PointPropertyY is prefix operator with precedence 2
331331
"the" "y" "of" <mPoint: Expression>
332332
begin
333333
MCCanvasPointGetY(mPoint, output)
@@ -1451,13 +1451,13 @@ public foreign handler MCCanvasImageGetHeight(in pImage as Image, out rHeight as
14511451
public foreign handler MCCanvasImageGetPixels(in pImage as Image, out rPixels as data) as undefined binds to "<builtin>"
14521452
// TODO - add image frame index property?
14531453

1454-
syntax ImageWidthProperty is prefix operator with precedence 4
1454+
syntax ImageWidthProperty is prefix operator with precedence 2
14551455
"the" "width" "of" <mImage: Expression>
14561456
begin
14571457
MCCanvasImageGetWidth(mImage, output)
14581458
end syntax
14591459

1460-
syntax ImageHeightProperty is prefix operator with precedence 4
1460+
syntax ImageHeightProperty is prefix operator with precedence 2
14611461
"the" "height" "of" <mImage: Expression>
14621462
begin
14631463
MCCanvasImageGetHeight(mImage, output)

libscript/src/arithmetic.mlc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ Example:
227227
Tags: Math
228228
*/
229229

230-
syntax PlusOperator is left binary operator with precedence 2
230+
syntax PlusOperator is left binary operator with precedence 4
231231
<Left: Expression> "+" <Right: Expression>
232232
begin
233233
MCArithmeticEvalNumberPlusNumber(Left, Right, output)
@@ -247,7 +247,7 @@ Example:
247247
Tags: Math
248248
*/
249249

250-
syntax MinusOperator is left binary operator with precedence 2
250+
syntax MinusOperator is left binary operator with precedence 4
251251
<Left: Expression> "-" <Right: Expression>
252252
begin
253253
MCArithmeticEvalNumberMinusNumber(Left, Right, output)
@@ -268,7 +268,7 @@ Tags: Math
268268

269269
*/
270270

271-
syntax TimesOperator is left binary operator with precedence 1
271+
syntax TimesOperator is left binary operator with precedence 3
272272
<Left: Expression> "*" <Right: Expression>
273273
begin
274274
MCArithmeticEvalNumberTimesNumber(Left, Right, output)
@@ -288,7 +288,7 @@ Example:
288288
Tags: Math
289289
*/
290290

291-
syntax OverOperator is left binary operator with precedence 1
291+
syntax OverOperator is left binary operator with precedence 3
292292
<Left: Expression> "/" <Right: Expression>
293293
begin
294294
MCArithmeticEvalNumberOverNumber(Left, Right, output)
@@ -312,7 +312,7 @@ Returns the remainder on dividing <Left> by <Right>
312312

313313
*/
314314

315-
syntax ModOperator is neutral binary operator with precedence 4
315+
syntax ModOperator is neutral binary operator with precedence 3
316316
<Left: Expression> "mod" <Right: Expression>
317317
begin
318318
MCArithmeticEvalNumberModNumber(Left, Right, output)
@@ -340,7 +340,7 @@ successive values of x wrap y cycle through the sequence 1, 2, ..., y.
340340

341341
*/
342342

343-
syntax WrapOperator is neutral binary operator with precedence 4
343+
syntax WrapOperator is neutral binary operator with precedence 3
344344
<Left: Expression> "wrap" <Right: Expression>
345345
begin
346346
MCArithmeticEvalNumberWrapNumber(Left, Right, output)
@@ -356,7 +356,7 @@ Right: An expression that evaluates to a number.
356356
Returns: True if <Left> is greater than <Right>, and false otherwise.
357357
*/
358358

359-
syntax NumberIsGreaterThanNumber is neutral binary operator with precedence 3
359+
syntax NumberIsGreaterThanNumber is neutral binary operator with precedence 5
360360
<Left: Expression> ">" <Right: Expression>
361361
begin
362362
MCArithmeticEvalNumberIsGreaterThanNumber(Left, Right, output)
@@ -370,7 +370,7 @@ Right: An expression that evaluates to a number.
370370
Returns: True if <Left> is greater than or equal to <Right>, and false otherwise.
371371
*/
372372

373-
syntax NumberIsGreaterThanOrEqualToNumber is neutral binary operator with precedence 3
373+
syntax NumberIsGreaterThanOrEqualToNumber is neutral binary operator with precedence 5
374374
<Left: Expression> ">=" <Right: Expression>
375375
begin
376376
MCArithmeticEvalNumberIsGreaterThanOrEqualToNumber(Left, Right, output)
@@ -388,7 +388,7 @@ Description:
388388
Tags: Math
389389
*/
390390

391-
syntax NumberIsLessThanNumber is neutral binary operator with precedence 3
391+
syntax NumberIsLessThanNumber is neutral binary operator with precedence 5
392392
<Left: Expression> "<" <Right: Expression>
393393
begin
394394
MCArithmeticEvalNumberIsLessThanNumber(Left, Right, output)
@@ -407,7 +407,7 @@ Tags: Math
407407
*/
408408

409409

410-
syntax NumberIsLessThanOrEqualToNumber is neutral binary operator with precedence 3
410+
syntax NumberIsLessThanOrEqualToNumber is neutral binary operator with precedence 5
411411
<Left: Expression> "<=" <Right: Expression>
412412
begin
413413
MCArithmeticEvalNumberIsLessThanOrEqualToNumber(Left, Right, output)
@@ -427,7 +427,7 @@ Description:
427427
Tags: Math
428428
*/
429429

430-
syntax NumberIsEqualToNumber is neutral binary operator with precedence 4
430+
syntax NumberIsEqualToNumber is neutral binary operator with precedence 6
431431
<Left: Expression> "=" <Right: Expression>
432432
begin
433433
MCArithmeticEvalEqualToNumber(Left, Right, output)
@@ -448,7 +448,7 @@ References: NumberIsEqualToNumber (operator)
448448
Tags: Math
449449
*/
450450

451-
syntax NumberIsNumber is neutral binary operator with precedence 5
451+
syntax NumberIsNumber is neutral binary operator with precedence 7
452452
<Left: Expression> "is" <Right: Expression>
453453
begin
454454
MCArithmeticEvalEqualToNumber(Left, Right, output)
@@ -470,7 +470,7 @@ Tags: Math
470470
*/
471471

472472

473-
syntax NumberIsNotNumber is neutral binary operator with precedence 5
473+
syntax NumberIsNotNumber is neutral binary operator with precedence 7
474474
<Left: Expression> "is not" <Right: Expression>
475475
begin
476476
MCArithmeticEvalNotEqualToNumber(Left, Right, output)

libscript/src/binary.mlc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Performs a byte by byte comparison of <Left> and <Right>, returning false if the
9595
Tags: Binary
9696
*/
9797

98-
syntax DataIsData is neutral binary operator with precedence 5
98+
syntax DataIsData is neutral binary operator with precedence 7
9999
<Left: Expression> "is" <Right: Expression>
100100
begin
101101
MCBinaryEvalIsEqualTo(Left, Right, output)
@@ -115,7 +115,7 @@ Performs a byte by byte comparison of <Left> and <Right>, returning true if ther
115115
Tags: Binary
116116
*/
117117

118-
syntax DataIsNotData is neutral binary operator with precedence 5
118+
syntax DataIsNotData is neutral binary operator with precedence 7
119119
<Left: Expression> "is not" <Right: Expression>
120120
begin
121121
MCBinaryEvalIsNotEqualTo(Left, Right, output)
@@ -136,7 +136,7 @@ Description:
136136
Tags: Binary
137137
*/
138138

139-
syntax DataIsLessThanData is neutral binary operator with precedence 3
139+
syntax DataIsLessThanData is neutral binary operator with precedence 5
140140
<Left: Expression> "<" <Right: Expression>
141141
begin
142142
MCBinaryEvalIsLessThan(Left, Right, output)
@@ -157,7 +157,7 @@ Description:
157157
Tags: Binary
158158
*/
159159

160-
syntax DataIsGreaterThanData is neutral binary operator with precedence 3
160+
syntax DataIsGreaterThanData is neutral binary operator with precedence 5
161161
<Left: Expression> ">" <Right: Expression>
162162
begin
163163
MCBinaryEvalIsGreaterThan(Left, Right, output)

libscript/src/list.mlc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ In particular, this means that comparison between string elements is case sensit
350350
Tags: Lists
351351
*/
352352

353-
syntax ListIsList is neutral binary operator with precedence 5
353+
syntax ListIsList is neutral binary operator with precedence 7
354354
<Left: Expression> "is" <Right: Expression>
355355
begin
356356
MCListEvalIsEqualTo(Left, Right, output)
@@ -379,7 +379,7 @@ In particular, this means that comparison between string elements is case sensit
379379
Tags: Lists
380380
*/
381381

382-
syntax ListIsNotList is neutral binary operator with precedence 5
382+
syntax ListIsNotList is neutral binary operator with precedence 7
383383
<Left: Expression> "is not" <Right: Expression>
384384
begin
385385
MCListEvalIsNotEqualTo(Left, Right, output)

libscript/src/logic.mlc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Tags: Logic
6565

6666
*/
6767

68-
syntax LogicNot is prefix operator with precedence 3
68+
syntax LogicNot is prefix operator with precedence 6
6969
"not" <Operand: Expression>
7070
begin
7171
MCLogicEvalNot(Operand, output)
@@ -89,7 +89,7 @@ Example:
8989
Tags: Logic
9090
*/
9191

92-
syntax BooleanIsEqualToBoolean is neutral binary operator with precedence 5
92+
syntax BooleanIsEqualToBoolean is neutral binary operator with precedence 7
9393
<Left: Expression> "is" <Right: Expression>
9494
begin
9595
MCLogicEvalIsEqualTo(Left, Right, output)
@@ -111,7 +111,7 @@ Example:
111111
Tags: Logic
112112
*/
113113

114-
syntax BooleanIsNotEqualToBoolean is neutral binary operator with precedence 5
114+
syntax BooleanIsNotEqualToBoolean is neutral binary operator with precedence 7
115115
<Left: Expression> "is not" <Right: Expression>
116116
begin
117117
MCLogicEvalIsNotEqualTo(Left, Right, output)

libscript/src/math.mlc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Example:
6262
Tags: Math
6363
*/
6464

65-
syntax PowOperator is left binary operator with precedence 2
65+
syntax PowOperator is left binary operator with precedence 1
6666
<Left: Expression> "^" <Right: Expression>
6767
begin
6868
MCMathEvalNumberToPowerOfNumber(Left, Right, output)
@@ -260,7 +260,7 @@ Returns: The value of <Left>, if it is less than the value of <Right>, and the
260260
Tags: Math
261261
*/
262262

263-
syntax MinOperator is prefix operator with precedence 1
263+
syntax MinOperator is prefix operator with precedence 5
264264
"the" "min" "of" <Left: Expression> "and" <Right: Expression>
265265
begin
266266
MCMathEvalMinNumber(Left, Right, output)
@@ -276,7 +276,7 @@ Returns: The value of <Left>, if it is greater than the value of <Right>, and t
276276
Tags: Math
277277
*/
278278

279-
syntax MaxOperator is prefix operator with precedence 1
279+
syntax MaxOperator is prefix operator with precedence 5
280280
"the" "max" "of" <Left: Expression> "and" <Right: Expression>
281281
begin
282282
MCMathEvalMaxNumber(Left, Right, output)

libscript/src/module-type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extern "C" MC_DLLEXPORT void MCTypeEvalIsNotEmpty(MCValueRef p_target, bool& r_o
2828

2929
extern "C" MC_DLLEXPORT void MCTypeEvalIsDefined(MCValueRef *p_target, bool& r_output)
3030
{
31-
r_output = p_target != nil;
31+
r_output = (p_target != nil && *p_target != kMCNull);
3232
}
3333

3434
extern "C" MC_DLLEXPORT void MCTypeEvalIsNotDefined(MCValueRef *p_target, bool& r_output)

libscript/src/string.mlc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ The ```is``` operator is case sensitive.
219219
Tags: Strings
220220
*/
221221

222-
syntax StringIsString is neutral binary operator with precedence 5
222+
syntax StringIsString is neutral binary operator with precedence 7
223223
<Left: Expression> "is" <Right: Expression>
224224
begin
225225
MCStringEvalIsEqualTo(Left, Right, output)
@@ -240,7 +240,7 @@ The ```is not``` operator is case sensitive.
240240
Tags: Strings
241241
*/
242242

243-
syntax StringIsNotString is neutral binary operator with precedence 5
243+
syntax StringIsNotString is neutral binary operator with precedence 7
244244
<Left: Expression> "is not" <Right: Expression>
245245
begin
246246
MCStringEvalIsNotEqualTo(Left, Right, output)
@@ -261,7 +261,7 @@ Description:
261261
Tags: Strings
262262
*/
263263

264-
syntax StringIsLessThanString is neutral binary operator with precedence 3
264+
syntax StringIsLessThanString is neutral binary operator with precedence 5
265265
<Left: Expression> "<" <Right: Expression>
266266
begin
267267
MCStringEvalIsLessThan(Left, Right, output)
@@ -281,7 +281,7 @@ Description:
281281
Tags: Strings
282282
*/
283283

284-
syntax StringIsGreaterThanString is neutral binary operator with precedence 3
284+
syntax StringIsGreaterThanString is neutral binary operator with precedence 5
285285
<Left: Expression> ">" <Right: Expression>
286286
begin
287287
MCStringEvalIsGreaterThan(Left, Right, output)

0 commit comments

Comments
 (0)