Commits

Jürgen Bömmels  committed 9eb92cb

Move Parser helper-functions from object.py to ssparser.py

  • Participants
  • Parent commits 62cfba5

Comments (0)

Files changed (2)

File scheme/object.py

 
         return self.body.eval_tr(local_ctx)
 
-##
-# Parser helpers
-##
-def quote(sexpr):
-    return W_Pair(symbol('quote'), W_Pair(sexpr, w_nil))
-
-def qq(sexpr):
-    return W_Pair(symbol('quasiquote'), W_Pair(sexpr, w_nil))
-
-def unquote(sexpr):
-    return W_Pair(symbol('unquote'), W_Pair(sexpr, w_nil))
-
-def unquote_splicing(sexpr):
-    return W_Pair(symbol('unquote-splicing'), W_Pair(sexpr, w_nil))
-
 
 ##
 # General helpers

File scheme/ssparser.py

 from pypy.rlib.parsing.pypackrat import PackratParser
 from pypy.rlib.parsing.makepackrat import BacktrackException, Status
 from scheme.object import W_Pair, W_Integer, W_String, symbol, \
-        w_nil, W_Boolean, W_Real, quote, qq, unquote, unquote_splicing, \
+        w_nil, W_Boolean, W_Real, \
         w_ellipsis, W_Character, SchemeSyntaxError, W_Vector
 
 def str_unquote(s):
     p = SchemeParser(code)
     return p.file()
 
+##
+# Parser helpers
+##
+def quote(sexpr):
+    return W_Pair(symbol('quote'), W_Pair(sexpr, w_nil))
+
+def qq(sexpr):
+    return W_Pair(symbol('quasiquote'), W_Pair(sexpr, w_nil))
+
+def unquote(sexpr):
+    return W_Pair(symbol('unquote'), W_Pair(sexpr, w_nil))
+
+def unquote_splicing(sexpr):
+    return W_Pair(symbol('unquote-splicing'), W_Pair(sexpr, w_nil))