Tweaking out the machine voodoo.
This commit is contained in:
parent
1a9e2f66d8
commit
36bc16211e
@ -87,11 +87,12 @@ class Machine(object):
|
|||||||
if self.submachine:
|
if self.submachine:
|
||||||
self.submachine.process([char])
|
self.submachine.process([char])
|
||||||
if type(self.submachine.state) == Idle:
|
if type(self.submachine.state) == Idle:
|
||||||
if len(self.submachine.nodes) != 1:
|
if len(self.submachine.nodes) > 1:
|
||||||
raise LexException("Funky Submachine stuff")
|
raise LexException("Funky Submachine stuff")
|
||||||
|
|
||||||
nodes = self.submachine.nodes
|
nodes = self.submachine.nodes
|
||||||
self.submachine = None
|
self.submachine = None
|
||||||
|
if nodes != []:
|
||||||
self.state.nodes.append(nodes[0])
|
self.state.nodes.append(nodes[0])
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -153,6 +153,11 @@ class ListeyThing(State):
|
|||||||
self.machine.sub(String)
|
self.machine.sub(String)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if char == ";":
|
||||||
|
self.commit()
|
||||||
|
self.machine.sub(Comment)
|
||||||
|
return
|
||||||
|
|
||||||
if char == self.end_char:
|
if char == self.end_char:
|
||||||
return Idle
|
return Idle
|
||||||
|
|
||||||
|
@ -26,7 +26,8 @@
|
|||||||
(route "/" [] (render-template "repl.html"))
|
(route "/" [] (render-template "repl.html"))
|
||||||
|
|
||||||
(post-route "/hy2py" []
|
(post-route "/hy2py" []
|
||||||
(try (hy-to-py (get request.form "code"))
|
(try
|
||||||
|
(hy-to-py (get request.form "code"))
|
||||||
(catch LexException (err "Incomplete Code."))
|
(catch LexException (err "Incomplete Code."))
|
||||||
(catch HyError (err "Generic error during processing."))
|
(catch HyError (err "Generic error during processing."))
|
||||||
(catch Exception (err "Erm, you broke something."))))
|
(catch Exception (err "Erm, you broke something."))))
|
||||||
|
Loading…
Reference in New Issue
Block a user