diff --git a/lang/Makefile b/lang/Makefile index daed3a03..ea2a089b 100644 --- a/lang/Makefile +++ b/lang/Makefile @@ -23,8 +23,11 @@ OLDGOYACC := $(shell go version | grep -E 'go1.6|go1.7') all: build build: lexer.nn.go y.go + @# recursively run make in child dir named types + @$(MAKE) --quiet -C types clean: + $(MAKE) --quiet -C types clean @rm -f lexer.nn.go y.go y.output || true lexer.nn.go: lexer.nex diff --git a/lang/interpret_test/TestAstFunc1/fail2.graph b/lang/interpret_test/TestAstFunc1/fail2.graph index 8cb726c2..749e37a0 100644 --- a/lang/interpret_test/TestAstFunc1/fail2.graph +++ b/lang/interpret_test/TestAstFunc1/fail2.graph @@ -1 +1 @@ -# err: err3: can't unify, invariant illogicality with equality: base kind does not match (2 != 3) +# err: err3: can't unify, invariant illogicality with equality: base kind does not match (Str != Int) diff --git a/lang/interpret_test/TestAstFunc1/polydoubleincludewithtype.graph b/lang/interpret_test/TestAstFunc1/polydoubleincludewithtype.graph index 0a0315fb..6823f818 100644 --- a/lang/interpret_test/TestAstFunc1/polydoubleincludewithtype.graph +++ b/lang/interpret_test/TestAstFunc1/polydoubleincludewithtype.graph @@ -1 +1 @@ -# err: err3: can't unify, invariant illogicality with equals: base kind does not match (2 != 5) +# err: err3: can't unify, invariant illogicality with equals: base kind does not match (Str != List) diff --git a/lang/types/Makefile b/lang/types/Makefile new file mode 100644 index 00000000..ee2da50a --- /dev/null +++ b/lang/types/Makefile @@ -0,0 +1,30 @@ +# Mgmt +# Copyright (C) 2013-2019+ James Shubin and the project contributors +# Written by James Shubin and the project contributors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +SHELL = /usr/bin/env bash +.PHONY: all build clean + +all: build + +build: kind_stringer.go + +clean: + @rm -f kind_stringer.go || true + +kind_stringer.go: type.go + @echo "Generating: type kind strings..." + go generate diff --git a/lang/unification_test.go b/lang/unification_test.go index 77908591..9eb9d60b 100644 --- a/lang/unification_test.go +++ b/lang/unification_test.go @@ -697,7 +697,7 @@ func TestUnification1(t *testing.T) { name: "typed if expr", ast: stmt, fail: true, - experrstr: "can't unify, invariant illogicality with equality: base kind does not match (2 != 3)", + experrstr: "can't unify, invariant illogicality with equality: base kind does not match (Str != Int)", }) } { @@ -750,7 +750,7 @@ func TestUnification1(t *testing.T) { name: "typed var expr", ast: stmt, fail: true, - experrstr: "can't unify, invariant illogicality with equality: base kind does not match (2 != 1)", + experrstr: "can't unify, invariant illogicality with equality: base kind does not match (Str != Bool)", }) } diff --git a/test/test-golint.sh b/test/test-golint.sh index f3c3855c..11b1566d 100755 --- a/test/test-golint.sh +++ b/test/test-golint.sh @@ -27,7 +27,7 @@ if [ "$COMMITS" != "" ] && [ "$COMMITS" -gt "1" ]; then fi # find all go files, exluding temporary directories and generated files -LINT=$(find * -maxdepth 9 -iname '*.go' -not -path 'old/*' -not -path 'tmp/*' -not -path 'bindata/*' -not -path 'lang/y.go' -not -path 'lang/lexer.nn.go' -not -path 'vendor/*' -exec golint {} \;) # current golint output +LINT=$(find * -maxdepth 9 -iname '*.go' -not -path 'old/*' -not -path 'tmp/*' -not -path 'bindata/*' -not -path 'lang/y.go' -not -path 'lang/lexer.nn.go' -not -path 'lang/types/kind_stringer.go' -not -path 'vendor/*' -exec golint {} \;) # current golint output COUNT=`echo -e "$LINT" | wc -l` # number of golint problems in current branch [ "$LINT" = "" ] && echo PASS && exit # everything is "perfect" diff --git a/test/test-gometalinter.sh b/test/test-gometalinter.sh index 535f3d4f..9dea1ba6 100755 --- a/test/test-gometalinter.sh +++ b/test/test-gometalinter.sh @@ -48,6 +48,7 @@ gml="$gml --enable=misspell" gml="$gml --exclude=lang/lexer.nn.go" gml="$gml --exclude=lang/y.go" gml="$gml --exclude=bindata/bindata.go" +gml="$gml --exclude=lang/types/kind_stringer.go" gometalinter="$gml" # final echo "Using: $gometalinter"