Skip to content

Commit

Permalink
Show errorss
Browse files Browse the repository at this point in the history
  • Loading branch information
Moosems committed Sep 7, 2024
1 parent dbcdec9 commit e4a1e1a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions albero/languages/java.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"character_literal": "String",
"escape_sequence": "String",
"string_fragment": "String",
"ERROR": "Error",
}


Expand Down
1 change: 1 addition & 0 deletions albero/languages/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"string_content": "String",
"string_end": "String",
"string_start": "String",
"ERROR": "Error",
}


Expand Down
2 changes: 1 addition & 1 deletion albero/tree_sitter_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def node_to_tokens(

visited_nodes.add(node.id)

if node.child_count != 0:
if node.child_count != 0 and node.type != "ERROR":
continue

if node.type not in mapping:
Expand Down
2 changes: 2 additions & 0 deletions tests/test-languages/python_test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,5 @@ def break_func(self):
pass
finally: # finally
pass

def unfinished
3 changes: 3 additions & 0 deletions tests/test-languages/test_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,4 +287,7 @@ def test_basic_usage():
((88, 7), 1, "Punctuation"),
((88, 10), 9, "Comment"),
((89, 4), 4, "Keyword"),
((91, 0), 3, "Keyword"),
((91, 0), 14, "Error"),
((91, 4), 10, "Identifier"),
]

0 comments on commit e4a1e1a

Please sign in to comment.