use of st.gravel.support.compiler.ast.StringLiteralNode in project gravel by gravel-st.
the class ParserTest method testParseString2.
@Test
public void testParseString2() {
final StringLiteralNode _node;
_node = ((StringLiteralNode) Parser.factory.source_("\'from\'\'age\'").parseExpression());
assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), StringLiteralNode.factory));
assertTrue(st.gravel.support.jvm.StringExtensions.equals_(_node.value(), "from\'age"));
}
use of st.gravel.support.compiler.ast.StringLiteralNode in project gravel by gravel-st.
the class MethodNode method primitiveIn_.
public String[] primitiveIn_(final String _className) {
final PragmaNode _pragma;
final Expression _argument;
final ArrayLiteralNode _arrayNode;
_pragma = this.primitivePragma();
if (_pragma == null) {
return null;
}
_argument = _pragma.expression().argument();
if (_argument.isStringLiteralNode()) {
return MethodNode.this.localPrimitiveIn_nameNode_(_className, ((StringLiteralNode) _argument));
}
if (!_argument.isArrayLiteralNode()) {
return null;
}
_arrayNode = ((ArrayLiteralNode) _argument);
return st.gravel.support.jvm.ArrayExtensions.collect_(_arrayNode.value(), ((st.gravel.support.jvm.Block1<String, Object>) (new st.gravel.support.jvm.Block1<String, Object>() {
@Override
public String value_(final Object _e) {
final String _str;
_str = ((String) _e);
return (String) _str;
}
})));
}
use of st.gravel.support.compiler.ast.StringLiteralNode in project gravel by gravel-st.
the class ParserTest method testParseString1.
@Test
public void testParseString1() {
final StringLiteralNode _node;
_node = ((StringLiteralNode) Parser.factory.source_("\'fromage\'").parseExpression());
assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), StringLiteralNode.factory));
assertTrue(st.gravel.support.jvm.StringExtensions.equals_(_node.value(), "fromage"));
}
Aggregations