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.
457
457
)
458
458
) ,
459
459
460
- number : $ => / \d + / ,
460
+ number : $ => seq ( optional ( '-' ) , / \d + / ) ,
461
461
462
462
comment : $ => token ( prec ( - 1 , seq (
463
463
'--' ,
Original file line number Diff line number Diff line change 1
1
import logging
2
2
import sys
3
3
from pathlib import Path
4
+ from ctypes import cdll , c_void_p
5
+ from os import fspath
4
6
5
7
from tree_sitter import Language
6
8
@@ -25,5 +27,8 @@ def language() -> Language:
25
27
raise OSError (f"Unsupported platform: { sys .platform } " )
26
28
27
29
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