Skip to content

Commit

Permalink
build: use snake2camel go tool instead than awk
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
  • Loading branch information
leodido committed Feb 12, 2024
1 parent 647e09e commit 828774d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ docs: dots parser/docs/minimal_types.png parser/docs/falco_types.png parser/docs

.PHONY: snake2camel
snake2camel:
@awk -i inplace '{ \
while ( match($$0, /(.*)([a-z]+[0-9]*)_([a-zA-Z0-9])(.*)/, cap) ) \
$$0 = cap[1] cap[2] toupper(cap[3]) cap[4]; \
print \
}' $(file)
@go build ./tools/snake2camel

.PHONY: removecomments
removecomments:
Expand Down Expand Up @@ -78,10 +74,12 @@ parser/machine.go: parser/machine.go.rl common/common.rl

parser/machine.go: removecomments

parser/machine.go: snake2camel

parser/machine.go:
$(RAGEL) -Z -G2 -e -o $@ $<
@./removecomments $@
$(MAKE) file=$@ snake2camel
@./snake2camel $@
$(GOFMT) $@

.PHONY: tests
Expand Down

0 comments on commit 828774d

Please sign in to comment.