From 5ef600593588fe036931edb14df1efddf4f6b3a8 Mon Sep 17 00:00:00 2001 From: DrSlump Date: Mon, 21 Oct 2013 18:28:25 +0200 Subject: [PATCH 1/2] Allow white space and single line comments after continuation characters --- src/Boo.Lang.Parser/boo.g | 2 +- src/Boo.Lang.Parser/wsaboo.g | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Boo.Lang.Parser/boo.g b/src/Boo.Lang.Parser/boo.g index 450bd42b9..cc5052b5a 100755 --- a/src/Boo.Lang.Parser/boo.g +++ b/src/Boo.Lang.Parser/boo.g @@ -3436,7 +3436,7 @@ protected ID_SUFFIX: ; LINE_CONTINUATION: - '\\'! NEWLINE + '\\' (' '|'\t')* (SL_COMMENT)? NEWLINE { $setType(Token.SKIP); } ; diff --git a/src/Boo.Lang.Parser/wsaboo.g b/src/Boo.Lang.Parser/wsaboo.g index e936abaa5..40a72a5e1 100755 --- a/src/Boo.Lang.Parser/wsaboo.g +++ b/src/Boo.Lang.Parser/wsaboo.g @@ -3167,7 +3167,7 @@ protected ID_SUFFIX: ; LINE_CONTINUATION: - '\\'! NEWLINE + '\\' (' '|'\t')* (SL_COMMENT)? NEWLINE { $setType(Token.SKIP); } ; From d4258efedbd9e2e5ce2e9feea810355f44f5e1bd Mon Sep 17 00:00:00 2001 From: DrSlump Date: Mon, 21 Oct 2013 19:04:09 +0200 Subject: [PATCH 2/2] Allow empty and commented lines in between --- src/Boo.Lang.Parser/boo.g | 10 ++++++++-- src/Boo.Lang.Parser/wsaboo.g | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Boo.Lang.Parser/boo.g b/src/Boo.Lang.Parser/boo.g index cc5052b5a..00171f540 100755 --- a/src/Boo.Lang.Parser/boo.g +++ b/src/Boo.Lang.Parser/boo.g @@ -3436,10 +3436,16 @@ protected ID_SUFFIX: ; LINE_CONTINUATION: - '\\' (' '|'\t')* (SL_COMMENT)? NEWLINE + '\\' + ( + NEWLINE + | (' ' | '\t')+ + | SL_COMMENT + | ML_COMMENT + )+ { $setType(Token.SKIP); } ; - + INT : ("0x"(HEXDIGIT)+)(('l' | 'L') { $setType(LONG); })? | DIGIT_GROUP diff --git a/src/Boo.Lang.Parser/wsaboo.g b/src/Boo.Lang.Parser/wsaboo.g index 40a72a5e1..d32f5623a 100755 --- a/src/Boo.Lang.Parser/wsaboo.g +++ b/src/Boo.Lang.Parser/wsaboo.g @@ -3167,9 +3167,15 @@ protected ID_SUFFIX: ; LINE_CONTINUATION: - '\\' (' '|'\t')* (SL_COMMENT)? NEWLINE + '\\' + ( + NEWLINE + | (' ' | '\t')+ + | SL_COMMENT + | ML_COMMENT + )+ { $setType(Token.SKIP); } - ; + ; INT : ("0x"(HEXDIGIT)+)(('l' | 'L') { $setType(LONG); })? |