File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -457,7 +457,7 @@ in the target code file.
457457 )
458458 ) ,
459459
460- number : $ => / \d + / ,
460+ number : $ => seq ( optional ( '-' ) , / \d + / ) ,
461461
462462 comment : $ => token ( prec ( - 1 , seq (
463463 '--' ,
Original file line number Diff line number Diff line change 11import logging
22import sys
33from pathlib import Path
4+ from ctypes import cdll , c_void_p
5+ from os import fspath
46
57from tree_sitter import Language
68
@@ -25,5 +27,8 @@ def language() -> Language:
2527 raise OSError (f"Unsupported platform: { sys .platform } " )
2628
2729 language_path = str ((_ROOT_DIR / lib_name ).absolute ())
28- logger .warning (f"[{ __name__ } ] Loading native CEDARScript parsing library from { language_path } " )
29- return Language (language_path , "CEDARScript" )
30+ logger .warning (f"[{ __name__ } ] Loading native CEDARScript parsing lib from { language_path } " )
31+ lang_name = 'CEDARScript'
32+ language_function = getattr (cdll .LoadLibrary (fspath (language_path )), f"tree_sitter_{ lang_name } " )
33+ language_function .restype = c_void_p
34+ return Language (language_function (), name = lang_name )
You can’t perform that action at this time.
0 commit comments