summaryrefslogtreecommitdiff
path: root/tests/lex_dup2.py
blob: 47bf5b50ce28a4613b1a4cd2d04eaf45b76253ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# lex_dup2.py
#
# Duplicated rule specifiers

import ply.lex as lex

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

t_PLUS = r'\+'
t_MINUS = r'-'
def t_NUMBER(t):
    r'\d+'
    pass

def t_NUMBER(t):
    r'\d+'
    pass

def t_error(t):
    pass



lex.lex()