Skip to content

Commit be71dfd

Browse files
committed
update grammar gen
1 parent 31f2908 commit be71dfd

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- 'syntaxes/*.yml'
1010

1111
jobs:
12-
convert-grammars:
12+
gen-json-grammars:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v3
@@ -19,6 +19,6 @@ jobs:
1919
- uses: tiabeast/[email protected]
2020
- run: npm install
2121
- name: Run grammar converter and push changes
22-
run: bait run scripts/convert_grammars.bt
22+
run: bait run scripts/gen_json_grammar.bt
2323
env:
2424
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,20 @@ fun main() {
2727
os.rmdir_all(target_repo_dir)
2828
}
2929

30+
// Clone repo as bot user
3031
access_token := os.getenv('BOT_TOKEN')
3132
errors += git_command('clone --depth 1 https://${GIT_USER}:${access_token}@github.com/tiabeast/vscode-vba-json.git ${target_repo_dir}')
3233

34+
// Run conversion
3335
errors += os.system('npm run convert-yaml')
34-
os.cp('./out', '${target_repo_dir}/syntaxes')
36+
37+
// Copy syntax files
38+
syntax_dir := '${target_repo_dir}/syntaxes'
39+
os.cp('./out/vba.tmGrammar.json', '${syntax_dir}/vba.tmGrammar.json')
40+
os.cp('./out/wwb.tmGrammar.json', '${syntax_dir}/wwb.tmGrammar.json')
3541

3642
// Sanity check for a reasonable file size
37-
text := os.read_file(target_repo_dir + '/syntaxes/vba.tmGrammar.json')
43+
text := os.read_file(syntax_dir + '/vba.tmGrammar.json')
3844
if text.length < 1000 {
3945
eprintln('grammar is too small. Something went wrong.')
4046
exit(1)

src/extension.js.bt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// This file is part of vscode-vba.
22
// Copyright (c) 2021-present Lukas Neubert
33
// This Source Code is subject to the terms of the Mozilla Public License 2.0.
4+
package extension
45

56
import 'vscode' as #JS.vscode
67

0 commit comments

Comments
 (0)