1
0
Fork 0
Commit graph

61 commits

Author SHA1 Message Date
Thomas Geymayer
9e905228ef Nasal: respect color argument for debug._dump_prop 2014-06-21 12:09:34 +02:00
Philosopher
ddcb543c10 debug.nas: use argument to disable/enable color
(on top of the normal color setting -- i.e. this overrides that)
2014-06-06 21:19:10 -05:00
Philosopher
6e17a1d2cb Initial Nasal REPL work (canvas-based)
Features:
- Various configurable styles.
- Working scroll bars, thanks to Tom
- Adequate REPL-ness.

See the wiki for more information!
http://wiki.flightgear.org/Interactive_Nasal_Console

N.B. This makes some (sane) changes to other Nasal files, including
expanding some of the Canvas API.
2014-04-18 16:49:11 -05:00
Philosopher
642ebfa696 Some changes/additions to debug.nas
Add benchmark_time, rank, and print_rank. Modify benchmark to return/
pass-through the values of the function, appending to a vector if there
are multiple executions.
2014-02-20 11:47:27 -06:00
ThorstenB
b8eecab9cf Introduce "PRESERVE" flag to protect properties on sim reset.
Protect values of some specific properties on sim-reset.
2011-06-12 20:40:11 +02:00
mfranz
35d506bce1 isnan: shorter & faster 2009-04-24 08:12:21 +00:00
mfranz
53e733d425 new isnan() that doesn't create a NaN itself 2009-03-21 18:17:59 +00:00
mfranz
824cff9192 comment out isnan()
It conflicts with Jester's debugging setup, and Andy says there should be
no NaN in the first place. This is a bug that needs to get fixed. Just
enable isnan() if you want to detect NaNs in the meantime. (The MP system
creates them ATM. The property getters shall turn them into nil.)
2009-02-12 16:59:03 +00:00
mfranz
a9afecf74b debug.error: rename to warn, reduce default caller skip, documentation 2009-02-09 14:29:43 +00:00
mfranz
747d9dcbde debug mode: fix slice 2009-02-09 00:24:23 +00:00
mfranz
6495f062d3 var++ 2009-02-08 21:58:31 +00:00
mfranz
4757d49c0c debug mode: add hint for why the write operation probably failed 2009-02-08 21:16:28 +00:00
mfranz
04511dbc8d --prop:debug=1 enables a debug mode where some functions generate warnings.
setprop(), props.Node.set{,Int,Bool,Double}Value() complain if they couldn't
write, e.g. because the target property is write protected, or doesn't have
a tied setter function.
2009-02-08 20:46:55 +00:00
mfranz
1d783e03bb remove debug.exit(); add debug.isnan()
- 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.
2009-02-06 14:41:13 +00:00
mfranz
5c88cdf6f1 dump: no space after [ and before ] 2008-12-03 20:49:33 +00:00
mfranz
f7e246905b tree(): show which nodes are aliased to which nodes 2008-11-26 16:07:32 +00:00
mfranz
81e967a609 nasal now returns constant and readable ghosttypes, so we do no longer
need the symbol table and comparison with the ghosttype of props._globals()
2008-11-13 12:00:23 +00:00
mfranz
6384588444 I said "correctly". 2008-10-25 14:24:26 +00:00
mfranz
f7bd13fed3 debug.dump(): print empty strings as hash key correctly 2008-10-25 14:20:47 +00:00
mfranz
782368fefa documentation update and cosmetics 2008-10-09 17:20:27 +00:00
mfranz
e6e1f8ae20 - move color functions from debug.nas to string.nas
- multikey.nas: add exit/no-exit markers to help output
2008-10-03 15:20:12 +00:00
mfranz
772112df89 use color codes only when printing to the terminal 2008-10-01 14:04:47 +00:00
mfranz
e354f26a4d add braces to work with Nasal TNG 2008-09-24 19:38:56 +00:00
mfranz
c047efb41f debug.proptrace: increase the default frame number to get one complete frame 2008-08-17 07:35:27 +00:00
mfranz
917cace77c string.nas: remove forgotten debug message
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
2008-08-14 22:13:25 +00:00
mfranz
4ac84809e9 nasal: cleanup & minor fixes
- 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)
2008-08-10 17:53:41 +00:00
mfranz
ad781922a7 here's a case where we want explicit namespace prefixes everywhere
(just renaming debug.string instead was plan B ;-)
2008-07-30 19:22:36 +00:00
mfranz
de1aa4c56e finally make printf() globally available 2008-07-23 15:43:45 +00:00
mfranz
951f31a56c change attribute names from read/write to readable/writable 2008-07-07 10:25:08 +00:00
mfranz
d86b1b9c74 string.nas: new functions string.join() and string.replace()
debug.nas: let benchmark() repeat tested function
io.nas: cosmetics
aircraft.nas: initialize time property only once
2008-06-21 07:10:32 +00:00
mfranz
56eef9c69f move load_nasal to io module 2008-06-14 14:32:37 +00:00
mfranz
2866043c3d - prop_key_handler: limitate history to history-max-size on loading
- string/debug: cosmetics
2008-06-08 11:14:57 +00:00
mfranz
0b4322736f - make debug.dump() accept more than one argument (one could already write
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
2008-05-15 15:23:17 +00:00
mfranz
a53e636268 debug.nas: _dump_string(): escape some characters
prop-key-handler.nas: minor cleanup
2007-11-25 20:36:57 +00:00
mfranz
96c76c4fe0 display hash keys that are numbers as numbers; import string.nas functions 2007-11-19 13:31:18 +00:00
mfranz
31807d6538 dump funny hash keys correctly, as string with escaped non-printables 2007-11-19 12:36:26 +00:00
mfranz
d85ba7575c make debug.attributes() verbose by default. This adds the refcounter to
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.
2007-11-15 21:27:42 +00:00
mfranz
3a83fb99d5 - "export" the attributes function for return a property node's attributes
as string (s/_attrib/attributes)
- bind() the code in load_nasal() correctly
2007-11-15 06:46:14 +00:00
mfranz
eb5b350ec9 we need more colors! 2007-10-16 18:54:25 +00:00
mfranz
be3025b40f bah ... always shortly after presenting a new feature on the list, I change
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>]]);
2007-10-16 17:23:25 +00:00
mfranz
fc6f357a0e add new debugging function proptrace(), which outputs all regular property
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
2007-10-16 15:24:30 +00:00
mfranz
2bcddab9b6 setlistener(): accessing the node via cmdarg() is now depreciated. Use
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);
2007-10-15 18:27:42 +00:00
mfranz
bece57dfc8 output ghosts in a readable form 2007-07-02 20:58:30 +00:00
mfranz
cfd9c1b48f pointless spelling fixes 2007-06-22 18:49:38 +00:00
mfranz
44cbca565d add ghost(type) output, just like nasal/lib/debug.nas :-) 2007-06-21 20:00:21 +00:00
mfranz
59c303bcc1 add printerror() function that prints error vectors as set by call() 2007-06-16 08:21:39 +00:00
mfranz
3c73eaa45f documentation update and cosmetics 2007-06-12 21:27:48 +00:00
mfranz
4c2ded3509 throw out load_xml_nasal and implement load_nasal(<file> [, <module>]);
This can be used to load and run Nasal code at runtime (without need
for an XML frame).
2007-06-12 19:13:28 +00:00
mfranz
a1fd54cfdf aircraft.nas, gui.nas: adapt loadxml for absolute paths, drop second fgcommand arg
debug.nas, tutorial.nas: adapt for abs. paths
fuel.nas: cleanup
screen.nas: don't remove listeners -- that's done automatically by removind
    the node in NasalSys.cxx
xml.nas: minor documentation fix
2007-06-12 16:20:55 +00:00
mfranz
39ee6cff4f fix backtrace() (probably broken since the last Nasal update) 2007-06-10 20:31:33 +00:00