- exit was only justified at times where fgcommand() needed an explicit
node statement, which made using it a bit clumsy. Nowadays that's only
fgcommand("exit"), which is as good as debug.exit() was.
- isnan() is really only for debugging and, thus, not in the global
namespace. Nasal code should never generate NaNs (though it's easy:
var nan = 1/0; There! :-), and NaNs imported from the C++ side (tied
properties!) should get fixed there. IOW: routine checks for nan in
Nasal can only be temporary hacks/debugging measures.
props.nas: replace some "arg[*]" by named args
aircraft.nas: load aircraft data only if the file exists (to avoid warning)
debug.nas: no space before colon & fixed comment & cosmetics
- fuel.nas: use props.initNode()
- debug.nas: fix comment
- globals.nas: load_nasal(): check extension and set module arg
- io.nas: update log message (the rules are no longer for io.open() only)
debug.dump([a, b]) for that, but debug.dump(a, b) is more obvious)
- change output colors: variable names are no longer bold, all property
attributes are now blue, not just the property type)
- drop redundant braces & other cosmetics
the property attribute string, as in:
(NONE, L1, #8345)
... for a node of type "NONE", with one listener attached, and 8345 instances
of the shared pointer around.
it and the description doesn't match any more. :-}
Number of frames makes more sense than seconds (default = 1):
debug.proptrace([<property> [, <number_of_frames>]]);
writes (not directly written tied ones), all node additions and removal.
Frames are separated with a line. Turn off ANSI coloring if you want to
pipe the results into a file: --prop:sim/startup/terminal-ansi-colors=0
a regular function argument for that. Note the "n" in this example:
setlistener("/sim/current-view/view-number", func(n) {
setprop("/sim/hud/visibility", !n.getValue());
}, 1);
debug.color(bool) turns terminal colors on/off
debug.tree(property="", mode=1); dumps property tree in flat
mode (0) or space indented mode (1).
Flat tree mode is similar to props.debug(), but colored, and it outputs
all attribute flags and the number of attached listeners.
development. The file must be an XML file with Nasal between a
header/footer. It's a good idea to give it a *.nas extension, so
that editors choose the Nasal syntax coloring.
<PropertyList><script><![CDATA[
... here goes the Nasal code ...
]]></script></PropertyList>
by debug.nas to turn on/off syntax coloring for dumped data (which
is desirable as compound data types can fill several screens with
rather hard to read data). Unfortunately, it can't be reliably deduced
from the OS whether ANSI colors are available or not.
- move "multiplayer chat" properties to where they belong
or of given frame
- add debug.string(<variable>). This returns the variable dump as
string.
- add var to module function variables to avoid collisions with module names