FIM++ 条件表达式
第 17 章
8 年前
1086某些语句用到条件表达式。它们在语法上和其他表达式不同。
下面所有的例子里, 位于{...} 里面的部分是可选的,而位于 (...|...) 里面的部分是可以相互代替的。
FIM++采用严格比较,即2与"2"是不同的。
数字大小比较条件
<表达式> (has|have|had) more than <表达式>
<表达式> (has|have|had) less than <表达式>
<表达式> (has|have|had) not more than <表达式>
<表达式> (has|have|had) not less than <表达式>
(everypony|everything) in <tuple变量> (has|have|had) more than <表达式>
(anypony|anything) in <tuple变量> (has|have|had) more than <表达式>
...相等条件
<表达式> (is|are|was|were) equal to <表达式>
<表达式> (is|are|was|were) not equal to <表达式>
<表达式> (is|are|was|were) (an element|elements) of <表达式>
<表达式> (is|are|was|were) not (an element|elements) of <表达式>为空(null)条件
<表达式> (is|are|was|were) nothing
<表达式> (is|are|was|were) nopony
<表达式> (is|are|was|were) something
<表达式> (is|are|was|were) somepony“或”条件
<简单条件> or <简单条件>
<简单条件>, <简单条件> or <简单条件>
either <简单条件> or <简单条件>
either <简单条件>, <简单条件> or <简单条件>
...“与”条件
<简单条件> and <简单条件>
<简单条件>, <简单条件> and <简单条件>
...