lib/antlr4-native/context.rb in antlr4-native-1.0.2 vs lib/antlr4-native/context.rb in antlr4-native-1.1.0
- old
+ new
@@ -146,9 +146,14 @@
if (orig == nullptr) {
return Qnil;
}
auto token = ((#{parser_ns}::#{name}*)orig) -> #{token_mtd.name}(#{params});
+
+ if (token == nullptr) {
+ return Qnil;
+ }
+
TerminalNodeProxy proxy(token);
return to_ruby(proxy);
}
END
end