Skip to content

Commit

Permalink
make WithIssues.issues not appear in constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomassetti committed Sep 29, 2023
1 parent 293a63f commit 8ddcf05
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions pylasu/parsing/results.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from dataclasses import dataclass, field
from dataclasses import dataclass
from typing import List

from antlr4 import ParserRuleContext, Token
Expand All @@ -10,13 +10,11 @@
@dataclass
class FirstStageResult(WithIssues):
parse_tree: ParserRuleContext
issues: List[Issue] = field(default_factory=list)


@dataclass
class LexingResult(WithIssues):
tokens: List[Token]
issues: List[Issue] = field(default_factory=list)


@dataclass
Expand Down
3 changes: 1 addition & 2 deletions pylasu/validation/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ def semantic(message: str, severity: IssueSeverity = IssueSeverity.ERROR, positi
@dataclass
class WithIssues:
"""Many classes have the necessity of tracking issues"""
issues: List[Issue]
issues: List[Issue] = field(default_factory=list, init=False)


@dataclass
class Result(WithIssues):
root: Node
issues: List[Issue] = field(default_factory=list)

0 comments on commit 8ddcf05

Please sign in to comment.