about summary refs log tree commit diff
path: root/src/libexpr/parser.y
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-11-03T18·12+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-11-03T18·12+0000
commitcb7ccb528bbaeb30d09fbb41e57ab75d3121e1bc (patch)
treed27270a2b3c6abc86f56956d906899374778f028 /src/libexpr/parser.y
parent4cbd845aa491b5cf534f8c031d285fc454933868 (diff)
* string2ATerm -> overloaded toATerm.
Diffstat (limited to 'src/libexpr/parser.y')
-rw-r--r--src/libexpr/parser.y9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index 8573697b634d..1f204a228009 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -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 '}'