Skip to content

Commit f1f61a2

Browse files
committed
Remove artifacts of previous commit
Furthermore, consider merging comparisons with 'in', as this is probably faster and less verbose.
1 parent 67f5a5e commit f1f61a2

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/hsd/parser.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
__all__ = ["HsdParser",
16-
"SYNTAX_ERROR", "UNCLOSED_TAG_ERROR", "UNCLOSED_OPTION_ERROR",
16+
"SYNTAX_ERROR", "UNCLOSED_TAG_ERROR", "UNCLOSED_ATTRIB_ERROR",
1717
"UNCLOSED_QUOTATION_ERROR", "ORPHAN_TEXT_ERROR"]
1818

1919
SYNTAX_ERROR = 1
@@ -99,15 +99,15 @@ def __init__(self, eventhandler=None):
9999
else:
100100
self._eventhandler = eventhandler
101101

102-
self._fname = "" # Name of file being processed
103-
self._checkstr = _GENERAL_SPECIALS # special characters to look for
102+
self._fname = "" # name of file being processed
103+
self._checkstr = _GENERAL_SPECIALS # special characters to look for
104104
self._oldcheckstr = "" # buffer fo checkstr
105105
self._opened_tags = [] # info about opened tags
106106
self._buffer = [] # buffering plain text between lines
107107
self._attrib = None # attribute for current tag
108108
self._hsdoptions = OrderedDict() # hsd-options for current tag
109109
self._currline = 0 # nr. of current line in file
110-
self._after_equal_sign = False # last tag was opened with equal sign
110+
self._after_equal_sign = False # last tag was opened with equal sign
111111
self._inside_attrib = False # parser inside attrib specification
112112
self._inside_quote = False # parser inside quotation
113113
self._has_child = False
@@ -233,7 +233,7 @@ def _parse(self, line):
233233
self._checkstr = _GENERAL_SPECIALS
234234

235235
# Quoting strings
236-
elif sign == "'" or sign == '"':
236+
elif sign in ("'", '"'):
237237
if self._inside_quote:
238238
self._checkstr = self._oldcheckstr
239239
self._inside_quote = False
@@ -311,8 +311,7 @@ def _closetag(self):
311311

312312
def _include_hsd(self, fname):
313313
fname = common.unquote(fname.strip())
314-
parser = HsdParser(defattrib=self._defattrib,
315-
eventhandler=self._eventhandler)
314+
parser = HsdParser(eventhandler=self._eventhandler)
316315
parser.feed(fname)
317316

318317

0 commit comments

Comments
 (0)