lang: parser: Simplify code and format it
This would get done by gofmt -s anyways.
This commit is contained in:
1
Makefile
1
Makefile
@@ -636,5 +636,6 @@ funcgen: lang/core/generated_funcs.go
|
||||
lang/core/generated_funcs.go: lang/funcs/funcgen/*.go lang/core/funcgen.yaml lang/funcs/funcgen/templates/generated_funcs.go.tpl
|
||||
@echo "Generating: funcs..."
|
||||
@go run `find lang/funcs/funcgen/ -maxdepth 1 -type f -name '*.go' -not -name '*_test.go'` -templates=lang/funcs/funcgen/templates/generated_funcs.go.tpl >/dev/null
|
||||
@gofmt -s -w $@
|
||||
|
||||
# vim: ts=8
|
||||
|
||||
@@ -40,11 +40,13 @@ clean:
|
||||
parser/lexer.nn.go: parser/lexer.nex
|
||||
@echo "Generating: lexer..."
|
||||
nex -e -o $@ $<
|
||||
gofmt -s -w $@
|
||||
@ROOT="$$( cd "$$( dirname "$${BASH_SOURCE[0]}" )" && cd .. && pwd )" && $$ROOT/misc/header.sh 'parser/lexer.nn.go'
|
||||
|
||||
parser/y.go: parser/parser.y
|
||||
@echo "Generating: parser..."
|
||||
goyacc -v parser/y.output -o $@ $<
|
||||
gofmt -s -w $@
|
||||
@ROOT="$$( cd "$$( dirname "$${BASH_SOURCE[0]}" )" && cd .. && pwd )" && $$ROOT/misc/header.sh 'parser/y.go'
|
||||
|
||||
interpolate/parse.generated.go: interpolate/parse.rl
|
||||
|
||||
@@ -335,7 +335,7 @@
|
||||
yylex.pos(lval) // our pos
|
||||
s := yylex.Text()
|
||||
|
||||
lval.str = s[1:len(s)] // remove the leading #
|
||||
lval.str = s[1:] // remove the leading #
|
||||
//log.Printf("lang: lexer: comment: `%s`", lval.str)
|
||||
//return COMMENT // skip return to avoid parsing
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user