]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Parse `sealed' declaration modifier
authorJürg Billeter <j@bitron.ch>
Sun, 18 Jul 2010 09:24:38 +0000 (11:24 +0200)
committerJürg Billeter <j@bitron.ch>
Sun, 18 Jul 2010 09:24:38 +0000 (11:24 +0200)
vala/valaparser.vala
vala/valascanner.vala
vala/valatokentype.vala

index 391bbb45388b7ea874b563ca53143e587797ed8c..78aecc5244a1eb6226931fc5badddb23f825e43d 100644 (file)
@@ -57,7 +57,8 @@ public class Vala.Parser : CodeVisitor {
                OVERRIDE = 1 << 5,
                STATIC = 1 << 6,
                VIRTUAL = 1 << 7,
-               ASYNC = 1 << 8
+               ASYNC = 1 << 8,
+               SEALED = 1 << 9
        }
 
        public Parser () {
@@ -221,6 +222,7 @@ public class Vala.Parser : CodeVisitor {
                case TokenType.REF:
                case TokenType.REQUIRES:
                case TokenType.RETURN:
+               case TokenType.SEALED:
                case TokenType.SET:
                case TokenType.SIGNAL:
                case TokenType.SIZEOF:
@@ -2210,6 +2212,7 @@ public class Vala.Parser : CodeVisitor {
                        case TokenType.PRIVATE:
                        case TokenType.PROTECTED:
                        case TokenType.PUBLIC:
+                       case TokenType.SEALED:
                        case TokenType.SIGNAL:
                        case TokenType.STATIC:
                        case TokenType.STRUCT:
@@ -3157,6 +3160,10 @@ public class Vala.Parser : CodeVisitor {
                                next ();
                                flags |= ModifierFlags.EXTERN;
                                break;
+                       case TokenType.SEALED:
+                               next ();
+                               flags |= ModifierFlags.SEALED;
+                               break;
                        case TokenType.STATIC:
                                next ();
                                flags |= ModifierFlags.STATIC;
@@ -3199,6 +3206,10 @@ public class Vala.Parser : CodeVisitor {
                                next ();
                                flags |= ModifierFlags.OVERRIDE;
                                break;
+                       case TokenType.SEALED:
+                               next ();
+                               flags |= ModifierFlags.SEALED;
+                               break;
                        case TokenType.STATIC:
                                next ();
                                flags |= ModifierFlags.STATIC;
@@ -3492,6 +3503,7 @@ public class Vala.Parser : CodeVisitor {
                case TokenType.PRIVATE:
                case TokenType.PROTECTED:
                case TokenType.PUBLIC:
+               case TokenType.SEALED:
                case TokenType.SIGNAL:
                case TokenType.STATIC:
                case TokenType.STRUCT:
index 3d2ebecee3debe3da09684e7c312c462d949fa9f..0f097e8a61696621425515f31cc49567da490b45 100644 (file)
@@ -417,6 +417,9 @@ public class Vala.Scanner {
                                break;
                        case 's':
                                switch (begin[1]) {
+                               case 'e':
+                                       if (matches (begin, "sealed")) return TokenType.SEALED;
+                                       break;
                                case 'i':
                                        switch (begin[2]) {
                                        case 'g':
index 8a246841f79cf9c4c6ea6c61d2433fd5c58bbfd7..91b50b95acf2a2269e8b2d25cb77fba1eec7869c 100644 (file)
@@ -1,6 +1,6 @@
 /* valatokentype.vala
  *
- * Copyright (C) 2008-2009  Jürg Billeter
+ * Copyright (C) 2008-2010  Jürg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -125,6 +125,7 @@ public enum Vala.TokenType {
        REGEX_LITERAL,
        REQUIRES,
        RETURN,
+       SEALED,
        SEMICOLON,
        SET,
        SIGNAL,
@@ -250,6 +251,7 @@ public enum Vala.TokenType {
                case REGEX_LITERAL: return "regex literal";
                case REQUIRES: return "`requires'";
                case RETURN: return "`return'";
+               case SEALED: return "`sealed'";
                case SEMICOLON: return "`;'";
                case SET: return "`set'";
                case SIGNAL: return "`signal'";