Remove the __ prefix from some of the lexer tokens

fixes #7883
This commit is contained in:
Gunnar Beutner 2014-12-11 13:12:35 +01:00
parent 364f1daff8
commit e86b36f8d7
2 changed files with 47 additions and 49 deletions

View File

@ -186,13 +186,12 @@ where return T_WHERE;
import return T_IMPORT; import return T_IMPORT;
assign return T_ASSIGN; assign return T_ASSIGN;
ignore return T_IGNORE; ignore return T_IGNORE;
for return T_APPLY_FOR; function return T_FUNCTION;
__function return T_FUNCTION; return return T_RETURN;
__return return T_RETURN; for return T_FOR;
__for return T_FOR; signal return T_SIGNAL;
__signal return T_SIGNAL; if return T_IF;
__if return T_IF; else return T_ELSE;
__else return T_ELSE;
=\> return T_FOLLOWS; =\> return T_FOLLOWS;
\<\< return T_SHIFT_LEFT; \<\< return T_SHIFT_LEFT;
\>\> return T_SHIFT_RIGHT; \>\> return T_SHIFT_RIGHT;

View File

@ -166,7 +166,6 @@ static void MakeRBinaryOp(Expression** result, Expression *left, Expression *rig
%token T_IMPORT "import (T_IMPORT)" %token T_IMPORT "import (T_IMPORT)"
%token T_ASSIGN "assign (T_ASSIGN)" %token T_ASSIGN "assign (T_ASSIGN)"
%token T_IGNORE "ignore (T_IGNORE)" %token T_IGNORE "ignore (T_IGNORE)"
%token T_APPLY_FOR "for (T_APPLY_FOR)"
%token T_FUNCTION "function (T_FUNCTION)" %token T_FUNCTION "function (T_FUNCTION)"
%token T_RETURN "return (T_RETURN)" %token T_RETURN "return (T_RETURN)"
%token T_FOR "for (T_FOR)" %token T_FOR "for (T_FOR)"
@ -660,6 +659,45 @@ lterm: type
{ {
$$ = $1; $$ = $1;
} }
| T_SIGNAL identifier T_SET_ADD rterm
{
$$ = new SlotExpression($2, $4, DebugInfoRange(@1, @4));
free($2);
}
| T_FOR '(' identifier T_FOLLOWS identifier T_IN rterm ')' rterm_scope
{
DictExpression *aexpr = dynamic_cast<DictExpression *>($9);
aexpr->MakeInline();
$$ = new ForExpression($3, $5, $7, aexpr, DebugInfoRange(@1, @9));
free($3);
free($5);
}
| T_FOR '(' identifier T_IN rterm ')' rterm_scope
{
DictExpression *aexpr = dynamic_cast<DictExpression *>($7);
aexpr->MakeInline();
$$ = new ForExpression($3, "", $5, aexpr, DebugInfoRange(@1, @7));
free($3);
}
| T_IF '(' rterm ')' rterm_scope
{
DictExpression *atrue = dynamic_cast<DictExpression *>($5);
atrue->MakeInline();
$$ = new ConditionalExpression($3, atrue, NULL, DebugInfoRange(@1, @5));
}
| T_IF '(' rterm ')' rterm_scope T_ELSE rterm_scope
{
DictExpression *atrue = dynamic_cast<DictExpression *>($5);
atrue->MakeInline();
DictExpression *afalse = dynamic_cast<DictExpression *>($7);
afalse->MakeInline();
$$ = new ConditionalExpression($3, atrue, afalse, DebugInfoRange(@1, @7));
}
| rterm | rterm
{ {
$$ = $1; $$ = $1;
@ -825,45 +863,6 @@ rterm_without_indexer: T_STRING
$$ = new FunctionExpression("", *$3, $5, aexpr, DebugInfoRange(@1, @5)); $$ = new FunctionExpression("", *$3, $5, aexpr, DebugInfoRange(@1, @5));
delete $3; delete $3;
} }
| T_SIGNAL identifier T_SET_ADD rterm
{
$$ = new SlotExpression($2, $4, DebugInfoRange(@1, @4));
free($2);
}
| T_FOR '(' identifier T_FOLLOWS identifier T_IN rterm ')' rterm_scope
{
DictExpression *aexpr = dynamic_cast<DictExpression *>($9);
aexpr->MakeInline();
$$ = new ForExpression($3, $5, $7, aexpr, DebugInfoRange(@1, @9));
free($3);
free($5);
}
| T_FOR '(' identifier T_IN rterm ')' rterm_scope
{
DictExpression *aexpr = dynamic_cast<DictExpression *>($7);
aexpr->MakeInline();
$$ = new ForExpression($3, "", $5, aexpr, DebugInfoRange(@1, @7));
free($3);
}
| T_IF '(' rterm ')' rterm_scope
{
DictExpression *atrue = dynamic_cast<DictExpression *>($5);
atrue->MakeInline();
$$ = new ConditionalExpression($3, atrue, NULL, DebugInfoRange(@1, @5));
}
| T_IF '(' rterm ')' rterm_scope T_ELSE rterm_scope
{
DictExpression *atrue = dynamic_cast<DictExpression *>($5);
atrue->MakeInline();
DictExpression *afalse = dynamic_cast<DictExpression *>($7);
afalse->MakeInline();
$$ = new ConditionalExpression($3, atrue, afalse, DebugInfoRange(@1, @7));
}
; ;
target_type_specifier: /* empty */ target_type_specifier: /* empty */
@ -911,7 +910,7 @@ use_specifier_item: identifier
; ;
apply_for_specifier: /* empty */ apply_for_specifier: /* empty */
| T_APPLY_FOR '(' identifier T_FOLLOWS identifier T_IN rterm ')' | T_FOR '(' identifier T_FOLLOWS identifier T_IN rterm ')'
{ {
context->m_FKVar.top() = $3; context->m_FKVar.top() = $3;
free($3); free($3);
@ -921,7 +920,7 @@ apply_for_specifier: /* empty */
context->m_FTerm.top() = $7; context->m_FTerm.top() = $7;
} }
| T_APPLY_FOR '(' identifier T_IN rterm ')' | T_FOR '(' identifier T_IN rterm ')'
{ {
context->m_FKVar.top() = $3; context->m_FKVar.top() = $3;
free($3); free($3);