Updated comment.py
This commit is contained in:
+7
-3
@@ -1,11 +1,15 @@
|
|||||||
from metaclasses import InstanceCounterMeta
|
from metaclasses import InstanceCounterMeta
|
||||||
|
from rply import LexerGenerator
|
||||||
|
|
||||||
class comment(object, metaclass=InstanceCounterMeta):
|
class comment(object, metaclass=InstanceCounterMeta):
|
||||||
def __init__(self,com):
|
def __init__(self,com):
|
||||||
self.id = next(self.__class__._ids)
|
self.id = next(self.__class__._ids)
|
||||||
self.comment = com
|
self.comment_lexer = LexerGenerator()
|
||||||
self.block_comment = False
|
self.comment_lexer.add("CSTART", r"(/*)")
|
||||||
self.line_comment = False
|
|
||||||
|
self.comment_lexer.add("CEND", r"(*/)")
|
||||||
|
self.comment_lexer.ignore(r'\s+')
|
||||||
|
|
||||||
|
|
||||||
def parse_comment(self):
|
def parse_comment(self):
|
||||||
com = self.comment
|
com = self.comment
|
||||||
|
|||||||
Reference in New Issue
Block a user