Source

ply / test / lex_re3.py

The default branch has multiple heads

Full commit
# lex_token.py
#
# Regular expression rule matches empty string

import sys
sys.path.append("..")

import ply.lex as lex

tokens = [
    "PLUS",
    "MINUS",
    "NUMBER",
    "POUND",
    ]

t_PLUS = r'\+'
t_MINUS = r'-'
t_NUMBER = r'(\d+)'
t_POUND = r'#'

def t_error(t):
    pass

import sys

lex.lex()