I am working on the Commandline REPL environment with Rascal and trying to view things like parse trees and outputs from The Ambiguity library. However, these are truncated in the commandline. For example:
rascal>diagnose(parse(|cwd:///Core/tests/F0.func|));
list[Message]: [
info(
"Ambiguity cluster with 2 alternatives",
|cwd:///Core/tests/F0.func|(0,0,<1,0>,<1,0>)),
info(
"Production unique to the one alternative: Exp = app: Exp Exp ;",
|cwd:///Core/tests/F0.func|(0,0,<1,0>,<1,0>)),
info(
"Production unique to th...
I'm interested in seeing the rest of this output. Is there a setting I can change, or someway I can view this information. Thanks.
This is done for performance reasons. (Terminal/Shells do not like printing HUGE strings)
You can import IO
and use iprintln
to get the indented print without any truncating. For performance reasons you could als use iprintToFile
:
import IO;
r = diagnose(parse(|cwd:///Core/tests/F0.func|));
iprintln(r)
As an alternative, you might want to get the value in an editor using util::ValueUI::text
: (only works in eclipse)
import util::ValueUI;
r = diagnose(parse(|cwd:///Core/tests/F0.func|));
text(r, 4); // indentation level is 4
Finally we sometimes copy values to the clipboard with util::Clipboard
:
import util::Clipboard;
r = diagnose(parse(|cwd:///Core/tests/F0.func|));
copy(r)
and then you can paste them anywhere using your OS shortcut.