lang: Split lang package out into many subpackages
This is a giant refactor to split the giant lang package into many subpackages. The most difficult piece was figuring out how to extract the extra ast structs into their own package, because they needed to call two functions which also needed to import the ast. The solution was to separate out those functions into their own packages, and to pass them into the ast at the root when they're needed, and to let the relevant ast portions call a handle. This isn't terribly ugly because we already had a giant data struct woven through the ast. The bad part is rebasing any WIP work on top of this.
This commit is contained in:
@@ -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 'lang/interpolate/parse.generated.go' -not -path 'lang/types/kind_stringer.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/parser/y.go' -not -path 'lang/parser/lexer.nn.go' -not -path 'lang/interpolate/parse.generated.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"
|
||||
@@ -55,7 +55,7 @@ while read -r line; do
|
||||
done <<< "$NUMSTAT1" # three < is the secret to putting a variable into read
|
||||
|
||||
git checkout "$PREVIOUS" &>/dev/null # previous commit
|
||||
LINT1=$(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 {} \;)
|
||||
LINT1=$(find * -maxdepth 9 -iname '*.go' -not -path 'old/*' -not -path 'tmp/*' -not -path 'bindata/*' -not -path 'lang/parser/y.go' -not -path 'lang/parser/lexer.nn.go' -not -path 'vendor/*' -exec golint {} \;)
|
||||
COUNT1=`echo -e "$LINT1" | wc -l` # number of golint problems in older branch
|
||||
|
||||
# clean up
|
||||
|
||||
@@ -45,8 +45,8 @@ gml="$gml --enable=misspell"
|
||||
|
||||
# exclude generated files:
|
||||
# TODO: at least until https://github.com/alecthomas/gometalinter/issues/270
|
||||
gml="$gml --exclude=lang/lexer.nn.go"
|
||||
gml="$gml --exclude=lang/y.go"
|
||||
gml="$gml --exclude=lang/parser/lexer.nn.go"
|
||||
gml="$gml --exclude=lang/parser/y.go"
|
||||
gml="$gml --exclude=bindata/bindata.go"
|
||||
gml="$gml --exclude=lang/types/kind_stringer.go"
|
||||
gml="$gml --exclude=lang/interpolate/parse.generated.go"
|
||||
|
||||
@@ -109,7 +109,7 @@ function reflowed-comments() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "$1" = './lang/lexer.nn.go' ]; then
|
||||
if [ "$1" = './lang/parser/lexer.nn.go' ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user