Remove support for the deprecated "var" and "set" keywords.

Refs #
This commit is contained in:
Gunnar Beutner 2014-03-30 10:28:44 +02:00
parent 5179eebf09
commit 7a6172c135
3 changed files with 15 additions and 34 deletions

View File

@ -2,8 +2,8 @@
### <a id="object-definition"></a> Object Definition ### <a id="object-definition"></a> Object Definition
Icinga 2 features an object-based configuration format. In order to Icinga 2 features an object-based configuration format. You can define new
define objects the `object` keyword is used: objects using the `object` keyword:
object Host "host1.example.org" { object Host "host1.example.org" {
display_name = "host1", display_name = "host1",
@ -66,15 +66,15 @@ Example:
Certain characters need to be escaped. The following escape sequences Certain characters need to be escaped. The following escape sequences
are supported: are supported:
Character |Escape sequence Character |Escape sequence
------------------------------------|------------------------------------ ------------------------------------|------------------------------------
" |\\" " |\\"
\\ |\\\\ \\ |\\\\
\<TAB\> |\\t \<TAB\> |\\t
\<CARRIAGE-RETURN\> |\\r \<CARRIAGE-RETURN\> |\\r
\<LINE-FEED\> |\\n \<LINE-FEED\> |\\n
\<BEL\> |\\b \<BEL\> |\\b
\<FORM-FEED\> |\\f \<FORM-FEED\> |\\f
In addition to these pre-defined escape sequences you can specify In addition to these pre-defined escape sequences you can specify
arbitrary ASCII characters using the backslash character (\\) followed 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. The value can be a string, number, array, or a dictionary.
Constants cannot be changed once they are set. Once defined a constant can be access from any file. 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.
### <a id="apply"></a> Apply ### <a id="apply"></a> Apply

View File

@ -218,8 +218,6 @@ null return T_NULL;
partial return T_PARTIAL; partial return T_PARTIAL;
true { yylval->num = 1; return T_NUMBER; } true { yylval->num = 1; return T_NUMBER; }
false { yylval->num = 0; return T_NUMBER; } false { yylval->num = 0; return T_NUMBER; }
set return T_VAR;
var return T_VAR;
const return T_CONST; const return T_CONST;
apply return T_APPLY; apply return T_APPLY;
where return T_WHERE; where return T_WHERE;

View 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_LESS_THAN "< (T_LESS_THAN)"
%token <op> T_GREATER_THAN "> (T_GREATER_THAN)" %token <op> T_GREATER_THAN "> (T_GREATER_THAN)"
%token T_VAR "var (T_VAR)"
%token T_CONST "const (T_CONST)" %token T_CONST "const (T_CONST)"
%token <type> T_TYPE_DICTIONARY "dictionary (T_TYPE_DICTIONARY)" %token <type> T_TYPE_DICTIONARY "dictionary (T_TYPE_DICTIONARY)"
%token <type> T_TYPE_ARRAY "array (T_TYPE_ARRAY)" %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
%type <variant> rterm_scope %type <variant> rterm_scope
%type <variant> lterm %type <variant> lterm
%type <num> variable_decl
%left T_LOGICAL_OR %left T_LOGICAL_OR
%left T_LOGICAL_AND %left T_LOGICAL_AND
@ -228,7 +226,7 @@ statements: /* empty */
| statements statement | statements statement
; ;
statement: object | type | include | include_recursive | library | variable | apply statement: object | type | include | include_recursive | library | constant | apply
{ } { }
| lterm | 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); AExpression::Ptr aexpr = static_cast<AExpression::Ptr>(*$4);
delete $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 identifier: T_IDENTIFIER
| T_STRING | T_STRING
{ {