use server.cs CreateServer() as the entry point for mission loading

This commit is contained in:
Brian Beck 2025-12-02 18:50:06 -08:00
parent 10b4a65a87
commit d0ab58c5ab
14 changed files with 2126 additions and 374 deletions

View file

@ -411,13 +411,13 @@ MultiplicativeExpression
}
UnaryExpression
= operator:("-" / "!" / "~") _ argument:AssignmentExpression {
= operator:("-" / "!" / "~") _ argument:UnaryOperand {
return buildUnaryExpression(operator, argument);
}
/ operator:("++" / "--") _ argument:UnaryExpression {
/ operator:("++" / "--") _ argument:UnaryOperand {
return buildUnaryExpression(operator, argument);
}
/ "*" _ argument:UnaryExpression {
/ "*" _ argument:UnaryOperand {
return {
type: 'TagDereferenceExpression',
argument
@ -425,6 +425,21 @@ UnaryExpression
}
/ PostfixExpression
// Allow assignment expressions as unary operands without parentheses.
// This matches official TorqueScript behavior where `!%x = foo()` parses as `!(%x = foo())`.
// We can't use full Expression here or it would break precedence (e.g., `!a + b` would
// incorrectly parse as `!(a + b)` instead of `(!a) + b`).
UnaryOperand
= target:LeftHandSide _ operator:AssignmentOperator _ value:AssignmentExpression {
return {
type: 'AssignmentExpression',
operator,
target,
value
};
}
/ UnaryExpression
PostfixExpression
= argument:CallExpression _ operator:("++" / "--") {
return {