fix: fix issues

- fix BMapBindings generator due to the rename of LIBCMO_EXPORT -> BMAP_EXPORT.
- fix relative path issue in Python scripts within CodeGen.
- remove all references to LIBCMO_PANIC. use exception instead to tell user they are fool.
- basically finish universal encoding tables. add lost encoding name.
This commit is contained in:
2024-08-17 23:29:08 +08:00
parent e682a87d25
commit 9903b61cac
12 changed files with 49 additions and 29 deletions

View File

@ -1,7 +1,7 @@
lexer grammar ExpFctsLexer;
// keywords
EXPFCTS_EXPORT: 'LIBCMO_EXPORT' ;
EXPFCTS_EXPORT: 'BMAP_EXPORT' ;
EXPFCTS_FILE_DECL: 'BMPARAM_FILE_DECL' ;
EXPFCTS_MESHTRANS_DECL: 'BMPARAM_MESHTRANS_DECL' ;
EXPFCTS_OBJECT_DECL: 'BMPARAM_OBJECT_DECL' ;

View File

@ -9,7 +9,10 @@ with open(src_file, 'r', encoding='utf-8') as fsrc:
fulltext: str = fsrc.read()
# do findall and write into file
with open(dst_file, 'w', encoding='utf-8') as fdst:
for item in re.findall('^LIBCMO_EXPORT[^;]+;', fulltext, re.MULTILINE):
# We should not only match BMAP_EXPORT,
# because it may match the defination of BMAP_EXPORT.
# So we add a bool at head because all BMap functions return bool.
for item in re.findall('^BMAP_EXPORT[ \\t]+bool[ \\t]+[^;]+;', fulltext, re.MULTILINE):
fdst.write(item)
fdst.write('\n')