File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ def code(self):
3333 def __repr__ (self ):
3434
3535 lang = self .config .lang
36- lang_name = lang [0 ].upper () + lang [1 :]
36+ lang_name = "" . join (( lang_part [0 ].upper () + lang_part [1 :] for lang_part in lang . split ( "-" )))
3737
3838 ast_repr = ast_to_str (self .source_tree , indent = 1 )
3939
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ def load_language(lang):
5050 source_lang_path = os .path .join (cache_path , "tree-sitter-%s" % lang )
5151
5252 if os .path .isfile (compiled_lang_path ):
53- return Language (compiled_lang_path , lang )
53+ return Language (compiled_lang_path , _lang_to_fnname ( lang ) )
5454
5555 if os .path .exists (source_lang_path ) and os .path .isdir (source_lang_path ):
5656 logger .warn ("Compiling language for %s" % lang )
@@ -196,6 +196,14 @@ def _compile_lang(source_path, compiled_path):
196196 )
197197
198198
199+ def _lang_to_fnname (lang ):
200+ """
201+ dash is not supported for function names. Therefore,
202+ we assume that dashes represented by underscores.
203+ """
204+ return lang .replace ("-" , "_" )
205+
206+
199207# Auto Clone from Github --------------------------------
200208
201209def _exists_url (url ):
You can’t perform that action at this time.
0 commit comments