diff --git a/nixd/lib/Syntax/Parser/Parser.y b/nixd/lib/Syntax/Parser/Parser.y index 340d409aa..5e8dd20c9 100644 --- a/nixd/lib/Syntax/Parser/Parser.y +++ b/nixd/lib/Syntax/Parser/Parser.y @@ -45,10 +45,11 @@ %type start expr expr_function expr_if expr_op expr_select expr_simple %type string_parts +%type string_attr %type string ind_string; %type string_parts_interpolated %type string_parts_interp_expr -%type identifier +%type identifier attr %type ind_string_parts %type formals %type formal @@ -393,14 +394,21 @@ attrpath attr - : identifier - | OR_KW + : identifier { + $$ = $1; + } + | OR_KW { + auto Or = Data->State.Symbols.create("or"); + $$ = decorateNode(new Identifier { + .Symbol = Or + }, yylloc, *Data); + } string_attr - : '"' string_parts '"' - | string_parts_interp_expr + : '"' string_parts '"' { $$ = $2; } + | string_parts_interp_expr { $$ = $1; } expr_list