分隔符和空白

每个 MEL 语句都应使用分号 (;) 结束。在多数情况下,这是绝对要求。

print("End with a semicolon.");
print("Semicolons separate"); print(" different statements.");

空白(空格、tab 和换行符)会被 MEL 忽略(当然,位于字符串中时除外)。

请记住,与某些其他语言不同,在 MEL 中换行符并不分隔语句。因此以下情况是错误的:

print("Hello")
print("There")

必须添加分号来分隔各个语句:

print("Hello");
print("There")

重要说明

与大多数语言不同,在 MEL 中,块内的所有语句(由大括号围绕)都必须以分号结束,即使是块中唯一的语句。

if ($s > 10) {print("Glonk!")} // Syntax error.
if ($s > 10) {print("Glunk!");} // Notice the semicolon.