diff --git a/parser/parser_yacc.y b/parser/parser_yacc.y index 0447e23a2..e6a042353 100644 --- a/parser/parser_yacc.y +++ b/parser/parser_yacc.y @@ -193,7 +193,7 @@ struct codomain *do_local_profile(struct codomain *cod, char *name, int mode, in %% -list: aliaslist varlist profilelist +list: preamble profilelist { /* nothing */ }; profilelist: { /* nothing */ }; @@ -260,8 +260,9 @@ profile: opt_profile_flag TOK_COLON TOK_ID TOK_COLON TOK_ID flags TOK_OPEN rules $$ = cod; }; -aliaslist: { /* nothing */ } - | aliaslist alias { /* nothing */ }; +preamble: { /* nothing */ } + | preamble alias { /* nothing */ }; + | preamble varassign { /* nothing */ }; alias: TOK_ALIAS TOK_ID TOK_ARROW TOK_ID TOK_END_OF_RULE { @@ -271,11 +272,6 @@ alias: TOK_ALIAS TOK_ID TOK_ARROW TOK_ID TOK_END_OF_RULE free($4); }; -varlist: { /* nothing */ } - -varlist: varlist varassign - { /* nothing */ } - varassign: TOK_SET_VAR TOK_EQUALS valuelist { struct value_list *list = $3; diff --git a/parser/tst/simple_tests/alias_good_2.sd b/parser/tst/simple_tests/alias_good_2.sd new file mode 100644 index 000000000..e04e46801 --- /dev/null +++ b/parser/tst/simple_tests/alias_good_2.sd @@ -0,0 +1,17 @@ +#=DESCRIPTION Simple test of alias functionality after var defn +#=EXRESULT PASS + +alias /etc -> /Etcetera, + +@{FOO}= foo bar + +alias /tmp -> /var/tmp, + +@{MEEP} = meep moop + +alias /usr -> /User, + +/bin/foo { + #include + /tmp/@{FOO}/@{MEEP} rw, +}