mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Symbol editor now has constraints on selection, but part list allows selection inside groups.
Added logical 'xor' operator for scripting. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@534 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -352,6 +352,7 @@ void instrBinary (BinaryInstructionType i, ScriptValueP& a, const ScriptValueP&
|
||||
break;
|
||||
case I_AND: OPERATOR_I(&&);
|
||||
case I_OR: OPERATOR_I(||);
|
||||
case I_XOR: a = to_script((bool)*a != (bool)*b); break;
|
||||
case I_EQ: OPERATOR_SDI(==);
|
||||
case I_NEQ: OPERATOR_SDI(!=);
|
||||
case I_LT: OPERATOR_DI(<);
|
||||
|
||||
@@ -582,6 +582,7 @@ void parseOper(TokenIterator& input, Script& script, Precedence minPrec, Instruc
|
||||
parseOper(input, script, PREC_CMP, I_BINARY, I_OR);
|
||||
}
|
||||
}
|
||||
else if (minPrec <= PREC_AND && token==_("xor")) parseOper(input, script, PREC_CMP, I_BINARY, I_XOR);
|
||||
else if (minPrec <= PREC_CMP && token==_("=")) {
|
||||
if (minPrec <= PREC_SET) {
|
||||
input.add_error(_("Use of '=', did you mean ':=' or '=='?"));
|
||||
|
||||
@@ -146,6 +146,7 @@ String Script::dumpInstr(unsigned int pos, Instruction i) const {
|
||||
case I_MOD: ret += _("mod"); break;
|
||||
case I_AND: ret += _("and"); break;
|
||||
case I_OR: ret += _("or"); break;
|
||||
case I_XOR: ret += _("xor"); break;
|
||||
case I_EQ: ret += _("=="); break;
|
||||
case I_NEQ: ret += _("!="); break;
|
||||
case I_LT: ret += _("<"); break;
|
||||
|
||||
@@ -63,6 +63,7 @@ enum BinaryInstructionType
|
||||
// Logical
|
||||
, I_AND ///< logical and
|
||||
, I_OR ///< logical or
|
||||
, I_XOR ///< logical xor
|
||||
// Comparison
|
||||
, I_EQ ///< operator ==
|
||||
, I_NEQ ///< operator !=
|
||||
|
||||
Reference in New Issue
Block a user