tvl-depot/users/tazjin/presentations/tvix-eval-2023/cppnix-example-lexer.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
364 B
C++
Raw Permalink Normal View History

attrpath
: attrpath '.' attr {
$$ = $1; $1->push_back(AttrName(data->symbols.create($3)));
}
| attrpath '.' string_attr
{ $$ = $1;
ExprString * str = dynamic_cast<ExprString *>($3);
if (str) {
$$->push_back(AttrName(data->symbols.create(str->s)));
delete str;
} else
$$->push_back(AttrName($3));
}