We had been using version 3.2 from 2009, which does not have support for t_eof(). Change-Id: Id5610a272fe2cecd586991f4c59f3ec77184164e Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56342 Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
27 lines
331 B
Python
27 lines
331 B
Python
# lex_literal3.py
|
|
#
|
|
# An empty literal specification given as a list
|
|
# Issue 8 : Literals empty list causes IndexError
|
|
|
|
import sys
|
|
if ".." not in sys.path: sys.path.insert(0,"..")
|
|
|
|
import ply.lex as lex
|
|
|
|
tokens = [
|
|
"NUMBER",
|
|
]
|
|
|
|
literals = []
|
|
|
|
def t_NUMBER(t):
|
|
r'\d+'
|
|
return t
|
|
|
|
def t_error(t):
|
|
pass
|
|
|
|
lex.lex()
|
|
|
|
|