-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This requires the `bootstrap/1` tag, which we have to fetch explicitly on the test runners (see actions/checkout#701).
- Loading branch information
Showing
2 changed files
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Atm this is easy... it becomes harder once we remove lark | ||
set -ex | ||
|
||
# Attempt to get the current location. Prefer a branch name if available, | ||
# otherwise fall back to the current commit's hash if we are in "detached HEAD" | ||
# state. | ||
git_location=$(git branch --show) | ||
if [[ "$git_location" == "" ]]; then | ||
git_location=$(git rev-parse HEAD) | ||
fi | ||
|
||
# Stage 1; last commit where the Lark parser can parse the native parser. | ||
git checkout bootstrap/1 | ||
./glang ./parser/parser.c3 -o ./parser/parser --bootstrap -O3 | ||
|
||
# Stage 2; build native parser at current commit | ||
git checkout "$git_location" | ||
./glang ./parser/parser.c3 -o ./parser/parser -O3 |