mirror of
https://github.com/NixOS/nix
synced 2025-06-28 22:01:15 +02:00
Allow the leading component of a path to be a ~
This commit is contained in:
parent
1816ac0db1
commit
e0953d53de
3 changed files with 19 additions and 2 deletions
|
@ -80,6 +80,7 @@ static Expr * unescapeStr(SymbolTable & symbols, const char * s)
|
|||
ID [a-zA-Z\_][a-zA-Z0-9\_\'\-]*
|
||||
INT [0-9]+
|
||||
PATH [a-zA-Z0-9\.\_\-\+]*(\/[a-zA-Z0-9\.\_\-\+]+)+
|
||||
HPATH \~(\/[a-zA-Z0-9\.\_\-\+]+)+
|
||||
SPATH \<[a-zA-Z0-9\.\_\-\+]+(\/[a-zA-Z0-9\.\_\-\+]+)*\>
|
||||
URI [a-zA-Z][a-zA-Z0-9\+\-\.]*\:[a-zA-Z0-9\%\/\?\:\@\&\=\+\$\,\-\_\.\!\~\*\']+
|
||||
|
||||
|
@ -159,6 +160,7 @@ or { return OR_KW; }
|
|||
<IND_STRING>. return yytext[0]; /* just in case: shouldn't be reached */
|
||||
|
||||
{PATH} { yylval->path = strdup(yytext); return PATH; }
|
||||
{HPATH} { yylval->path = strdup(yytext); return HPATH; }
|
||||
{SPATH} { yylval->path = strdup(yytext); return SPATH; }
|
||||
{URI} { yylval->uri = strdup(yytext); return URI; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue