docs/sphinx/hxtool.py: Remove STEXI/ETEXI support

Now that none of our input .hx files have STEXI/ETEXI blocks,
we can remove the code in the Sphinx hxtool extension that
supported parsing them.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20200306171749.10756-5-peter.maydell@linaro.org
This commit is contained in:
Peter Maydell 2020-03-06 17:17:46 +00:00
parent 3885e2c25c
commit 80a046c51a

View File

@ -37,13 +37,11 @@ else:
__version__ = '1.0' __version__ = '1.0'
# We parse hx files with a state machine which may be in one of three # We parse hx files with a state machine which may be in one of two
# states: reading the C code fragment, inside a texi fragment, # states: reading the C code fragment, or inside a rST fragment.
# or inside a rST fragment.
class HxState(Enum): class HxState(Enum):
CTEXT = 1 CTEXT = 1
TEXI = 2 RST = 2
RST = 3
def serror(file, lnum, errtext): def serror(file, lnum, errtext):
"""Raise an exception giving a user-friendly syntax error message""" """Raise an exception giving a user-friendly syntax error message"""
@ -110,31 +108,13 @@ class HxtoolDocDirective(Directive):
if directive == 'HXCOMM': if directive == 'HXCOMM':
pass pass
elif directive == 'STEXI':
if state == HxState.RST:
serror(hxfile, lnum, 'expected ERST, found STEXI')
elif state == HxState.TEXI:
serror(hxfile, lnum, 'expected ETEXI, found STEXI')
else:
state = HxState.TEXI
elif directive == 'ETEXI':
if state == HxState.RST:
serror(hxfile, lnum, 'expected ERST, found ETEXI')
elif state == HxState.CTEXT:
serror(hxfile, lnum, 'expected STEXI, found ETEXI')
else:
state = HxState.CTEXT
elif directive == 'SRST': elif directive == 'SRST':
if state == HxState.RST: if state == HxState.RST:
serror(hxfile, lnum, 'expected ERST, found SRST') serror(hxfile, lnum, 'expected ERST, found SRST')
elif state == HxState.TEXI:
serror(hxfile, lnum, 'expected ETEXI, found SRST')
else: else:
state = HxState.RST state = HxState.RST
elif directive == 'ERST': elif directive == 'ERST':
if state == HxState.TEXI: if state == HxState.CTEXT:
serror(hxfile, lnum, 'expected ETEXI, found ERST')
elif state == HxState.CTEXT:
serror(hxfile, lnum, 'expected SRST, found ERST') serror(hxfile, lnum, 'expected SRST, found ERST')
else: else:
state = HxState.CTEXT state = HxState.CTEXT