Werner Almesberger
ddbf80b542
b2/: handle attempts to break/continue (in substitutions) without a block
2012-06-03 20:54:08 -03:00
Werner Almesberger
ee0a2a41fa
b2/: add "print VAR" command in substitutions (for debugging/tracing)
2012-06-03 13:15:31 -03:00
Werner Almesberger
da1010f92a
b2/: add regular expression conversion debugging (option -R)
2012-06-03 10:10:47 -03:00
Werner Almesberger
cc895fe7fc
b2/: introduce unit pattern (##), for dimensionless values
2012-06-03 09:50:21 -03:00
Werner Almesberger
e93ff0e683
b2/subst.c (prepare_re): recognize % in union pattern
2012-06-03 09:42:09 -03:00
Werner Almesberger
b35b6e2688
b2/: disallow assigning to FN
2012-06-03 02:08:32 -03:00
Werner Almesberger
c2414a5d2c
b2/: resolve FN in subst_init and don't consider an FN match evidence of existance
2012-06-03 02:04:27 -03:00
Werner Almesberger
cae92bba03
b2/subst.c (dump_chunks): closing } was missing when dumping variable expansion
2012-06-02 23:09:47 -03:00
Werner Almesberger
a537cc5503
b2/subst.c (parse_var): use unique_n
2012-05-23 17:23:14 -03:00
Werner Almesberger
694d48b56a
b2/: make the match name after "break" and "continue" optional
...
If the name is omitted, we jump back / out of the current block.
2012-05-22 15:47:02 -03:00
Werner Almesberger
107280b6d5
b2/: rename "again" to "continue"
2012-05-22 15:44:31 -03:00
Werner Almesberger
2ce2da5c30
b2/subst.c (resolve_jump): use pointer comparison instead of strcmp
...
Both come from "unique".
2012-05-22 14:27:39 -03:00
Werner Almesberger
21702781bc
b2/: use re_nsub instead of maintaining our own equivalent
...
We still need to count parentheses in prepare_re for the current index
into "units", but the rest can ue re_nsub.
2012-05-22 13:51:57 -03:00
Werner Almesberger
3d2eca34ff
b2/: meta-variable $ for "previously matched variable"
...
We need this for iterative processing of FN.
2012-05-22 13:01:39 -03:00
Werner Almesberger
2946b830f1
b2/subst.c (prepare_re): fail on bad (#unit) syntax instead of ignoring
2012-05-22 12:07:41 -03:00
Werner Almesberger
d2171eba47
b2/: add "ignore" keyword for substitution rules
...
This allows us to decide in the project-specific rules how to indicate
DNP/NC/DNS/... parts. In the original BOOM, F1 == NC was hard-coded.
2012-05-21 23:17:33 -03:00
Werner Almesberger
3ad6c2c44b
b2/: move all error handling from subex to subst
...
This makes checking of variables more strict: a variable can only
be used in the right -hand side of an assignment if it has been
assigned by an unconditional predecessor or if it has been matched
by a parent.
Things that wouldn't work anymore:
REF=X* {
FN=*V { X=Y }
Z=$X /* we can't be sure X=Y was taken */
}
FN=*R {
X=$REF /* no previous use of REF */
}
2012-05-21 00:20:07 -03:00
Werner Almesberger
6fd5313917
b2/: assigments to can express inequalities
2012-05-20 23:16:51 -03:00
Werner Almesberger
99e5777448
b2/: finish unit handling and move most of its processing to the match side
...
The ${foo#unit} syntax didn't really make sense because it created
a large number of potential error conditions on the assignment side
and didn't help with finding compatible fields.
With all this moved to the match side, an invalid syntax simply causes
a mismatch.
2012-05-20 22:02:50 -03:00
Werner Almesberger
adecef8d4a
b2/: use glob syntax instead of RE syntax for substitutions
2012-05-20 21:05:17 -03:00
Werner Almesberger
9681d44ca4
b2/subst.c: use vstring for modified regexp
2012-05-20 20:57:18 -03:00
Werner Almesberger
9fd1dc56e7
b2/: add parsing of substitution rules (WIP)
2012-05-20 20:33:14 -03:00