[vala/staging] genie: Make 'self' match its TokenType name



commit 31728fc49022ca36980266df7e0133e53214b644
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Fri Jun 14 18:04:16 2019 +0200

    genie: Make 'self' match its TokenType name

 vala/valagenieparser.vala    | 12 ++++++------
 vala/valageniescanner.vala   |  2 +-
 vala/valagenietokentype.vala |  4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/vala/valagenieparser.vala b/vala/valagenieparser.vala
index 99b4fba88..39f8f4692 100644
--- a/vala/valagenieparser.vala
+++ b/vala/valagenieparser.vala
@@ -305,12 +305,12 @@ public class Vala.Genie.Parser : CodeVisitor {
                case TokenType.REQUIRES:
                case TokenType.RETURN:
                case TokenType.SEALED:
+               case TokenType.SELF:
                case TokenType.SET:
                case TokenType.SIZEOF:
                case TokenType.STATIC:
                case TokenType.STRUCT:
                case TokenType.SUPER:
-               case TokenType.THIS:
                case TokenType.TO:
                case TokenType.TRUE:
                case TokenType.TRY:
@@ -714,7 +714,7 @@ public class Vala.Genie.Parser : CodeVisitor {
                case TokenType.OPEN_TEMPLATE:
                        expr = parse_template ();
                        break;
-               case TokenType.THIS:
+               case TokenType.SELF:
                        expr = parse_this_access ();
                        break;
                case TokenType.SUPER:
@@ -993,7 +993,7 @@ public class Vala.Genie.Parser : CodeVisitor {
 
        Expression parse_this_access () throws ParseError {
                var begin = get_location ();
-               expect (TokenType.THIS);
+               expect (TokenType.SELF);
                return new MemberAccess (null, "this", get_src (begin));
        }
 
@@ -1267,7 +1267,7 @@ public class Vala.Genie.Parser : CodeVisitor {
                                        case TokenType.TEMPLATE_STRING_LITERAL:
                                        case TokenType.VERBATIM_STRING_LITERAL:
                                        case TokenType.NULL:
-                                       case TokenType.THIS:
+                                       case TokenType.SELF:
                                        case TokenType.SUPER:
                                        case TokenType.NEW:
                                        case TokenType.SIZEOF:
@@ -1790,7 +1790,7 @@ public class Vala.Genie.Parser : CodeVisitor {
                                case TokenType.OP_INC:
                                case TokenType.OP_DEC:
                                case TokenType.SUPER:
-                               case TokenType.THIS:
+                               case TokenType.SELF:
                                case TokenType.OPEN_PARENS:
                                case TokenType.STAR:
                                case TokenType.NEW:
@@ -1894,7 +1894,7 @@ public class Vala.Genie.Parser : CodeVisitor {
                case TokenType.OP_INC:
                case TokenType.OP_DEC:
                case TokenType.SUPER:
-               case TokenType.THIS:
+               case TokenType.SELF:
                case TokenType.OPEN_PARENS:
                case TokenType.STAR:
                case TokenType.NEW:
diff --git a/vala/valageniescanner.vala b/vala/valageniescanner.vala
index 47fe17522..8fea07804 100644
--- a/vala/valageniescanner.vala
+++ b/vala/valageniescanner.vala
@@ -433,7 +433,7 @@ public class Vala.Genie.Scanner {
                                }
                                break;
                        case 's':
-                               if (matches (begin, "self")) return TokenType.THIS;
+                               if (matches (begin, "self")) return TokenType.SELF;
                                break;
                        case 't':
                                if (matches (begin, "true")) return TokenType.TRUE;
diff --git a/vala/valagenietokentype.vala b/vala/valagenietokentype.vala
index a34c40985..6bde090b6 100644
--- a/vala/valagenietokentype.vala
+++ b/vala/valagenietokentype.vala
@@ -144,6 +144,7 @@ public enum Vala.Genie.TokenType {
        REQUIRES,
        RETURN,
        SEALED,
+       SELF,
        SEMICOLON,
        SET,
        SIZEOF,
@@ -153,7 +154,6 @@ public enum Vala.Genie.TokenType {
        STRUCT,
        SUPER,
        TEMPLATE_STRING_LITERAL,
-       THIS,
        TILDE,
        TO,
        TRUE,
@@ -292,6 +292,7 @@ public enum Vala.Genie.TokenType {
                case REQUIRES: return "`requires'";
                case RETURN: return "`return'";
                case SEALED: return "`sealed'";
+               case SELF: return "`self'";
                case SEMICOLON: return "`;'";
                case SET: return "`set'";
                case SIZEOF: return "`sizeof'";
@@ -301,7 +302,6 @@ public enum Vala.Genie.TokenType {
                case STRUCT: return "`struct'";
                case SUPER: return "`super'";
                case TEMPLATE_STRING_LITERAL: return "template string literal";
-               case THIS: return "`self'";
                case TILDE: return "`~'";
                case TO: return "`to'";
                case TRUE: return "`true'";


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]