forked from pointlander/peg
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.bash
More file actions
executable file
·40 lines (29 loc) · 784 Bytes
/
bootstrap.bash
File metadata and controls
executable file
·40 lines (29 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
set -Eeuo pipefail
(cd bootstrap && go build && rm -f bootstrap/bootstrap.peg.go)
cd cmd/peg-bootstrap
# Build peg0
./../../bootstrap/bootstrap
go build -tags bootstrap -o peg0
rm -f bootstrap.peg.go
# Build peg1
./peg0 < bootstrap.peg > peg1.peg.go
go build -tags bootstrap -o peg1
rm -f peg1.peg.go
# Build peg2
./peg1 < peg.bootstrap.peg > peg2.peg.go
go build -tags bootstrap -o peg2
rm -f peg2.peg.go
# Build peg3
./peg2 < ../../peg.peg > peg3.peg.go
go build -tags bootstrap -o peg3
rm -f peg3.peg.go
# Build peg-bootstrap
./peg3 < ../../peg.peg > peg-bootstrap.peg.go
go build -tags bootstrap -o peg-bootstrap
rm -f peg-bootstrap.peg.go
# Build peg
cd ../..
./cmd/peg-bootstrap/peg-bootstrap < peg.peg > peg.peg.go
go build
./peg -inline -switch peg.peg