forked from antlr/grammars-v4
-
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.
[build] Fixes for antlr#3468 -- Dependabot PRs cause crashes. (antlr#…
…3469) * Fixes for antlr#3468 Remove all mention of tool version in workflows/main.yml, because the version is per-target. Instead install antlr4 tool. * Fixes for antlr#3468. Set versions for Java Antlr version and use antlr4 tool to build. * Fix for antlr#3468. Cpp. Remove all explicit checks for java and just use the antlr4-tools antlr4 tool. * Fix for antlr#3468. Java and install of Python3 and Pip. Fix the Java template, and install of Python3 and Pip regardless because we now use antlr4, and never install java explicitly. * Fixes for antlr#3468. JavaScript. Fix the JavaScript build scripts, including the package.json version for Antlr4 runtime. * Fixes for $3468. TypeScript. Fix the version number for Antlr4 tool and runtime, and grep the version from the package.json file and send that the the antlr4 tool. * Fix antlr#3468. JavaScript, TypeScript, Dart. Fixes to remove newlines from brain-damaged version number that contain newlines. * Fixes for antlr#3468. Java. Set version for Antlr. Set up correct location of jar file using Python script from antlr4 tool. * Fixes for antlr#3468. Java and Powershell. This is a change to the Powershell version of the build script, equivalent to the Bash version. * Fixes for antlr#3468. Java and Powershell running. This is a fix for the jar path for running the parser with java. * Fixes for antlr#3468. Java and Powershell. Variable references require curly braces around the name when colon follows the name. * Fixes for antlr#3468. PHP and Bash. Change reference to java and the antlr jar to the antlr4 tool and version. * Fixes for antlr#3468. Python3, CSharp. Updates to version number of antlr for CSharp, scripts for Python3. * Fixes for antlr#3468. Go target. These changes are to fix the problem of using the antlr4 tool and using the latest api for 4.13.0 for Go. It's all changed. * Fixes for antlr#3468. Cpp and Pwsh Updates to get Cpp target to work. Adjustments to pwsh scripts. * Fixes for antlr#3468. Fix formatting of abb grammar, call all build of all targets. This change is to the abb grammar, but the only thing that is done is to remove some triple spacing between some rules. The point is to force a rebuild of all targets, so the new build scripts can all be checked. * Fixes for antlr#3468. Dart target still on 4.12.0. Rollback the version of Antlr to 4.12.0 for Dart--the runtime has not been released yet. In addition, this is a fabulous test of the new per-target Antlr version testing. * Fixes for antlr#3468. Dart. An release of the Dart runtime for 4.13.0 has been made in the last day. * Fixes for antlr#3468. Remove the .errors file mistakenly commited.
- Loading branch information
Showing
27 changed files
with
132 additions
and
104 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,14 +61,21 @@ jobs: | |
run: | | ||
go version | ||
- name: Install Python | ||
if: ${{ matrix.language == 'Python3' }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: '3.10' | ||
- name: Do not trust Python env | ||
if: ${{ matrix.language == 'Python3' }} | ||
run: | | ||
python --version | ||
- name: Upgrade Pip. | ||
run: | | ||
python -m ensurepip --upgrade | ||
- name: Do not trust Pip. | ||
run: | | ||
pip --version | ||
- name: Install Antlr tool | ||
run: | | ||
pip install antlr4-tools | ||
- name: Install JavaScript | ||
if: ${{ matrix.language == 'JavaScript' }} | ||
uses: actions/[email protected] | ||
|
@@ -78,16 +85,6 @@ jobs: | |
if: ${{ matrix.language == 'JavaScript' }} | ||
run: | | ||
node --version | ||
- name: Download ANTLR | ||
shell: pwsh | ||
run: | | ||
$antlrPath = _scripts/get-antlr.ps1 "4.13.0" | ||
echo "$antlrPath" | Write-Host | ||
echo "antlr_path=$antlrPath" >> $env:GITHUB_ENV | ||
If(!(test-path -PathType container /tmp)) { | ||
New-Item -Path '/tmp' -ItemType Directory | ||
} | ||
copy $antlrPath /tmp/antlr4-complete.jar | ||
- name: Update paths | ||
shell: pwsh | ||
run: | | ||
|
@@ -167,14 +164,21 @@ jobs: | |
run: | | ||
go version | ||
- name: Install Python | ||
if: ${{ matrix.language == 'Python3' }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: '3.10' | ||
- name: Do not trust Python env | ||
if: ${{ matrix.language == 'Python3' }} | ||
run: | | ||
python --version | ||
- name: Upgrade Pip. | ||
run: | | ||
python -m ensurepip --upgrade | ||
- name: Do not trust Pip. | ||
run: | | ||
pip --version | ||
- name: Install Antlr tool | ||
run: | | ||
pip install antlr4-tools | ||
- name: Install JavaScript | ||
if: ${{ matrix.language == 'JavaScript' }} | ||
uses: actions/[email protected] | ||
|
@@ -184,16 +188,6 @@ jobs: | |
if: ${{ matrix.language == 'JavaScript' }} | ||
run: | | ||
node --version | ||
- name: Download ANTLR | ||
shell: pwsh | ||
run: | | ||
$antlrPath = _scripts/get-antlr.ps1 "4.13.0" | ||
echo "$antlrPath" | Write-Host | ||
echo "antlr_path=$antlrPath" >> $env:GITHUB_ENV | ||
If(!(test-path -PathType container /tmp)) { | ||
New-Item -Path '/tmp' -ItemType Directory | ||
} | ||
copy $antlrPath /tmp/antlr4-complete.jar | ||
- name: Install trgen | ||
shell: bash | ||
run: | | ||
|
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
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
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
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
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
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,13 +1,19 @@ | ||
# Generated from trgen <version> | ||
export GO111MODULE=on | ||
for i in {1..5}; do go get github.com/antlr4-go/antlr; if [ "$?" = "0" ]; then break; fi; done; if [ "$?" != "0" ]; then exit 1; fi | ||
for i in {1..5}; do go get github.com/antlr4-go/antlr/v4; if [ "$?" = "0" ]; then break; fi; done; if [ "$?" != "0" ]; then exit 1; fi | ||
|
||
set -e | ||
|
||
if [ -f transformGrammar.py ]; then python3 transformGrammar.py ; fi | ||
|
||
# Because there is no integrated build script for Dart targets, we need | ||
# to manually look at the version in pubspec.yaml and extract the | ||
# version number. We can then use this with antlr4 to generate the | ||
# parser and lexer. | ||
# Go has no version, just the latest version. | ||
|
||
<tool_grammar_tuples:{x | | ||
java -jar "<antlr_tool_path>" -encoding <antlr_encoding> -Dlanguage=Go <x.AntlrArgs> <antlr_tool_args:{y | <y> } > <x.GrammarFileName> | ||
antlr4 -encoding <antlr_encoding> -Dlanguage=Go <x.AntlrArgs> <antlr_tool_args:{y | <y> } > <x.GrammarFileName> | ||
} > | ||
|
||
go build Test.go |
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
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
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
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
Oops, something went wrong.