Skip to content

statement

statement

Macro statement token.

MacroStatementToken

Bases: CommandToken

Wrapper for in-macro expression.

Source code in src\pygerber\gerberx3\tokenizer\tokens\macro\statements\statement.py
class MacroStatementToken(CommandToken):
    """Wrapper for in-macro expression."""

    def evaluate(
        self,
        macro_context: MacroContext,
        state: State,
        handle: PrivateApertureHandle,
        /,
    ) -> None:
        """Evaluate macro statement."""

    def get_gerber_code(
        self,
        indent: str = "",
        endline: str = "\n",  # noqa: ARG002
    ) -> str:
        """Get gerber code represented by this token."""
        return f"{indent}0 {self.__class__.__qualname__} no formatting available"

evaluate

evaluate(
    macro_context: MacroContext,
    state: State,
    handle: PrivateApertureHandle,
) -> None

Evaluate macro statement.

Source code in src\pygerber\gerberx3\tokenizer\tokens\macro\statements\statement.py
def evaluate(
    self,
    macro_context: MacroContext,
    state: State,
    handle: PrivateApertureHandle,
    /,
) -> None:
    """Evaluate macro statement."""

get_gerber_code

get_gerber_code(
    indent: str = "", endline: str = "\n"
) -> str

Get gerber code represented by this token.

Source code in src\pygerber\gerberx3\tokenizer\tokens\macro\statements\statement.py
def get_gerber_code(
    self,
    indent: str = "",
    endline: str = "\n",  # noqa: ARG002
) -> str:
    """Get gerber code represented by this token."""
    return f"{indent}0 {self.__class__.__qualname__} no formatting available"