2c3632d14f
Lots of code refactoring, simplification and cleanup. Lots of new unit-tests providing much higher code coverage. All courtesy of rillig at netbsd. Other significant changes: o new read-only variable .SHELL which provides the path of the shell used to run scripts (as defined by the .SHELL target). o variable parsing detects more errors. o new debug option -dl: LINT mode, does the equivalent of := for all variable assignments so that file and line number are reported for variable parse errors.
89 lines
4.4 KiB
Plaintext
89 lines
4.4 KiB
Plaintext
Global:RELEVANT = yes (load-time part)
|
|
Global:COUNTER =
|
|
Global:NEXT = ${COUNTER::=${COUNTER} a}${COUNTER:[#]}
|
|
Global:A =
|
|
Var_Parse: ${NEXT} with VARE_WANTRES|VARE_ASSIGN
|
|
Var_Parse: ${COUNTER::=${COUNTER} a}${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
|
|
Applying ${COUNTER::...} to "" (eflags = VARE_WANTRES|VARE_ASSIGN, vflags = none)
|
|
Var_Parse: ${COUNTER} a}${COUNTER:[#]} with VARE_WANTRES
|
|
Modifier part: " a"
|
|
Global:COUNTER = a
|
|
Result of ${COUNTER::=${COUNTER} a} is "" (eflags = VARE_WANTRES|VARE_ASSIGN, vflags = none)
|
|
Var_Parse: ${COUNTER} a}${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
|
|
Var_Parse: ${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
|
|
Applying ${COUNTER:[...} to " a" (eflags = VARE_WANTRES|VARE_ASSIGN, vflags = none)
|
|
Modifier part: "#"
|
|
Result of ${COUNTER:[#]} is "1" (eflags = VARE_WANTRES|VARE_ASSIGN, vflags = none)
|
|
Global:A = ${COUNTER::= a a}1
|
|
Global:B =
|
|
Var_Parse: ${NEXT} with VARE_WANTRES|VARE_ASSIGN
|
|
Var_Parse: ${COUNTER::=${COUNTER} a}${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
|
|
Applying ${COUNTER::...} to " a" (eflags = VARE_WANTRES|VARE_ASSIGN, vflags = none)
|
|
Var_Parse: ${COUNTER} a}${COUNTER:[#]} with VARE_WANTRES
|
|
Modifier part: " a a"
|
|
Global:COUNTER = a a
|
|
Result of ${COUNTER::=${COUNTER} a} is "" (eflags = VARE_WANTRES|VARE_ASSIGN, vflags = none)
|
|
Var_Parse: ${COUNTER} a}${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
|
|
Var_Parse: ${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
|
|
Applying ${COUNTER:[...} to " a a" (eflags = VARE_WANTRES|VARE_ASSIGN, vflags = none)
|
|
Modifier part: "#"
|
|
Result of ${COUNTER:[#]} is "2" (eflags = VARE_WANTRES|VARE_ASSIGN, vflags = none)
|
|
Global:B = ${COUNTER::= a a a}2
|
|
Global:C =
|
|
Var_Parse: ${NEXT} with VARE_WANTRES|VARE_ASSIGN
|
|
Var_Parse: ${COUNTER::=${COUNTER} a}${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
|
|
Applying ${COUNTER::...} to " a a" (eflags = VARE_WANTRES|VARE_ASSIGN, vflags = none)
|
|
Var_Parse: ${COUNTER} a}${COUNTER:[#]} with VARE_WANTRES
|
|
Modifier part: " a a a"
|
|
Global:COUNTER = a a a
|
|
Result of ${COUNTER::=${COUNTER} a} is "" (eflags = VARE_WANTRES|VARE_ASSIGN, vflags = none)
|
|
Var_Parse: ${COUNTER} a}${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
|
|
Var_Parse: ${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
|
|
Applying ${COUNTER:[...} to " a a a" (eflags = VARE_WANTRES|VARE_ASSIGN, vflags = none)
|
|
Modifier part: "#"
|
|
Result of ${COUNTER:[#]} is "3" (eflags = VARE_WANTRES|VARE_ASSIGN, vflags = none)
|
|
Global:C = ${COUNTER::= a a a a}3
|
|
Global:RELEVANT = no
|
|
Global:RELEVANT = yes (run-time part)
|
|
Result of ${RELEVANT::=yes (run-time part)} is "" (eflags = VARE_WANTRES, vflags = none)
|
|
Var_Parse: ${A:Q} B=${B:Q} C=${C:Q} COUNTER=${COUNTER:[#]:Q} with VARE_WANTRES
|
|
Var_Parse: ${COUNTER::= a a}1 with VARE_WANTRES
|
|
Applying ${COUNTER::...} to " a a a" (eflags = VARE_WANTRES, vflags = none)
|
|
Modifier part: " a a"
|
|
Global:COUNTER = a a
|
|
Result of ${COUNTER::= a a} is "" (eflags = VARE_WANTRES, vflags = none)
|
|
Applying ${A:Q} to "1" (eflags = VARE_WANTRES, vflags = none)
|
|
QuoteMeta: [1]
|
|
Result of ${A:Q} is "1" (eflags = VARE_WANTRES, vflags = none)
|
|
Var_Parse: ${B:Q} C=${C:Q} COUNTER=${COUNTER:[#]:Q} with VARE_WANTRES
|
|
Var_Parse: ${COUNTER::= a a a}2 with VARE_WANTRES
|
|
Applying ${COUNTER::...} to " a a" (eflags = VARE_WANTRES, vflags = none)
|
|
Modifier part: " a a a"
|
|
Global:COUNTER = a a a
|
|
Result of ${COUNTER::= a a a} is "" (eflags = VARE_WANTRES, vflags = none)
|
|
Applying ${B:Q} to "2" (eflags = VARE_WANTRES, vflags = none)
|
|
QuoteMeta: [2]
|
|
Result of ${B:Q} is "2" (eflags = VARE_WANTRES, vflags = none)
|
|
Var_Parse: ${C:Q} COUNTER=${COUNTER:[#]:Q} with VARE_WANTRES
|
|
Var_Parse: ${COUNTER::= a a a a}3 with VARE_WANTRES
|
|
Applying ${COUNTER::...} to " a a a" (eflags = VARE_WANTRES, vflags = none)
|
|
Modifier part: " a a a a"
|
|
Global:COUNTER = a a a a
|
|
Result of ${COUNTER::= a a a a} is "" (eflags = VARE_WANTRES, vflags = none)
|
|
Applying ${C:Q} to "3" (eflags = VARE_WANTRES, vflags = none)
|
|
QuoteMeta: [3]
|
|
Result of ${C:Q} is "3" (eflags = VARE_WANTRES, vflags = none)
|
|
Var_Parse: ${COUNTER:[#]:Q} with VARE_WANTRES
|
|
Applying ${COUNTER:[...} to " a a a a" (eflags = VARE_WANTRES, vflags = none)
|
|
Modifier part: "#"
|
|
Result of ${COUNTER:[#]} is "4" (eflags = VARE_WANTRES, vflags = none)
|
|
Applying ${COUNTER:Q} to "4" (eflags = VARE_WANTRES, vflags = none)
|
|
QuoteMeta: [4]
|
|
Result of ${COUNTER:Q} is "4" (eflags = VARE_WANTRES, vflags = none)
|
|
A=1 B=2 C=3 COUNTER=4
|
|
Var_Parse: ${RELEVANT::=no} with VARE_WANTRES
|
|
Applying ${RELEVANT::...} to "yes (run-time part)" (eflags = VARE_WANTRES, vflags = none)
|
|
Modifier part: "no"
|
|
Global:RELEVANT = no
|
|
exit status 0
|