From 6d50786773ecfb501189170d66bc9dfc2338976b Mon Sep 17 00:00:00 2001 From: Lerking Date: Tue, 2 Apr 2019 14:35:42 +0200 Subject: [PATCH] Updated comment.py --- comment.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/comment.py b/comment.py index 63ce5ca..83c3f87 100644 --- a/comment.py +++ b/comment.py @@ -1,11 +1,15 @@ from metaclasses import InstanceCounterMeta +from rply import LexerGenerator class comment(object, metaclass=InstanceCounterMeta): def __init__(self,com): self.id = next(self.__class__._ids) - self.comment = com - self.block_comment = False - self.line_comment = False + self.comment_lexer = LexerGenerator() + self.comment_lexer.add("CSTART", r"(/*)") + + self.comment_lexer.add("CEND", r"(*/)") + self.comment_lexer.ignore(r'\s+') + def parse_comment(self): com = self.comment