Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
MythicCraft
MEG MoLang Extension
Commits
555dc5dd
Commit
555dc5dd
authored
2 years ago
by
Ticxo
Browse files
Options
Download
Email Patches
Plain Diff
Directly move everything to this repo
parent
2ff9eb39
Changes
93
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
486 additions
and
0 deletions
+486
-0
src/main/java/com/bedrockk/molang/ast/ReturnExpression.java
src/main/java/com/bedrockk/molang/ast/ReturnExpression.java
+21
-0
src/main/java/com/bedrockk/molang/ast/StatementExpression.java
...ain/java/com/bedrockk/molang/ast/StatementExpression.java
+29
-0
src/main/java/com/bedrockk/molang/ast/StringExpression.java
src/main/java/com/bedrockk/molang/ast/StringExpression.java
+19
-0
src/main/java/com/bedrockk/molang/ast/TernaryExpression.java
src/main/java/com/bedrockk/molang/ast/TernaryExpression.java
+27
-0
src/main/java/com/bedrockk/molang/ast/ThisExpression.java
src/main/java/com/bedrockk/molang/ast/ThisExpression.java
+16
-0
src/main/java/com/bedrockk/molang/ast/UnaryMinusExpression.java
...in/java/com/bedrockk/molang/ast/UnaryMinusExpression.java
+19
-0
src/main/java/com/bedrockk/molang/ast/UnaryPlusExpression.java
...ain/java/com/bedrockk/molang/ast/UnaryPlusExpression.java
+19
-0
src/main/java/com/bedrockk/molang/ast/binaryop/ArrowExpression.java
...ava/com/bedrockk/molang/ast/binaryop/ArrowExpression.java
+29
-0
src/main/java/com/bedrockk/molang/ast/binaryop/BooleanAndExpression.java
...om/bedrockk/molang/ast/binaryop/BooleanAndExpression.java
+25
-0
src/main/java/com/bedrockk/molang/ast/binaryop/BooleanOrExpression.java
...com/bedrockk/molang/ast/binaryop/BooleanOrExpression.java
+25
-0
src/main/java/com/bedrockk/molang/ast/binaryop/CoalesceExpression.java
.../com/bedrockk/molang/ast/binaryop/CoalesceExpression.java
+32
-0
src/main/java/com/bedrockk/molang/ast/binaryop/DivideExpression.java
...va/com/bedrockk/molang/ast/binaryop/DivideExpression.java
+25
-0
src/main/java/com/bedrockk/molang/ast/binaryop/EqualExpression.java
...ava/com/bedrockk/molang/ast/binaryop/EqualExpression.java
+25
-0
src/main/java/com/bedrockk/molang/ast/binaryop/GreaterExpression.java
...a/com/bedrockk/molang/ast/binaryop/GreaterExpression.java
+25
-0
src/main/java/com/bedrockk/molang/ast/binaryop/GreaterOrEqualExpression.java
...edrockk/molang/ast/binaryop/GreaterOrEqualExpression.java
+25
-0
src/main/java/com/bedrockk/molang/ast/binaryop/MinusExpression.java
...ava/com/bedrockk/molang/ast/binaryop/MinusExpression.java
+25
-0
src/main/java/com/bedrockk/molang/ast/binaryop/NotEqualExpression.java
.../com/bedrockk/molang/ast/binaryop/NotEqualExpression.java
+25
-0
src/main/java/com/bedrockk/molang/ast/binaryop/PlusExpression.java
...java/com/bedrockk/molang/ast/binaryop/PlusExpression.java
+25
-0
src/main/java/com/bedrockk/molang/ast/binaryop/PowExpression.java
.../java/com/bedrockk/molang/ast/binaryop/PowExpression.java
+25
-0
src/main/java/com/bedrockk/molang/ast/binaryop/SmallerExpression.java
...a/com/bedrockk/molang/ast/binaryop/SmallerExpression.java
+25
-0
No files found.
src/main/java/com/bedrockk/molang/ast/ReturnExpression.java
0 → 100644
View file @
555dc5dd
package
com.bedrockk.molang.ast
;
import
com.bedrockk.molang.Expression
;
import
com.bedrockk.molang.runtime.MoLangEnvironment
;
import
com.bedrockk.molang.runtime.MoScope
;
import
com.bedrockk.molang.runtime.value.MoValue
;
import
lombok.Value
;
@Value
public
class
ReturnExpression
implements
Expression
{
Expression
expression
;
@Override
public
MoValue
evaluate
(
MoScope
scope
,
MoLangEnvironment
environment
)
{
MoValue
eval
=
expression
.
evaluate
(
scope
,
environment
);
scope
.
setReturnValue
(
eval
);
return
eval
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/bedrockk/molang/ast/StatementExpression.java
0 → 100644
View file @
555dc5dd
package
com.bedrockk.molang.ast
;
import
com.bedrockk.molang.Expression
;
import
com.bedrockk.molang.runtime.MoLangEnvironment
;
import
com.bedrockk.molang.runtime.MoScope
;
import
com.bedrockk.molang.runtime.value.DoubleValue
;
import
com.bedrockk.molang.runtime.value.MoValue
;
import
lombok.Value
;
@Value
public
class
StatementExpression
implements
Expression
{
Expression
[]
expressions
;
@Override
public
MoValue
evaluate
(
MoScope
scope
,
MoLangEnvironment
environment
)
{
for
(
Expression
expression
:
expressions
)
{
expression
.
evaluate
(
scope
,
environment
);
if
(
scope
.
getReturnValue
()
!=
null
)
{
return
scope
.
getReturnValue
();
}
else
if
(
scope
.
isBreak
()
||
scope
.
isContinue
())
{
break
;
}
}
return
DoubleValue
.
ZERO
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/bedrockk/molang/ast/StringExpression.java
0 → 100644
View file @
555dc5dd
package
com.bedrockk.molang.ast
;
import
com.bedrockk.molang.Expression
;
import
com.bedrockk.molang.runtime.MoLangEnvironment
;
import
com.bedrockk.molang.runtime.MoScope
;
import
com.bedrockk.molang.runtime.value.MoValue
;
import
com.bedrockk.molang.runtime.value.StringValue
;
import
lombok.Value
;
@Value
public
class
StringExpression
implements
Expression
{
String
string
;
@Override
public
MoValue
evaluate
(
MoScope
scope
,
MoLangEnvironment
environment
)
{
return
new
StringValue
(
string
);
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/bedrockk/molang/ast/TernaryExpression.java
0 → 100644
View file @
555dc5dd
package
com.bedrockk.molang.ast
;
import
com.bedrockk.molang.Expression
;
import
com.bedrockk.molang.runtime.MoLangEnvironment
;
import
com.bedrockk.molang.runtime.MoScope
;
import
com.bedrockk.molang.runtime.value.DoubleValue
;
import
com.bedrockk.molang.runtime.value.MoValue
;
import
lombok.Value
;
@Value
public
class
TernaryExpression
implements
Expression
{
Expression
condition
;
Expression
thenExpr
;
Expression
elseExpr
;
@Override
public
MoValue
evaluate
(
MoScope
scope
,
MoLangEnvironment
environment
)
{
if
(
condition
.
evaluate
(
scope
,
environment
).
equals
(
DoubleValue
.
ONE
))
{
return
thenExpr
==
null
?
condition
.
evaluate
(
scope
,
environment
)
:
thenExpr
.
evaluate
(
scope
,
environment
);
}
else
if
(
elseExpr
!=
null
)
{
return
elseExpr
.
evaluate
(
scope
,
environment
);
}
return
DoubleValue
.
ZERO
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/bedrockk/molang/ast/ThisExpression.java
0 → 100644
View file @
555dc5dd
package
com.bedrockk.molang.ast
;
import
com.bedrockk.molang.Expression
;
import
com.bedrockk.molang.runtime.MoLangEnvironment
;
import
com.bedrockk.molang.runtime.MoScope
;
import
com.bedrockk.molang.runtime.value.MoValue
;
import
lombok.Value
;
@Value
public
class
ThisExpression
implements
Expression
{
@Override
public
MoValue
evaluate
(
MoScope
scope
,
MoLangEnvironment
environment
)
{
return
environment
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/bedrockk/molang/ast/UnaryMinusExpression.java
0 → 100644
View file @
555dc5dd
package
com.bedrockk.molang.ast
;
import
com.bedrockk.molang.Expression
;
import
com.bedrockk.molang.runtime.MoLangEnvironment
;
import
com.bedrockk.molang.runtime.MoScope
;
import
com.bedrockk.molang.runtime.value.DoubleValue
;
import
com.bedrockk.molang.runtime.value.MoValue
;
import
lombok.Value
;
@Value
public
class
UnaryMinusExpression
implements
Expression
{
Expression
expression
;
@Override
public
MoValue
evaluate
(
MoScope
scope
,
MoLangEnvironment
environment
)
{
return
new
DoubleValue
(-
expression
.
evaluate
(
scope
,
environment
).
asDouble
());
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/bedrockk/molang/ast/UnaryPlusExpression.java
0 → 100644
View file @
555dc5dd
package
com.bedrockk.molang.ast
;
import
com.bedrockk.molang.Expression
;
import
com.bedrockk.molang.runtime.MoLangEnvironment
;
import
com.bedrockk.molang.runtime.MoScope
;
import
com.bedrockk.molang.runtime.value.DoubleValue
;
import
com.bedrockk.molang.runtime.value.MoValue
;
import
lombok.Value
;
@Value
public
class
UnaryPlusExpression
implements
Expression
{
Expression
expression
;
@Override
public
MoValue
evaluate
(
MoScope
scope
,
MoLangEnvironment
environment
)
{
return
new
DoubleValue
(+
expression
.
evaluate
(
scope
,
environment
).
asDouble
());
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/bedrockk/molang/ast/binaryop/ArrowExpression.java
0 → 100644
View file @
555dc5dd
package
com.bedrockk.molang.ast.binaryop
;
import
com.bedrockk.molang.Expression
;
import
com.bedrockk.molang.ast.BinaryOpExpression
;
import
com.bedrockk.molang.runtime.MoLangEnvironment
;
import
com.bedrockk.molang.runtime.MoScope
;
import
com.bedrockk.molang.runtime.value.MoValue
;
public
class
ArrowExpression
extends
BinaryOpExpression
{
public
ArrowExpression
(
Expression
left
,
Expression
right
)
{
super
(
left
,
right
);
}
@Override
public
String
getSigil
()
{
return
"->"
;
}
@Override
public
MoValue
evaluate
(
MoScope
scope
,
MoLangEnvironment
environment
)
{
Object
leftEnv
=
left
.
evaluate
(
scope
,
environment
);
if
(
leftEnv
instanceof
MoLangEnvironment
)
{
return
right
.
evaluate
(
scope
,
(
MoLangEnvironment
)
leftEnv
);
}
return
null
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/bedrockk/molang/ast/binaryop/BooleanAndExpression.java
0 → 100644
View file @
555dc5dd
package
com.bedrockk.molang.ast.binaryop
;
import
com.bedrockk.molang.Expression
;
import
com.bedrockk.molang.ast.BinaryOpExpression
;
import
com.bedrockk.molang.runtime.MoLangEnvironment
;
import
com.bedrockk.molang.runtime.MoScope
;
import
com.bedrockk.molang.runtime.value.DoubleValue
;
import
com.bedrockk.molang.runtime.value.MoValue
;
public
class
BooleanAndExpression
extends
BinaryOpExpression
{
public
BooleanAndExpression
(
Expression
left
,
Expression
right
)
{
super
(
left
,
right
);
}
@Override
public
String
getSigil
()
{
return
"&&"
;
}
@Override
public
MoValue
evaluate
(
MoScope
scope
,
MoLangEnvironment
environment
)
{
return
new
DoubleValue
(!
left
.
evaluate
(
scope
,
environment
).
equals
(
DoubleValue
.
ZERO
)
&&
!
right
.
evaluate
(
scope
,
environment
).
equals
(
DoubleValue
.
ZERO
));
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/bedrockk/molang/ast/binaryop/BooleanOrExpression.java
0 → 100644
View file @
555dc5dd
package
com.bedrockk.molang.ast.binaryop
;
import
com.bedrockk.molang.Expression
;
import
com.bedrockk.molang.ast.BinaryOpExpression
;
import
com.bedrockk.molang.runtime.MoLangEnvironment
;
import
com.bedrockk.molang.runtime.MoScope
;
import
com.bedrockk.molang.runtime.value.DoubleValue
;
import
com.bedrockk.molang.runtime.value.MoValue
;
public
class
BooleanOrExpression
extends
BinaryOpExpression
{
public
BooleanOrExpression
(
Expression
left
,
Expression
right
)
{
super
(
left
,
right
);
}
@Override
public
String
getSigil
()
{
return
"||"
;
}
@Override
public
MoValue
evaluate
(
MoScope
scope
,
MoLangEnvironment
environment
)
{
return
new
DoubleValue
(!
left
.
evaluate
(
scope
,
environment
).
equals
(
DoubleValue
.
ZERO
)
||
!
right
.
evaluate
(
scope
,
environment
).
equals
(
DoubleValue
.
ZERO
));
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/bedrockk/molang/ast/binaryop/CoalesceExpression.java
0 → 100644
View file @
555dc5dd
package
com.bedrockk.molang.ast.binaryop
;
import
com.bedrockk.molang.Expression
;
import
com.bedrockk.molang.ast.BinaryOpExpression
;
import
com.bedrockk.molang.runtime.MoLangEnvironment
;
import
com.bedrockk.molang.runtime.MoScope
;
import
com.bedrockk.molang.runtime.value.DoubleValue
;
import
com.bedrockk.molang.runtime.value.MoValue
;
public
class
CoalesceExpression
extends
BinaryOpExpression
{
public
CoalesceExpression
(
Expression
left
,
Expression
right
)
{
super
(
left
,
right
);
}
@Override
public
String
getSigil
()
{
return
"??"
;
}
@Override
public
MoValue
evaluate
(
MoScope
scope
,
MoLangEnvironment
environment
)
{
MoValue
evalLeft
=
left
.
evaluate
(
scope
,
environment
);
MoValue
value
=
environment
.
getValue
(
evalLeft
.
asString
());
if
(
value
==
null
||
value
.
equals
(
DoubleValue
.
ZERO
))
{
return
right
.
evaluate
(
scope
,
environment
);
}
else
{
return
evalLeft
;
}
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/bedrockk/molang/ast/binaryop/DivideExpression.java
0 → 100644
View file @
555dc5dd
package
com.bedrockk.molang.ast.binaryop
;
import
com.bedrockk.molang.Expression
;
import
com.bedrockk.molang.ast.BinaryOpExpression
;
import
com.bedrockk.molang.runtime.MoLangEnvironment
;
import
com.bedrockk.molang.runtime.MoScope
;
import
com.bedrockk.molang.runtime.value.DoubleValue
;
import
com.bedrockk.molang.runtime.value.MoValue
;
public
class
DivideExpression
extends
BinaryOpExpression
{
public
DivideExpression
(
Expression
left
,
Expression
right
)
{
super
(
left
,
right
);
}
@Override
public
String
getSigil
()
{
return
"/"
;
}
@Override
public
MoValue
evaluate
(
MoScope
scope
,
MoLangEnvironment
environment
)
{
return
new
DoubleValue
(
left
.
evaluate
(
scope
,
environment
).
asDouble
()
/
right
.
evaluate
(
scope
,
environment
).
asDouble
());
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/bedrockk/molang/ast/binaryop/EqualExpression.java
0 → 100644
View file @
555dc5dd
package
com.bedrockk.molang.ast.binaryop
;
import
com.bedrockk.molang.Expression
;
import
com.bedrockk.molang.ast.BinaryOpExpression
;
import
com.bedrockk.molang.runtime.MoLangEnvironment
;
import
com.bedrockk.molang.runtime.MoScope
;
import
com.bedrockk.molang.runtime.value.DoubleValue
;
import
com.bedrockk.molang.runtime.value.MoValue
;
public
class
EqualExpression
extends
BinaryOpExpression
{
public
EqualExpression
(
Expression
left
,
Expression
right
)
{
super
(
left
,
right
);
}
@Override
public
String
getSigil
()
{
return
"=="
;
}
@Override
public
MoValue
evaluate
(
MoScope
scope
,
MoLangEnvironment
environment
)
{
return
new
DoubleValue
(
left
.
evaluate
(
scope
,
environment
).
equals
(
right
.
evaluate
(
scope
,
environment
)));
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/bedrockk/molang/ast/binaryop/GreaterExpression.java
0 → 100644
View file @
555dc5dd
package
com.bedrockk.molang.ast.binaryop
;
import
com.bedrockk.molang.Expression
;
import
com.bedrockk.molang.ast.BinaryOpExpression
;
import
com.bedrockk.molang.runtime.MoLangEnvironment
;
import
com.bedrockk.molang.runtime.MoScope
;
import
com.bedrockk.molang.runtime.value.DoubleValue
;
import
com.bedrockk.molang.runtime.value.MoValue
;
public
class
GreaterExpression
extends
BinaryOpExpression
{
public
GreaterExpression
(
Expression
left
,
Expression
right
)
{
super
(
left
,
right
);
}
@Override
public
String
getSigil
()
{
return
">"
;
}
@Override
public
MoValue
evaluate
(
MoScope
scope
,
MoLangEnvironment
environment
)
{
return
new
DoubleValue
(
left
.
evaluate
(
scope
,
environment
).
asDouble
()
>
right
.
evaluate
(
scope
,
environment
).
asDouble
());
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/bedrockk/molang/ast/binaryop/GreaterOrEqualExpression.java
0 → 100644
View file @
555dc5dd
package
com.bedrockk.molang.ast.binaryop
;
import
com.bedrockk.molang.Expression
;
import
com.bedrockk.molang.ast.BinaryOpExpression
;
import
com.bedrockk.molang.runtime.MoLangEnvironment
;
import
com.bedrockk.molang.runtime.MoScope
;
import
com.bedrockk.molang.runtime.value.DoubleValue
;
import
com.bedrockk.molang.runtime.value.MoValue
;
public
class
GreaterOrEqualExpression
extends
BinaryOpExpression
{
public
GreaterOrEqualExpression
(
Expression
left
,
Expression
right
)
{
super
(
left
,
right
);
}
@Override
public
String
getSigil
()
{
return
">="
;
}
@Override
public
MoValue
evaluate
(
MoScope
scope
,
MoLangEnvironment
environment
)
{
return
new
DoubleValue
(
left
.
evaluate
(
scope
,
environment
).
asDouble
()
>=
right
.
evaluate
(
scope
,
environment
).
asDouble
());
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/bedrockk/molang/ast/binaryop/MinusExpression.java
0 → 100644
View file @
555dc5dd
package
com.bedrockk.molang.ast.binaryop
;
import
com.bedrockk.molang.Expression
;
import
com.bedrockk.molang.ast.BinaryOpExpression
;
import
com.bedrockk.molang.runtime.MoLangEnvironment
;
import
com.bedrockk.molang.runtime.MoScope
;
import
com.bedrockk.molang.runtime.value.DoubleValue
;
import
com.bedrockk.molang.runtime.value.MoValue
;
public
class
MinusExpression
extends
BinaryOpExpression
{
public
MinusExpression
(
Expression
left
,
Expression
right
)
{
super
(
left
,
right
);
}
@Override
public
String
getSigil
()
{
return
"-"
;
}
@Override
public
MoValue
evaluate
(
MoScope
scope
,
MoLangEnvironment
environment
)
{
return
new
DoubleValue
(
left
.
evaluate
(
scope
,
environment
).
asDouble
()
-
right
.
evaluate
(
scope
,
environment
).
asDouble
());
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/bedrockk/molang/ast/binaryop/NotEqualExpression.java
0 → 100644
View file @
555dc5dd
package
com.bedrockk.molang.ast.binaryop
;
import
com.bedrockk.molang.Expression
;
import
com.bedrockk.molang.ast.BinaryOpExpression
;
import
com.bedrockk.molang.runtime.MoLangEnvironment
;
import
com.bedrockk.molang.runtime.MoScope
;
import
com.bedrockk.molang.runtime.value.DoubleValue
;
import
com.bedrockk.molang.runtime.value.MoValue
;
public
class
NotEqualExpression
extends
BinaryOpExpression
{
public
NotEqualExpression
(
Expression
left
,
Expression
right
)
{
super
(
left
,
right
);
}
@Override
public
String
getSigil
()
{
return
"!="
;
}
@Override
public
MoValue
evaluate
(
MoScope
scope
,
MoLangEnvironment
environment
)
{
return
new
DoubleValue
(!
left
.
evaluate
(
scope
,
environment
).
equals
(
right
.
evaluate
(
scope
,
environment
)));
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/bedrockk/molang/ast/binaryop/PlusExpression.java
0 → 100644
View file @
555dc5dd
package
com.bedrockk.molang.ast.binaryop
;
import
com.bedrockk.molang.Expression
;
import
com.bedrockk.molang.ast.BinaryOpExpression
;
import
com.bedrockk.molang.runtime.MoLangEnvironment
;
import
com.bedrockk.molang.runtime.MoScope
;
import
com.bedrockk.molang.runtime.value.DoubleValue
;
import
com.bedrockk.molang.runtime.value.MoValue
;
public
class
PlusExpression
extends
BinaryOpExpression
{
public
PlusExpression
(
Expression
left
,
Expression
right
)
{
super
(
left
,
right
);
}
@Override
public
String
getSigil
()
{
return
"+"
;
}
@Override
public
MoValue
evaluate
(
MoScope
scope
,
MoLangEnvironment
environment
)
{
return
new
DoubleValue
(
left
.
evaluate
(
scope
,
environment
).
asDouble
()
+
right
.
evaluate
(
scope
,
environment
).
asDouble
());
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/bedrockk/molang/ast/binaryop/PowExpression.java
0 → 100644
View file @
555dc5dd
package
com.bedrockk.molang.ast.binaryop
;
import
com.bedrockk.molang.Expression
;
import
com.bedrockk.molang.ast.BinaryOpExpression
;
import
com.bedrockk.molang.runtime.MoLangEnvironment
;
import
com.bedrockk.molang.runtime.MoScope
;
import
com.bedrockk.molang.runtime.value.DoubleValue
;
import
com.bedrockk.molang.runtime.value.MoValue
;
public
class
PowExpression
extends
BinaryOpExpression
{
public
PowExpression
(
Expression
left
,
Expression
right
)
{
super
(
left
,
right
);
}
@Override
public
String
getSigil
()
{
return
"*"
;
}
@Override
public
MoValue
evaluate
(
MoScope
scope
,
MoLangEnvironment
environment
)
{
return
new
DoubleValue
(
left
.
evaluate
(
scope
,
environment
).
asDouble
()
*
right
.
evaluate
(
scope
,
environment
).
asDouble
());
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/bedrockk/molang/ast/binaryop/SmallerExpression.java
0 → 100644
View file @
555dc5dd
package
com.bedrockk.molang.ast.binaryop
;
import
com.bedrockk.molang.Expression
;
import
com.bedrockk.molang.ast.BinaryOpExpression
;
import
com.bedrockk.molang.runtime.MoLangEnvironment
;
import
com.bedrockk.molang.runtime.MoScope
;
import
com.bedrockk.molang.runtime.value.DoubleValue
;
import
com.bedrockk.molang.runtime.value.MoValue
;
public
class
SmallerExpression
extends
BinaryOpExpression
{
public
SmallerExpression
(
Expression
left
,
Expression
right
)
{
super
(
left
,
right
);
}
@Override
public
String
getSigil
()
{
return
"<"
;
}
@Override
public
MoValue
evaluate
(
MoScope
scope
,
MoLangEnvironment
environment
)
{
return
new
DoubleValue
(
left
.
evaluate
(
scope
,
environment
).
asDouble
()
<
right
.
evaluate
(
scope
,
environment
).
asDouble
());
}
}
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
5
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment