Adding in commit juju
This commit is contained in:
parent
8e0ef85ec3
commit
9c3a3a13c9
@ -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)
|
||||
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
flask
|
||||
pygments
|
||||
codegen
|
||||
autopep8
|
||||
|
@ -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))
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user