view ply-3.8/test/lex_token4.py @ 12156:b256805d9e5c draft

<int-e> complain Nobody likes this.
author HackEso <hackeso@esolangs.org>
date Mon, 18 Nov 2019 10:09:51 +0000
parents 343ff337a19b
children
line wrap: on
line source

# lex_token4.py
#
# Bad token name

import sys
if ".." not in sys.path: sys.path.insert(0,"..")

import ply.lex as lex

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

t_PLUS = r'\+'
t_MINUS = r'-'
t_NUMBER = r'\d+'

def t_error(t):
    pass

lex.lex()