Python parser ply not matching token

I am trying to use Ply to parse a file and am trying to make comment tokens. Comments are designated by either double slashes // or a hashtag #. When I try to use the following, no comment tokens are created.

@lex.TOKEN(r'(//.*|\#.*)')
def t_COMMENT(t):
    ...

What might I be doing wrong?

Thank you in advance.



from Recent Questions - Stack Overflow https://ift.tt/3fN7xiG
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)