[vala/wip/ricotz/lsp-rev: 12/15] parser: Make parse_identifier more robust
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/ricotz/lsp-rev: 12/15] parser: Make parse_identifier more robust
- Date: Tue, 21 Jan 2020 07:15:32 +0000 (UTC)
commit 4234dcc00bd0435f44f7586344772683084357c1
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sat Jan 18 20:03:37 2020 +0100
parser: Make parse_identifier more robust
vala/valaparser.vala | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index e862458be..0c31ffc72 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -281,7 +281,17 @@ public class Vala.Parser : CodeVisitor {
}
string parse_identifier () throws ParseError {
- skip_identifier ();
+ try {
+ skip_identifier ();
+ } catch (ParseError e) {
+ if (context.keep_going) {
+ report_parse_error (e);
+ prev ();
+ return "";
+ } else {
+ throw e;
+ }
+ }
return get_last_string ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]