Compiler/Verifying syntax: Difference between revisions

m
No edit summary
Line 86:
 
for s in teststatements
println("The compiler parses the statement { $s } isand outputs: ", okparse(s) ? "" : "not ", "valid syntax.")
end
</lang>{{out}}
<pre>
The compiler parses the statement { not 3 < 4 or (true or 3 / 4 + 8 * 5 - 5 * 2 < 56) and 4 * 3 < 12 or not true } isand validoutputs: syntax.true
The compiler parses the statement { and 3 < 2 } is notand validoutputs: syntax.false
The compiler parses the statement { not 7 < 2 } isand validoutputs: syntax.true
The compiler parses the statement { 4 * (32 - 16) + 9 = 73 } isand validoutputs: syntax.true
The compiler parses the statement { 235 76 + 1 } is notand validoutputs: syntax.false
</pre>
4,105

edits