]> granicus.if.org Git - icinga2/commitdiff
Remove support for the deprecated "var" and "set" keywords.
authorGunnar Beutner <gunnar@beutner.name>
Sun, 30 Mar 2014 08:28:44 +0000 (10:28 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Sun, 30 Mar 2014 08:29:52 +0000 (10:29 +0200)
Refs #

doc/4.1-configuration-syntax.md
lib/config/config_lexer.ll
lib/config/config_parser.yy

index 95b312e7887b279941560a768407a5f542b06f6b..e739a20c3bc602ad8cb2d15dd6e99f09c2cc5bec 100644 (file)
@@ -2,8 +2,8 @@
 
 ### <a id="object-definition"></a> Object Definition
 
-Icinga 2 features an object-based configuration format. In order to
-define objects the `object` keyword is used:
+Icinga 2 features an object-based configuration format. You can define new
+objects using the `object` keyword:
 
     object Host "host1.example.org" {
       display_name = "host1",
@@ -66,15 +66,15 @@ Example:
 Certain characters need to be escaped. The following escape sequences
 are supported:
 
-  Character                           |Escape sequence
-  ------------------------------------|------------------------------------
-  "                                   |\\"
-  \\                                  |\\\\
-  \<TAB\>                             |\\t
-  \<CARRIAGE-RETURN\>                 |\\r
-  \<LINE-FEED\>                       |\\n
-  \<BEL\>                             |\\b
-  \<FORM-FEED\>                       |\\f
+Character                           |Escape sequence
+------------------------------------|------------------------------------
+"                                   |\\"
+\\                                  |\\\\
+\<TAB\>                             |\\t
+\<CARRIAGE-RETURN\>                 |\\r
+\<LINE-FEED\>                       |\\n
+\<BEL\>                             |\\b
+\<FORM-FEED\>                       |\\f
 
 In addition to these pre-defined escape sequences you can specify
 arbitrary ASCII characters using the backslash character (\\) followed
@@ -374,13 +374,8 @@ Global constants can be set using the `const` keyword:
 
 The value can be a string, number, array, or a dictionary.
 
-Constants cannot be changed once they are set.
-
-> **Note**
->
-> The `set` and `var` keywords are an alias for `const` and are available
-> in order to provide compatibility with older versions. Their use is
-> deprecated.
+Once defined a constant can be access from any file. Constants cannot be changed
+once they are set.
 
 ### <a id="apply"></a> Apply
 
index ff23c3d83b44618fcb7a1f4d92db0f5d06ca13d4..1159ae6e435374e0b78507b0913ff6c3b7730dcc 100644 (file)
@@ -218,8 +218,6 @@ null                                return T_NULL;
 partial                                return T_PARTIAL;
 true                           { yylval->num = 1; return T_NUMBER; }
 false                          { yylval->num = 0; return T_NUMBER; }
-set                            return T_VAR;
-var                            return T_VAR;
 const                          return T_CONST;
 apply                          return T_APPLY;
 where                          return T_WHERE;
index 0d093e76f51bb658ffeac7b4e2a22e353d19f932..771ced99db54372afa2956b28217961a365de877 100644 (file)
@@ -128,7 +128,6 @@ static void MakeRBinaryOp(Value** result, AExpression::OpCallback& op, Value *le
 %token <op> T_LESS_THAN "< (T_LESS_THAN)"
 %token <op> T_GREATER_THAN "> (T_GREATER_THAN)"
 
-%token T_VAR "var (T_VAR)"
 %token T_CONST "const (T_CONST)"
 %token <type> T_TYPE_DICTIONARY "dictionary (T_TYPE_DICTIONARY)"
 %token <type> T_TYPE_ARRAY "array (T_TYPE_ARRAY)"
@@ -166,7 +165,6 @@ static void MakeRBinaryOp(Value** result, AExpression::OpCallback& op, Value *le
 %type <variant> rterm
 %type <variant> rterm_scope
 %type <variant> lterm
-%type <num> variable_decl
 
 %left T_LOGICAL_OR
 %left T_LOGICAL_AND
@@ -228,7 +226,7 @@ statements: /* empty */
        | statements statement
        ;
 
-statement: object | type | include | include_recursive | library | variable | apply
+statement: object | type | include | include_recursive | library | constant | apply
        { }
        | lterm
        {
@@ -278,7 +276,7 @@ library: T_LIBRARY T_STRING
        }
        ;
 
-variable: variable_decl identifier T_SET rterm
+constant: T_CONST identifier T_SET rterm
        {
                AExpression::Ptr aexpr = static_cast<AExpression::Ptr>(*$4);
                delete $4;
@@ -290,16 +288,6 @@ variable: variable_decl identifier T_SET rterm
        }
        ;
 
-variable_decl: T_VAR
-       {
-               $$ = true;
-       }
-       | T_CONST
-       {
-               $$ = false;
-       }
-       ;
-
 identifier: T_IDENTIFIER
        | T_STRING
        {