}
return visited.get(id);
}
if (yaml.getConstructorType() == Node_scalar) {
// we're ignoring the tag annotations right now.
IValue value = yaml.get(0);
if (value.getType() == tf.integerType()) {
// TODO: detect Long, BigInt etc.
return new Integer(((IInteger)value).intValue());
}
if (value.getType() == tf.realType()) {
return new Double(((IReal)value).doubleValue());
}
if (value.getType() == tf.stringType()) {
return new String((((IString)value).getValue()));
}
if (value.getType() == tf.boolType()) {
return new Boolean((((IBool)value).getValue()));
}
if (value.getType() == tf.dateTimeType()) {
return new Date(((IDateTime)value).getInstant());
}
if (value.getType() == tf.sourceLocationType()) {
return ((ISourceLocation)value).getURI();
}
throw RuntimeExceptionFactory.illegalArgument(yaml, ctx.getCurrentAST(), ctx.getStackTrace());
}
if (yaml.getConstructorType() == Node_sequence) {