tvl-depot/users/tazjin/presentations/tvix-eval-2023/cppnix-example-lexer.cpp
Vincent Ambo eb0b33db72 feat(tazjin/presentations): bootstrap tvix-eval-2023 presentation
I spent way too much time fighting LaTeX to do roughly what I want
here again, but all the alternatives are even worse.

Change-Id: Ibe12a4ce175ceb73e9d6e276613dcd4827dd76c4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9150
Autosubmit: tazjin <tazjin@tvl.su>
Reviewed-by: Mark Shevchenko <markshevchenko@gmail.com>
Tested-by: BuildkiteCI
2023-09-01 13:50:32 +00:00

13 lines
364 B
C++

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));
}