1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-18 02:05:54 +02:00
Commit Graph

18 Commits

Author SHA1 Message Date
Werner Almesberger
31c1c58691 b2/subex.c (compose): search "out" variables before "in" variables 2012-06-03 13:31:22 -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
cc895fe7fc b2/: introduce unit pattern (##), for dimensionless values 2012-06-03 09:50:21 -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
c6e394436c b2/: move implicit initialization of FN, F1, ... to explicit function subex_init 2012-06-03 02:00:56 -03:00
Werner Almesberger
db279b7920 b2/subex.c (compose): use stralloc_n instead of open-coding its functionality 2012-05-23 14:18:02 -03:00
Werner Almesberger
107280b6d5 b2/: rename "again" to "continue" 2012-05-22 15:44:31 -03:00
Werner Almesberger
bb809b0d6c b2/: make "again" include the match; make "break" pop the stack 2012-05-22 15:29:27 -03:00
Werner Almesberger
148d5e85ac b2/: regexec puts first substring into pmatch[1] and not pmatch[0]
Also clean up the hard-coded number of matches.
2012-05-22 13:49:49 -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
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
4a3e517935 b2/: move basic handling of variables from subex to param 2012-05-21 19:46:42 -03:00
Werner Almesberger
c1b6b2a5e4 b2/: use (general) "struct param" to replace (specialized) "struct var" 2012-05-21 19:26:36 -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
4e39ca2e31 b2/: move variable-length strings to vstring.[ch], for sharing 2012-05-20 20:54:07 -03:00
Werner Almesberger
fd14c5200a b2/: add processing of substitution rules 2012-05-20 20:33:14 -03:00