Wednesday, January 2, 2019

Default macros working nicely

It was mostly corner conditions like no semi at end of src, or fixing switch back to syntax mode after macro and I had to start using the EXIT condition and created a one line exit_cmd to terminate a macro.  All those fixes work for while loops, which are simply macros preceded by expressions preceded by while_cmd.

Lines are coming in at 860, still well withing range of snippet.  But the expressions probably execute without crashing and it is mainly just getting the accumulator  matched properly between the while_cmd and  expr_cmd But even with simple macros, I can repeatedly bang on xchars with ad hoc command sequences. Productivity speed up already happerning.

A Default boot syntax, perfect in its niche. Well targeted, I avoid making any promises exceptthe simple default operations of a simple console loop.  But for the price, above and beyond what we needed anyway, Default is costing all of an extra 350 lines of code, and is designed to drop out on request.  It is like always having this open source, basic graphics driver for Nvidia, something that gets one started up and it is not black box.

My next test is Execfile, a file having the contents:
Default  LoadModule xchars;
MyStr() {
   NewConn conn;
   NewWin conn win;
   NewRext win rect 10 10 200 200;
   OuStr rect HwlloWorld;
}

Then under test condition I can:
MyStr();  # while debugging xchars.

I am remaining in Default mode. If I exit Default mode,
the macros remain valid, the console loop still finds them
and the source code is not replaced.  Cntrl c exits syntax mode, but we need to make exit_cmd work in this case.

No comments: