combined some awk options into QSE_AWK_EXTRAKWS.

deleted QSE_AWK_EXTRAOPS and enabled all new operators by default
added === and !==.
fixed a bug in printing the explicit concatenation operator(%%, %%=)
improved @include handling
This commit is contained in:
2012-10-25 14:38:27 +00:00
parent b53fe11c04
commit 8ac0963885
16 changed files with 342 additions and 273 deletions

View File

@ -382,23 +382,19 @@ struct opttab_t
{
{ QSE_T("implicit"), QSE_AWK_IMPLICIT, QSE_T("allow undeclared variables") },
{ QSE_T("explicit"), QSE_AWK_EXPLICIT, QSE_T("allow declared variables(local,global)") },
{ QSE_T("extraops"), QSE_AWK_EXTRAOPS, QSE_T("enable extra operators(<<,>>,^^,\\)") },
{ QSE_T("extrakws"), QSE_AWK_EXTRAKWS, QSE_T("enable abort,reset,nextofile,OFILENAME,@include") },
{ QSE_T("rio"), QSE_AWK_RIO, QSE_T("enable builtin I/O including getline & print") },
{ QSE_T("rwpipe"), QSE_AWK_RWPIPE, QSE_T("allow a dual-directional pipe") },
{ QSE_T("newline"), QSE_AWK_NEWLINE, QSE_T("enable a newline to terminate a statement") },
{ QSE_T("striprecspc"), QSE_AWK_STRIPRECSPC, QSE_T("strip spaces in splitting a record") },
{ QSE_T("stripstrspc"), QSE_AWK_STRIPSTRSPC, QSE_T("strip spaces in string-to-number conversion") },
{ QSE_T("nextofile"), QSE_AWK_NEXTOFILE, QSE_T("enable 'nextofile'") },
{ QSE_T("reset"), QSE_AWK_RESET, QSE_T("enable 'reset'") },
{ QSE_T("crlf"), QSE_AWK_CRLF, QSE_T("use CRLF for a newline") },
{ QSE_T("maptovar"), QSE_AWK_MAPTOVAR, QSE_T("allow a map to be assigned or returned") },
{ QSE_T("pablock"), QSE_AWK_PABLOCK, QSE_T("enable pattern-action loop") },
{ QSE_T("rexbound"), QSE_AWK_REXBOUND, QSE_T("enable {n,m} in a regular expression") },
{ QSE_T("ncmponstr"), QSE_AWK_NCMPONSTR, QSE_T("perform numeric comparsion on numeric strings") },
{ QSE_T("strictnaming"), QSE_AWK_STRICTNAMING, QSE_T("enable the strict naming rule") },
{ QSE_T("include"), QSE_AWK_INCLUDE, QSE_T("enable '@include'") },
{ QSE_T("tolerant"), QSE_AWK_TOLERANT, QSE_T("make more fault-tolerant") },
{ QSE_T("abort"), QSE_AWK_ABORT, QSE_T("enable 'abort'") },
{ QSE_NULL, 0, QSE_NULL }
};
@ -525,23 +521,19 @@ static int comparg (int argc, qse_char_t* argv[], struct arg_t* arg)
{
{ QSE_T(":implicit"), QSE_T('\0') },
{ QSE_T(":explicit"), QSE_T('\0') },
{ QSE_T(":extraops"), QSE_T('\0') },
{ QSE_T(":extrakws"), QSE_T('\0') },
{ QSE_T(":rio"), QSE_T('\0') },
{ QSE_T(":rwpipe"), QSE_T('\0') },
{ QSE_T(":newline"), QSE_T('\0') },
{ QSE_T(":striprecspc"), QSE_T('\0') },
{ QSE_T(":stripstrspc"), QSE_T('\0') },
{ QSE_T(":nextofile"), QSE_T('\0') },
{ QSE_T(":reset"), QSE_T('\0') },
{ QSE_T(":crlf"), QSE_T('\0') },
{ QSE_T(":maptovar"), QSE_T('\0') },
{ QSE_T(":pablock"), QSE_T('\0') },
{ QSE_T(":rexbound"), QSE_T('\0') },
{ QSE_T(":ncmponstr"), QSE_T('\0') },
{ QSE_T(":strictnaming"), QSE_T('\0') },
{ QSE_T(":include"), QSE_T('\0') },
{ QSE_T(":tolerant"), QSE_T('\0') },
{ QSE_T(":abort"), QSE_T('\0') },
{ QSE_T(":call"), QSE_T('c') },
{ QSE_T(":file"), QSE_T('f') },