This static method checks the line in the given Scan object to see if it contains exactly seven
characters. No other checking is done.
# - - - P r e f i x . s c a n - - -
@staticmethod
def scanLine(scan):
'''Scan a band prefix line.
'''
#-- 1 --
# [ scan := scan advanced to end of line
# text := remaining text on the line in scan, uppercased ]
text = scan.tab(-1).upper()
See Section 25, “class Prefix: Band number prefix line”.
#-- 2 --
# [ if text is not PREFIX_L characters long ->
# Log() +:= error message
# raise SyntaxError
# else ->
# return a new Prefix object with text=text ]
if len(text) != PREFIX_L:
message = ("Prefix '%s' is not exactly %d "
"characters long." % (text, PREFIX_L))
scan.syntax(message)
else:
return Prefix(text)