Classify Vars in patterns.

There's 4 classes of variables, depending on whether they have defs in
the source and destination patterns.

Add more XForm verification: In a legalize XForm, all source defs must
be outputs.

Fix a legalize pattern bug caught by this.
This commit is contained in:
Jakob Stoklund Olesen
2016-11-01 16:10:38 -07:00
parent 88cbd5a43b
commit 1ba8e9e05b
5 changed files with 78 additions and 18 deletions

View File

@@ -2,9 +2,6 @@
set -e
cd $(dirname "$0")
echo "=== Python unit tests ==="
python -m unittest discover
runif() {
if command -v "$1" > /dev/null; then
echo "=== $1 ==="
@@ -19,13 +16,17 @@ runif() {
# Install pylint with 'pip install pylint'.
runif pylint --py3k --reports=no -- *.py cretonne isa
# Then run the unit tests again with Python 3.
# We get deprecation warnings about assertRaisesRegexp which was renamed in
# Python 3, but there doesn't seem to be an easy workaround.
runif python3 -Wignore:Deprecation -m unittest discover
# Style linting.
runif flake8 .
# Type checking.
runif mypy --py2 build.py
echo "=== Python unit tests ==="
python -m unittest discover
# Then run the unit tests again with Python 3.
# We get deprecation warnings about assertRaisesRegexp which was renamed in
# Python 3, but there doesn't seem to be an easy workaround.
runif python3 -Wignore:Deprecation -m unittest discover