[vala] Support regular expression literals after more tokens
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] Support regular expression literals after more tokens
- Date: Wed, 28 Apr 2010 12:31:21 +0000 (UTC)
commit 6c514337b6c696438ecbd14d1d1fbebf2bbdc036
Author: Jukka-Pekka Iivonen <jp0409 jippii fi>
Date: Wed Apr 28 14:01:14 2010 +0200
Support regular expression literals after more tokens
Fixes bug 615558.
vala/valascanner.vala | 26 +++++++++++++++++++++++---
1 files changed, 23 insertions(+), 3 deletions(-)
---
diff --git a/vala/valascanner.vala b/vala/valascanner.vala
index 3a05b5c..420530c 100644
--- a/vala/valascanner.vala
+++ b/vala/valascanner.vala
@@ -1016,18 +1016,38 @@ public class Vala.Scanner {
}
break;
case '/':
- if (previous == TokenType.OPEN_PARENS || previous == TokenType.ASSIGN || previous == TokenType.OP_COALESCING
- || previous == TokenType.COMMA || previous == TokenType.RETURN || previous == TokenType.OPEN_BRACE) {
+ switch (previous) {
+ case TokenType.ASSIGN:
+ case TokenType.COMMA:
+ case TokenType.MINUS:
+ case TokenType.OP_AND:
+ case TokenType.OP_COALESCING:
+ case TokenType.OP_DEC:
+ case TokenType.OP_EQ:
+ case TokenType.OP_GE:
+ case TokenType.OP_GT:
+ case TokenType.OP_INC:
+ case TokenType.OP_LE:
+ case TokenType.OP_LT:
+ case TokenType.OP_NE:
+ case TokenType.OP_NEG:
+ case TokenType.OP_OR:
+ case TokenType.OPEN_BRACE:
+ case TokenType.OPEN_PARENS:
+ case TokenType.PLUS:
+ case TokenType.RETURN:
type = TokenType.OPEN_REGEX_LITERAL;
state_stack += State.REGEX_LITERAL;
current++;
- } else {
+ break;
+ default:
type = TokenType.DIV;
current++;
if (current < end && current[0] == '=') {
type = TokenType.ASSIGN_DIV;
current++;
}
+ break;
}
break;
case '%':
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]