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