:py:mod:`raesl.compile.machine_files.utils` =========================================== .. py:module:: raesl.compile.machine_files.utils .. autoapi-nested-parse:: Utility functions. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: raesl.compile.machine_files.utils.make_loc_names raesl.compile.machine_files.utils._in_range raesl.compile.machine_files.utils.get_one raesl.compile.machine_files.utils.get_optional .. py:function:: make_loc_names(prefix: str, name: str, count: int) -> Dict[str, str] Make a dict with 'count' names by combining the prefix, name, and a number. .. py:function:: _in_range(tok: raesl.compile.scanner.Token, start_offset: Optional[int], end_offset: Optional[int]) -> bool Is the given token offset positioned between and not at 'start_offset' and 'end_offset'? If start_offset or end_offset is None, use -1 and infinity as offsets, respectively. :returns: Whether the provided token is between (not at) the start_offset and end_offset. .. py:function:: get_one(tokens: List[raesl.compile.scanner.Token], start_offset: Optional[int], end_offset: Optional[int]) -> raesl.compile.scanner.Token Filter tokens on the provided start and end offsets, and return the only token between the positions. .. py:function:: get_optional(tokens: List[raesl.compile.scanner.Token], start_offset: Optional[int], end_offset: Optional[int]) -> Optional[raesl.compile.scanner.Token] Filter tokens on the provided start and end offsets, and return the only token between the positions.