From: Gunnar Beutner Date: Sun, 30 Mar 2014 08:28:44 +0000 (+0200) Subject: Remove support for the deprecated "var" and "set" keywords. X-Git-Tag: v0.0.9~24^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a6172c135aea4c5910aa7e542729ca87623e2e4;p=icinga2 Remove support for the deprecated "var" and "set" keywords. Refs # --- diff --git a/doc/4.1-configuration-syntax.md b/doc/4.1-configuration-syntax.md index 95b312e78..e739a20c3 100644 --- a/doc/4.1-configuration-syntax.md +++ b/doc/4.1-configuration-syntax.md @@ -2,8 +2,8 @@ ### 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 - ------------------------------------|------------------------------------ - " |\\" - \\ |\\\\ - \ |\\t - \ |\\r - \ |\\n - \ |\\b - \ |\\f +Character |Escape sequence +------------------------------------|------------------------------------ +" |\\" +\\ |\\\\ +\ |\\t +\ |\\r +\ |\\n +\ |\\b +\ |\\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. ### Apply diff --git a/lib/config/config_lexer.ll b/lib/config/config_lexer.ll index ff23c3d83..1159ae6e4 100644 --- a/lib/config/config_lexer.ll +++ b/lib/config/config_lexer.ll @@ -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; diff --git a/lib/config/config_parser.yy b/lib/config/config_parser.yy index 0d093e76f..771ced99d 100644 --- a/lib/config/config_parser.yy +++ b/lib/config/config_parser.yy @@ -128,7 +128,6 @@ static void MakeRBinaryOp(Value** result, AExpression::OpCallback& op, Value *le %token T_LESS_THAN "< (T_LESS_THAN)" %token T_GREATER_THAN "> (T_GREATER_THAN)" -%token T_VAR "var (T_VAR)" %token T_CONST "const (T_CONST)" %token T_TYPE_DICTIONARY "dictionary (T_TYPE_DICTIONARY)" %token T_TYPE_ARRAY "array (T_TYPE_ARRAY)" @@ -166,7 +165,6 @@ static void MakeRBinaryOp(Value** result, AExpression::OpCallback& op, Value *le %type rterm %type rterm_scope %type lterm -%type 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(*$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 {