Vala.SourceFile uses GLib.MappedFile.get_contents () to read a source
file. This can return null if the file is empty.
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=633083
public TokenType read_token (out SourceLocation token_begin, out SourceLocation token_end) {
-
+ if (current == null) {
+ token_begin = SourceLocation (current, line, column);
+ token_end = SourceLocation (current, line, column);
+ return TokenType.EOF;
+ }
if (in_template ()) {
return read_template_token (out token_begin, out token_end);