diff --git a/src/JobShopParser/__init__.py b/src/JobShopParser/__init__.py index 40615f6..b407706 100644 --- a/src/JobShopParser/__init__.py +++ b/src/JobShopParser/__init__.py @@ -1,6 +1,8 @@ from typing import List, Tuple, Sequence, Optional, Union import arpeggio +__all__ = ["jobshop1_parser", "jobshop2_parser"] + grammar = """ # starting point for jobshop1 input file job_shop1 = skip_preface @@ -78,7 +80,7 @@ class JobShopVisitor(arpeggio.PTNodeVisitor): if len(job_numbers) % 2 ==1: raise ParseError("Odd number of numbers in job data") # returns list of (duration, machine) tuples - return list(zip(job_numbers[1::2], job_numbers[0::2])) + return list(zip(job_numbers[1::2], job_numbers[0::2])) # [::2] returns only every second element of the list def visit_problem_data(self, node: arpeggio.ParseTreeNode, children: arpeggio.SemanticActionResults) -> JobShopProblem: if self.debug: