Adding in commit juju

This commit is contained in:
Paul R. Tagliamonte 2013-03-11 20:33:06 -04:00
parent 8e0ef85ec3
commit 9c3a3a13c9
3 changed files with 19 additions and 1 deletions

View File

@ -208,6 +208,9 @@ class String(State):
^^^^^^^^ -- String
"""
def enter(self):
self.escaped = False
def exit(self):
self.result = HyString("".join(self.nodes))
@ -217,9 +220,20 @@ class String(State):
- " - Idle
"""
if self.escaped:
self.escaped = False
if char == "n":
self.nodes.append("\n")
return
raise LexException("Unknown modifier")
if char == "\"":
return Idle
if char == "\\":
self.escaped = True
return
self.nodes.append(char)

View File

@ -1,3 +1,4 @@
flask
pygments
codegen
autopep8

View File

@ -10,6 +10,7 @@
(import-from hy.lex LexException)
(import-from hy.importer import_string_to_ast)
(import autopep8)
(import codegen)
@ -17,7 +18,9 @@
(.add_extension app.jinja_env PygmentsExtension)
(defn hy-to-py [hython] (.to_source codegen (import-string-to-ast hython)))
(defn hy-to-py [hython]
(.fix-string autopep8 (.to_source codegen (import-string-to-ast hython))))
(defn err [msg] (make-response msg 500))