1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 02:11:15 +02:00

* string2ATerm -> overloaded toATerm.

This commit is contained in:
Eelco Dolstra 2004-11-03 18:12:03 +00:00
parent 4cbd845aa4
commit cb7ccb528b
10 changed files with 61 additions and 43 deletions

View file

@ -31,9 +31,14 @@ void yyerror(YYLTYPE * loc, yyscan_t scanner, void * data, char * s)
parseError(data, s, loc->first_line, loc->first_column);
}
ATerm toATerm(const char * s)
{
return (ATerm) ATmakeAppl0(ATmakeAFun((char *) s, 0, ATtrue));
}
static Pos makeCurPos(YYLTYPE * loc, void * data)
{
return makePos(string2ATerm(getPath(data)),
return makePos(toATerm(getPath(data)),
loc->first_line, loc->first_column);
}
@ -122,7 +127,7 @@ expr_simple
/* Let expressions `let {..., body = ...}' are just desugared
into `(rec {..., body = ...}).body'. */
| LET '{' binds '}'
{ $$ = makeSelect(fixAttrs(1, $3), string2ATerm("body")); }
{ $$ = makeSelect(fixAttrs(1, $3), toATerm("body")); }
| REC '{' binds '}'
{ $$ = fixAttrs(1, $3); }
| '{' binds '}'