pike.git/
src/
language.yacc
Branch:
Tag:
Non-build tags
All tags
No tags
2011-07-07
2011-07-07 13:53:51 by Henrik Grubbström (Grubba) <grubba@grubba.org>
bbd892a86e2f103ea5cf21199c7f2c19f6214ddd (
47
lines) (+
24
/-
23
)
[
Show
|
Annotate
]
Branch:
7.9
Minor parser restructuring.
3928:
copy_shared_string(Pike_compiler->last_identifier, $3->u.sval.u.string); free_node($3); }
-
| '.' TOK_IDENTIFIER
-
{
-
struct pike_string *dot;
-
MAKE_CONST_STRING(dot, ".");
-
if (call_handle_import(dot)) {
-
node *tmp=mkconstantsvaluenode(Pike_sp-1);
-
pop_stack();
-
$$=index_node(tmp, ".", $2->u.sval.u.string);
-
free_node(tmp);
-
}
-
else
-
$$=mknewintnode(0);
-
if(Pike_compiler->last_identifier) free_string(Pike_compiler->last_identifier);
-
copy_shared_string(Pike_compiler->last_identifier, $2->u.sval.u.string);
-
free_node($2);
-
}
-
| TOK_GLOBAL '.' TOK_IDENTIFIER
-
{
-
$$ = resolve_identifier ($3->u.sval.u.string);
-
if(Pike_compiler->last_identifier) free_string(Pike_compiler->last_identifier);
-
copy_shared_string(Pike_compiler->last_identifier, $3->u.sval.u.string);
-
free_node ($3);
-
}
+
| idents '.' bad_identifier {} | idents '.' error {} ;
4061:
} free_node($1); }
+
| '.' TOK_IDENTIFIER
+
{
+
struct pike_string *dot;
+
MAKE_CONST_STRING(dot, ".");
+
if (call_handle_import(dot)) {
+
node *tmp=mkconstantsvaluenode(Pike_sp-1);
+
pop_stack();
+
$$=index_node(tmp, ".", $2->u.sval.u.string);
+
free_node(tmp);
+
}
+
else
+
$$=mknewintnode(0);
+
if(Pike_compiler->last_identifier) free_string(Pike_compiler->last_identifier);
+
copy_shared_string(Pike_compiler->last_identifier, $2->u.sval.u.string);
+
free_node($2);
+
}
+
| TOK_GLOBAL '.' TOK_IDENTIFIER
+
{
+
$$ = resolve_identifier ($3->u.sval.u.string);
+
if(Pike_compiler->last_identifier) free_string(Pike_compiler->last_identifier);
+
copy_shared_string(Pike_compiler->last_identifier, $3->u.sval.u.string);
+
free_node ($3);
+
}
| TOK_RESERVED { ref_push_string($1->u.sval.u.string);