Closed
Description
a
b
c
d
e
compiles to
var x$, y$, z$, z1$;
x$ = a;
y$ = b;
z$ = c;
z1$ = d;
e;
even though the cascadee isn't used. This hides some typos involving a missing do
that were previously caught at compile time, such as:
method
arg1
arg2
var x$;
x$ = method;
arg1;
arg2;
and even though this works when run, it hides the fact that |>
doesn't actually accept an implicit block:
program = @createProgram! |>
@attachShader _, vertex-shader
@attachShader _, fragment-shader
@linkProgram _
unless @getProgramParameter _, LINK_STATUS
throw new Error "couldn't intialize shader program!"
@useProgram _
var x$, program, _;
x$ = (_ = program = this.createProgram(), this.attachShader(_, vertexShader));
this.attachShader(_, fragmentShader);
this.linkProgram(_);
if (!this.getProgramParameter(_, LINK_STATUS)) {
throw new Error("couldn't intialize shader program!");
}
this.useProgram(_);
Proposal: cascade blocks in which the cascadee isn't used at least once should be invalid syntax. The error message should be similar to "Unexpected INDENT on line xx:xx, did you forget a 'do' or a cascade usage?"
Metadata
Metadata
Assignees
Labels
No labels