Skip to content

libslax-0.23.0

Choose a tag to compare

@philshafer philshafer released this 27 Feb 17:24
· 201 commits to main since this release

Introducing "version 1.3":

  • Improved slaxproc Argument Parsing
    slaxproc -Fpitest-empty-39.slax --width=70

  • Parentheses are now optional

    for-each $authors/author[life-span/born] {
        if life-span/died {
            <dead>;
        } else if life-span/born < 1900 {
            <very-old>
        }

        for $i in life-span/born ... life-span/died {
            <lived-in> $i;
        }
    }
  • "output-method json"
  • New slaxproc Parameter Syntax with "--param name=value"
  • Profiler Option to invoke the profiler from the command line
  • Format Width with --width 80
  • xutil:slax-to-xml() and xutil:xml-to-slax()
  • xutil:common() and xutil:distinct()
  • New Bit Shift Functions
  • New slaxproc Options (--xml-to-yaml, --encoding, --indent-width)
  • Version Information with "--version" and "--version-only"
  • slax:ends-with()
  • slax:get-host()
  • slax:join()
  • New slax:printf() Functionality
  • Hex Numbers (var $x = 0x45 + 0xBEEF;)

And several other interesting features.

Complete details in:

https://libslax.readthedocs.io/en/latest/notes.html#new-features-in-slax-1-3

From the commit logs:

  • --dump-tree will dump the hierarchy of the script
  • Add "in" keyword for 'for $i in xpath'
  • Add %h and %H; fix $jt; fix end-with()
  • Add +xutil:slax-to-xml and +xutil:xml-to-slax
  • Add a --want-parens opton to force pre-1.3 parens on conditional statements even if -w1.3
  • Add new -aname=value format; add encoding option
  • Add slax:ends-with() function (#57)
  • Implement slax:xml-to-slax() (#20)
  • sdb: add "info nodes" which list script nodes/hierarchy
  • sdb: add "wall" profile-mode
  • sdb: add "wall" to profiler
  • add --indent-width option
  • add --json
  • add --profile and --profile-mode options
  • add --version-only
  • add --version-only; clean up option processing a bit
  • add SLAX_VERSION to "slaxproc --version" output (#58)
  • sdb: add dump command
  • add percentage to profiler output
  • add profiler-only support
  • add shift functions to the bit library
  • add slax:get-host() function
  • add slax:join()
  • add support for --json and 'output-method json' to make json output
  • add xutil:common() and xutil:difference()
  • add yaml writer
  • convert hex numbers to decimal before making string tokens
  • detect "var $x = call name(...)" and write it correctly (v1.3) (#34)
  • detect .ext extension for prefixes that don't require libraries (aren't "extension"s)
  • make -v additive and turn off parsing status for single -v, while allowing it with -vv
  • move to getopt_long style option processing; add encoding option
  • new 1.3 version, supporting unquoted order statements (#63)
  • teach bit:from-int() to accept strings (#54)

Repair the effects of time:

Add some functionality to "gt":

  • "gt br ls" lists branches; "gt merge"
  • add "clone" verb
  • add "unpatch"
  • add 'gt self-help' since I keep forgetting the syntax
  • add a coat of "fancy" to unpatch

Build environment:

  • Add HAVE_HUMANIZE_NUMBER:-no logic, since humanize_number(3) is not standard
  • Add SH_OPTS for debugging
  • Adjust to new version of autoreconf; no need for m4/sqlite3, but it needs a test for SQLITE3_REQUIRED_VERSION; nuke "print" from xml2-config, etc.; add --with-sqlite3[=DIR]
  • Remove the line numbers that libxslt emits, which breaks our tests
  • Set language to En
  • Some XPATH_* enums became #defines, so we need to protect against compiler warnings with -Wswitch
  • add "scribble" to randomize memory
  • add +slaxIoUseReadline (--no-readline) to avoid readline/libedit, when used without a tty (e.g. under lldb)
  • add -lutil, since that's where humanize_number might live
  • add LIBADD settings for dependent libraries
  • add __printflike def for linux
  • add check for memrchr (which it turns out we don't need)
  • add missing slaxhumanize.h to noinst list

Install issues:

Intern code fixes:

  • replace "pure-parser" with modern "api.pure"
  • slaxDebugInitFlags(), which accepts flags including the profiler ones
  • Add inttypes.h to get PRId64
  • GCC pragma-fu to avoid warning with libxslt XSLT_RVT_LOCAL
  • Keep the line number accurate inside comments (PR1486566)
  • Stop indenting at double colon (L_DCOLON)
  • Turn off -Wunused-but-set-variable (for bison 3.8.2)
  • Update humanize with latest BSD source
  • Use slaxSetupFakeContext() to make a fake context now that xmlSetupParserForBuffer is deprecated (libxml2-2.15.2)
  • add L_UNDERSCORE (concat) to acceptable marking points for wrapping lines in the formatter
  • add T_UNTERMINATED_STRING for a proper error
  • add UNUSED to yynerrs
  • add comment explaining that the back-reference example fails under macos
  • add slaxAddChild to wrap xmlAddChild in acceptable logic
  • alloca proper length buffer (#49)
  • alloca() proper length buffer (#49)
  • allow unquoted strings for order/etc statements (#63)
  • autoupdate changes
  • avoid NULL argument
  • avoid https://bugzilla.gnome.org/show_bug.cgi?id=629325
  • avoid memcpy call when sep is NULL, even if slen is zero
  • bison 3.7.6 drops YYTERROR (now YYSYMBOL_YYerror)
  • bit:to-int needs a check for negative numbers
  • case-order is not implemented in libxslt
  • commonize and simplify some variants of slaxAttribAdd*()
  • fix (#61) allow true, false, and null in JSON
  • get more input of look ahead isn't looking far enough (#13)
  • handle the "json" output-method; start comments with slaxWriteBlankline not slaxWriteNewline
  • make the psvi of the initial state (slaxMvarInit) as global or local so about errors when freed ("xsltFreeStackElem: Unexpected RVT flag")
  • move from xmlAddChild to slaxAddChild, to protect against an issue where xmlAddChild coalesces the incoming node with existing nodes and frees the argument without letting the caller know
  • stop substituting "/dev/std{in,out}" for "-"; use file handles directly

plus lots of documentation additions and update test cases