Skip to content

Commit

Permalink
Prep for token tools update
Browse files Browse the repository at this point in the history
  • Loading branch information
Moosems committed Sep 7, 2024
1 parent 89be73b commit dbcdec9
Show file tree
Hide file tree
Showing 8 changed files with 183 additions and 166 deletions.
2 changes: 1 addition & 1 deletion albero/languages/arduino.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# from tree_sitter_arduino import language as arduino_language (issue opened https://github.com/tree-sitter-grammars/tree-sitter-arduino/issues/30)
from tree_sitter_arduino import language as arduino_language
5 changes: 2 additions & 3 deletions albero/languages/compile_languages.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from beartype.typing import Callable
from tree_sitter import Language

from .arduino import arduino_language
from .bash import bash_language
from .c import c_language
from .c_sharp import c_sharp_language
Expand Down Expand Up @@ -31,8 +32,6 @@
from .wgsl_bevy import wgsl_bevy_language
from .yaml import yaml_language

# from .arduino import arduino_language

language_functions: dict[str, Callable] = {
"starlark": starlark_language,
"commonlisp": commonlisp_language,
Expand All @@ -47,7 +46,7 @@
"php": php_language,
"cuda": cuda_language,
"pymanifest": pymanifest_language,
# "arduino": arduino_language,
"arduino": arduino_language,
"css": css_language,
"embedded_template": embedded_template_language,
"jsdoc": jsdoc_language,
Expand Down
11 changes: 9 additions & 2 deletions albero/languages/java.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,24 @@
java_mapping: dict[str, str] = {
"block_comment": "Comment",
"line_comment": "Comment",
"abstract": "Keyword",
"assert": "Keyword",
"boolean": "Keyword",
"boolean_type": "Keyword",
"break": "Keyword",
"byte": "Keyword",
"case": "Keyword",
"catch": "Keyword",
"char": "Keyword",
"class": "Keyword",
"do": "Keyword",
"default": "Keyword",
"double": "Keyword",
"else": "Keyword",
"extends": "Keyword",
"false": "Keyword",
"final": "Keyword",
"finally": "Keyword",
"float": "Keyword",
"for": "Keyword",
"if": "Keyword",
Expand All @@ -33,6 +38,7 @@
"return": "Keyword",
"short": "Keyword",
"static": "Keyword",
"switch": "Keyword",
"super": "Keyword",
"this": "Keyword",
"throw": "Keyword",
Expand All @@ -41,8 +47,8 @@
"try": "Keyword",
"void_type": "Keyword",
"while": "Keyword",
"identifier": "Name",
"type_identifier": "Name",
"identifier": "Identifier",
"type_identifier": "Identifier",
"decimal_floating_point_literal": "Number",
"decimal_integer_literal": "Number",
"!": "Operator",
Expand All @@ -67,6 +73,7 @@
">=": "Operator",
"?": "Operator",
"||": "Operator",
"@": "Operator",
"(": "Punctuation",
")": "Punctuation",
",": "Punctuation",
Expand Down
6 changes: 4 additions & 2 deletions albero/languages/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"true": "Keyword",
"while": "Keyword",
"with": "Keyword",
"@": "Name",
"identifier": "Name",
"@": "Identifier",
"identifier": "Identifier",
"float": "Number",
"finally": "Number",
"integer": "Number",
Expand All @@ -52,6 +52,8 @@
"/=": "Operator",
"<": "Operator",
"<=": "Operator",
"%": "Operator",
"%=": "Operator",
"=": "Operator",
"==": "Operator",
">": "Operator",
Expand Down
Loading

0 comments on commit dbcdec9

Please sign in to comment.