After I get the paw up and running I plan to deal with the next inconvenience of development, the inconsistent preprocessor command support (and the lack of #for etc). I'd like to start a debate here on what options would be desirable vs what is possible implementation wise, so far these are the notes for what I plan to implement (and how on some of them)
Code:
/* prepaw (paw preprocessor) planned features
* > Case sensitive for faster preprocessing
* > No escape characters for macros, just slows down preprocessing & makes
* code unneccessarily confusing, commands are used for multi-line defines
* instead
* > All commands search for macros with matching name in scope
* > #trigger prepaw looks for a new trigger before treating as a command,
* for example to switch to @command then back you would use:
* #trigger @
* @trigger #
* > #undef Behaves as usual, triggers an error & aborts when attempting to
* undefine anything defined with #predef
* > #global Behaves as #define would've but ends with #end,
* escape characters are unneeded
* > #static Behaves as #global but it's define shows up only in the file
* scope
* #line N ID, used for declaring what line and file id is relavent from
* here on, for example if an include was on the first line of a file that
* happened to have the id 3 (that's where paw's GC starts assigning new
* IDs, 0, 1 & 2 are reserved for pawin, pawout, & pawerr) then prepaw
* will insert the contents of the file before the #include command then
* replace the #include with #line 1 3
* > #scoped Behaves as #static but in macro scope (if there is one)
* > #predef Behaves as #scoped, but cannot be undefined
* > #include Behaves as usual
* > #import Behaves as usual
* > #source No commands are processed between this, #end, #import & #include
* > #warnof Expects a string, emits it as a message, increases warning count
* > #fixerr Expects a string, emits it as a message, increases error count
* > #abort Behaves as #fixerr but aborts preprocessing
* > #pragma once behaves as usual
* > #if, #ifdef, #elif & #endif behave as usual
* > #for([i = macro/constant, ...]; exit_condition; [modify var,...])
* where [...] is optional, scope ends with #end, variables behave as if
* declared with #predef
* > #while(exit_condition)
* > #do ends with #while, done at least once
* > #modify(name,operator) expression, needed for #for, #while & #do loops
* to modify their scoped variables, names that are not flat literals like
* 0xC0FFEEUL, 0.01f, 'x', "string" or `multi-line string` get treated as
* a `multi-line string`
* > #end Ends scope, triggers an error & aborts if in global scope
*/