Adding "#!" == comment - Close #23

This commit is contained in:
Paul Tagliamonte 2012-12-31 15:09:22 -05:00
parent 2a36c1e0c3
commit 9fcedceed3

View File

@ -68,6 +68,7 @@ class Comment(State):
class Idle(State):
def p(self, x):
if x == "#": return HashExpression
if x == ";": return Comment
if x == "(": return Expression
if x in WHITESPACE: return
@ -75,6 +76,13 @@ class Idle(State):
raise LexException("Unknown char: %s" % (x))
class HashExpression(State):
def p(self, x):
if x == "!": return Comment
raise LexException("Unknwon Hash modifier - %s" % (x))
class Expression(State):
def enter(self):
self.nodes = HYExpression([])