mirror of
https://github.com/elladunbar/tree-sitter-zanscript.git
synced 2025-11-05 23:29:54 -06:00
Compare commits
No commits in common. "main" and "v1" have entirely different histories.
8 changed files with 2412 additions and 81568 deletions
34
.github/workflows/release.yml
vendored
34
.github/workflows/release.yml
vendored
|
|
@ -35,35 +35,7 @@ jobs:
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
with:
|
with:
|
||||||
files:
|
files: grammar-with-artifacts.zip
|
||||||
grammar-with-artifacts.zip
|
make_latest: true
|
||||||
|
|
||||||
# release:
|
|
||||||
# needs: build
|
|
||||||
# runs-on: ubuntu-latest
|
|
||||||
# steps:
|
|
||||||
# - name: Download the artifact
|
|
||||||
# uses: actions/download-artifact@v3
|
|
||||||
# with:
|
|
||||||
# name: tree-sitter-grammar-release
|
|
||||||
#
|
|
||||||
# - name: Create GitHub Release
|
|
||||||
# id: create_release
|
|
||||||
# uses: actions/create-release@v1
|
|
||||||
# env:
|
|
||||||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
|
|
||||||
# with:
|
|
||||||
# tag_name: v${{ github.run_number }}
|
|
||||||
# release_name: Release v${{ github.run_number }}
|
|
||||||
# draft: false
|
|
||||||
# prerelease: false
|
|
||||||
#
|
|
||||||
# - name: Upload zip file to GitHub release
|
|
||||||
# uses: actions/upload-release-asset@v1
|
|
||||||
# with:
|
|
||||||
# upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
# asset_path: ./tree-sitter-grammar-release.zip
|
|
||||||
# asset_name: tree-sitter-grammar-release.zip
|
|
||||||
# asset_content_type: application/zip
|
|
||||||
#
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
#!/usr/bin/env pypy3
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import itertools
|
|
||||||
|
|
||||||
word = sys.argv[1]
|
|
||||||
if " " in word:
|
|
||||||
print("Word must contain only letters in the alphabet.")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
word_versions = tuple(zip(word.lower(), word.upper()))
|
|
||||||
|
|
||||||
capitalization_index_sets = itertools.product((0, 1), repeat=len(word))
|
|
||||||
for capitalization_index_set in capitalization_index_sets:
|
|
||||||
combined_word = ""
|
|
||||||
for i, capitalization_index in enumerate(capitalization_index_set):
|
|
||||||
combined_word += word_versions[i][capitalization_index]
|
|
||||||
|
|
||||||
print('"' + combined_word + '"')
|
|
||||||
1457
grammar.js
1457
grammar.js
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "tree-sitter-zanscript",
|
"name": "tree-sitter-zanscript",
|
||||||
"version": "3.0.0",
|
"version": "1.0.0",
|
||||||
"description": "Zanscript grammar for tree-sitter",
|
"description": "Zanscript grammar for tree-sitter",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"types": "bindings/node",
|
"types": "bindings/node",
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,46 @@
|
||||||
; highlights.scm
|
; highlights.scm
|
||||||
|
|
||||||
(comment) @comment
|
[
|
||||||
(variable) @variable
|
"DEFINE"
|
||||||
(match) @constant.macro
|
"define"
|
||||||
(identifier) @constant
|
"Define"
|
||||||
(number) @number
|
] @keyword.directive.define
|
||||||
(string) @string
|
|
||||||
(function name: (identifier) @function.builtin)
|
[
|
||||||
(action name: (identifier) @function)
|
"INCLUDE"
|
||||||
(detector invoked_action: (identifier) @function.call)
|
"include"
|
||||||
(invoke invoked_action: (identifier) @function.call)
|
"Include"
|
||||||
(select first_action: (identifier) @function.call)
|
] @keyword.import
|
||||||
(select second_action: (identifier) @function.call)
|
|
||||||
|
[
|
||||||
|
"ACTION"
|
||||||
|
"action"
|
||||||
|
"Action"
|
||||||
|
"COMPLETE"
|
||||||
|
"complete"
|
||||||
|
"Complete"
|
||||||
|
] @keyword.function
|
||||||
|
|
||||||
|
[
|
||||||
|
"IF"
|
||||||
|
"if"
|
||||||
|
"If"
|
||||||
|
"ELSE"
|
||||||
|
"else"
|
||||||
|
"Else"
|
||||||
|
"ENDIF"
|
||||||
|
"endif"
|
||||||
|
"Endif"
|
||||||
|
] @keyword.conditional
|
||||||
|
|
||||||
|
[
|
||||||
|
"WHILE"
|
||||||
|
"while"
|
||||||
|
"While"
|
||||||
|
"ENDWHILE"
|
||||||
|
"endwhile"
|
||||||
|
"Endwhile"
|
||||||
|
] @keyword.repeat
|
||||||
|
|
||||||
[
|
[
|
||||||
"+"
|
"+"
|
||||||
|
|
@ -30,18 +59,11 @@
|
||||||
")"
|
")"
|
||||||
] @punctuation.bracket
|
] @punctuation.bracket
|
||||||
|
|
||||||
; case insensitive
|
(comment) @comment
|
||||||
|
(variable) @variable
|
||||||
(define_insensitive) @keyword.directive.define
|
(match) @constant.macro
|
||||||
(include_insensitive) @keyword.import
|
(identifier) @constant
|
||||||
(action_insensitive) @keyword.function
|
(number) @number
|
||||||
(complete_insensitive) @keyword.function
|
(string) @string
|
||||||
(if_insensitive) @keyword.conditional
|
(function name: (identifier) @function.call)
|
||||||
(else_insensitive) @keyword.conditional
|
(action name: (identifier) @function)
|
||||||
(elseif_insensitive) @keyword.conditional
|
|
||||||
(endif_insensitive) @keyword.conditional
|
|
||||||
(while_insensitive) @keyword.repeat
|
|
||||||
(endwhile_insensitive) @keyword.repeat
|
|
||||||
(detector_insensitive) @function.builtin
|
|
||||||
(invoke_insensitive) @function.builtin
|
|
||||||
(select_insensitive) @function.builtin
|
|
||||||
|
|
|
||||||
5614
src/grammar.json
generated
5614
src/grammar.json
generated
File diff suppressed because it is too large
Load diff
5345
src/node-types.json
generated
5345
src/node-types.json
generated
File diff suppressed because it is too large
Load diff
71433
src/parser.c
generated
71433
src/parser.c
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue