use of st.gravel.support.compiler.ast.BlockTypeNode in project gravel by gravel-st.
the class Parser method parseTypeExpressionBlockAndClose.
public BlockTypeNode parseTypeExpressionBlockAndClose() {
TypeNode[] _args;
TypeNode _returnType;
_args = new TypeNode[] {};
_returnType = null;
boolean _temp1 = true;
while (_temp1) {
Parser.this.eatWhitespace();
if (st.gravel.support.jvm.ReadStreamExtensions.peekFor_(_stream, '^')) {
_returnType = Parser.this.parseTypeNode();
} else {
_args = st.gravel.support.jvm.ArrayExtensions.copyWith_(_args, Parser.this.parseTypeNode());
}
Parser.this.eatWhitespace();
_temp1 = st.gravel.support.jvm.ReadStreamExtensions.peekFor_(_stream, ',');
}
st.gravel.support.jvm.ObjectExtensions.assert_(this, st.gravel.support.jvm.ReadStreamExtensions.peekFor_(_stream, ']'));
return BlockTypeNode.factory.arguments_returnType_(_args, _returnType);
}
use of st.gravel.support.compiler.ast.BlockTypeNode in project gravel by gravel-st.
the class Parser method parseTypeExpressionListAndClose.
public TypeNode[] parseTypeExpressionListAndClose() {
final BlockTypeNode _block;
_block = this.parseTypeExpressionBlockAndClose();
st.gravel.support.jvm.ObjectExtensions.assert_(this, _block.returnType() == null);
return _block.arguments();
}
use of st.gravel.support.compiler.ast.BlockTypeNode in project gravel by gravel-st.
the class SourcePrinter method visitBlockTypeNode_.
@Override
public SourcePrinter visitBlockTypeNode_(final BlockTypeNode _aNode) {
_stream.append('[');
boolean _temp1 = true;
for (final TypeNode _each : _aNode.arguments()) {
if (_temp1) {
_temp1 = false;
} else {
_stream.append(',');
_stream.append(' ');
}
if (_each == null) {
_stream.append("Unknown");
} else {
SourcePrinter.this.visit_(_each);
}
}
if (_aNode.returnType() != null) {
if (_aNode.arguments().length != 0) {
_stream.append(',');
_stream.append(' ');
}
SourcePrinter.this.visit_(_aNode.returnType());
}
_stream.append(']');
return this;
}
Aggregations