ics-jku / wal

WAL enables programmable waveform analysis.
https://wal-lang.org
BSD 3-Clause "New" or "Revised" License
116 stars 18 forks source link

Add checking for undefined expressions #14

Closed shareefj closed 1 year ago

shareefj commented 1 year ago

It looks like there's no checking that an expression used in a condition is valid. For example, defining an alias on a signal but then using that signal in an expression with a typo doesn't raise an error that WAL knows nothing about the mistyped version.

So for example:

(alias htrans TOP.blah.blah)
(whenever clk (when (= trans 2) (print "Found it")))

runs with no output even though there is no expression trans.

LucasKl commented 1 year ago

This is changed in the new Version of WAL. Since WAl is heavily inspired by AWK it used to define variables on first use with 0. However, I changed this in the latest release and now an error should be thrown.

Originally it was a nice feature for simple "one-line" scripts but as WAL programs got more complicated it produced more problems then it solved.