Skip to content

g04_comment

g04_comment

Comment token.

Comment

Bases: Expression

Comment token.

Source code in src/pygerber/gerberx3/tokenizer/tokens/g04_comment.py
class Comment(Expression):
    """Comment token."""

    content: str

    @classmethod
    def from_tokens(cls, **tokens: Any) -> Self:
        """Initialize token object."""
        content: str = tokens["string"]
        return cls(content=content)

    def __str__(self) -> str:
        return f"G04 {self.content}*"

from_tokens classmethod

from_tokens(**tokens: Any) -> Self

Initialize token object.

Source code in src/pygerber/gerberx3/tokenizer/tokens/g04_comment.py
@classmethod
def from_tokens(cls, **tokens: Any) -> Self:
    """Initialize token object."""
    content: str = tokens["string"]
    return cls(content=content)