mirror of
https://github.com/elladunbar/tree-sitter-zanscript.git
synced 2025-11-05 23:29:54 -06:00
More case insensitivity and additional function highlighting
This commit is contained in:
parent
1fbd9b65cf
commit
3c14e31805
6 changed files with 77943 additions and 2439 deletions
19
generate_case_insensitive.py
Executable file
19
generate_case_insensitive.py
Executable file
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/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 + '"')
|
||||||
1447
grammar.js
1447
grammar.js
File diff suppressed because it is too large
Load diff
|
|
@ -1,46 +1,17 @@
|
||||||
; highlights.scm
|
; highlights.scm
|
||||||
|
|
||||||
[
|
(comment) @comment
|
||||||
"DEFINE"
|
(variable) @variable
|
||||||
"define"
|
(match) @constant.macro
|
||||||
"Define"
|
(identifier) @constant
|
||||||
] @keyword.directive.define
|
(number) @number
|
||||||
|
(string) @string
|
||||||
[
|
(function name: (identifier) @function.builtin)
|
||||||
"INCLUDE"
|
(action name: (identifier) @function)
|
||||||
"include"
|
(detector invoked_action: (identifier) @function.call)
|
||||||
"Include"
|
(invoke invoked_action: (identifier) @function.call)
|
||||||
] @keyword.import
|
(select first_action: (identifier) @function.call)
|
||||||
|
(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
|
|
||||||
|
|
||||||
[
|
[
|
||||||
"+"
|
"+"
|
||||||
|
|
@ -59,11 +30,18 @@
|
||||||
")"
|
")"
|
||||||
] @punctuation.bracket
|
] @punctuation.bracket
|
||||||
|
|
||||||
(comment) @comment
|
; case insensitive
|
||||||
(variable) @variable
|
|
||||||
(match) @constant.macro
|
(define_insensitive) @keyword.directive.define
|
||||||
(identifier) @constant
|
(include_insensitive) @keyword.import
|
||||||
(number) @number
|
(action_insensitive) @keyword.function
|
||||||
(string) @string
|
(complete_insensitive) @keyword.function
|
||||||
(function name: (identifier) @function.call)
|
(if_insensitive) @keyword.conditional
|
||||||
(action name: (identifier) @function)
|
(else_insensitive) @keyword.conditional
|
||||||
|
(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
|
||||||
|
|
|
||||||
5581
src/grammar.json
generated
5581
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
67914
src/parser.c
generated
67914
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