| }
public void testArrayLiteral() throws CompilerException {
assertParserOutput(
new ExpressionStatement(
new ArrayLiteral(
new Expression[] {
}
)
),
"[];"
);
assertParserOutput(
new ExpressionStatement(
new ArrayLiteral(
new Expression[] {
null
}
)
),
"[,];"
);
assertParserOutput(
new ExpressionStatement(
new ArrayLiteral(
new Expression[] {
new NumberLiteral(0.0)
}
)
),
"[0.0];"
);
assertParserOutput(
new ExpressionStatement(
new ArrayLiteral(
new Expression[] {
null,
new NumberLiteral(0.0)
}
)
),
"[,0.0];"
);
assertParserOutput(
new ExpressionStatement(
new ArrayLiteral(
new Expression[] {
new NumberLiteral(0.0)
}
)
),
"[0.0,];"
);
assertParserOutput(
new ExpressionStatement(
new ArrayLiteral(
new Expression[] {
new NumberLiteral(0.0),
null
}
)
),
"[0.0,,];"
);
assertParserOutput(
new ExpressionStatement(
new ArrayLiteral(
new Expression[] {
new NumberLiteral(0.0),
null,
new NumberLiteral(1.0)
}
)
),
"[0.0,,1.0];"
);
assertParserOutput(
new ExpressionStatement(
new ArrayLiteral(
new Expression[] {
new NumberLiteral(0.0),
null,
new NumberLiteral(1.0)
}
)
),
"[0.0,,1.0,];"
);
assertParserOutput(
new ExpressionStatement(
new ArrayLiteral(
new Expression[] {
new NumberLiteral(0.0),
null,
new NumberLiteral(1.0),
null
|