Adding "#!" == comment - Close #23
This commit is contained in:
parent
2a36c1e0c3
commit
9fcedceed3
@ -68,6 +68,7 @@ class Comment(State):
|
|||||||
|
|
||||||
class Idle(State):
|
class Idle(State):
|
||||||
def p(self, x):
|
def p(self, x):
|
||||||
|
if x == "#": return HashExpression
|
||||||
if x == ";": return Comment
|
if x == ";": return Comment
|
||||||
if x == "(": return Expression
|
if x == "(": return Expression
|
||||||
if x in WHITESPACE: return
|
if x in WHITESPACE: return
|
||||||
@ -75,6 +76,13 @@ class Idle(State):
|
|||||||
raise LexException("Unknown char: %s" % (x))
|
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):
|
class Expression(State):
|
||||||
def enter(self):
|
def enter(self):
|
||||||
self.nodes = HYExpression([])
|
self.nodes = HYExpression([])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user