Skip to content

Commit

Permalink
chore: handle errors when parsing filetype
Browse files Browse the repository at this point in the history
  • Loading branch information
danielo515 committed May 1, 2023
1 parent 0e2fd51 commit f617f9a
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tools/ReadNvimApi.hx
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,19 @@ class ReadNvimApi {
final filetypeContent = File.getBytes(Path.join([path, 'lua', 'vim', 'filetype.lua']));
final parser = new LuaParser(ByteData.ofBytes(filetypeContent), 'filetype.lua');
var parsed = parser.parse();
Log.print2("parsed=====>", parsed);
while (parsed != Tok.Eof) {
parsed = parser.parse();
Log.print2("parsed=====>", parsed);
final fileTypeTypes = [];
try {
while (parsed != Tok.Eof) {
fileTypeTypes.push(parsed);
parsed = parser.parse();
}
}
catch (e) {
Log.print2("Failed while parsing filetype.lua: ", e);
}
trace("NO more");
// writeFile('./res/filetype.json', filetype);
Log.print2("parsed =====> ", fileTypeTypes);
Log.print("===== Parsing done ===== ");
// writeFile('./res/filetype.json', fileTypeTypes);

case Error(error):
Sys.println("Could not get neovim path, skip parsing");
Expand Down

0 comments on commit f617f9a

Please sign in to comment.