Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • admins
  • main
  • tp1
  • tp1-correction
  • tp2
  • tp2-correction
  • tp3
7 results

Target

Select target project
No results found
Select Git revision
  • admins
  • main
  • tp1
  • tp1-correction
  • tp2
  • tp2-correction
  • tp3
7 results
Show changes

Commits on Source 2

1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline

Files

Original line number Original line Diff line number Diff line
@@ -18,7 +18,7 @@ class Calculator:
            operators = STANDARD_OPERATORS
            operators = STANDARD_OPERATORS
        self.operators = operators
        self.operators = operators


    def tokenize(self, line: str) -> list[Token]:
    def tokenize(self, line: str):
        tokens = []
        tokens = []
        for token in line.split():
        for token in line.split():
            if token in self.operators:
            if token in self.operators:
@@ -31,7 +31,7 @@ class Calculator:
                    raise ValueError(f"Invalid token {token}") from exc
                    raise ValueError(f"Invalid token {token}") from exc
        return tokens
        return tokens


    def parse(self, tokens: list[Token]) -> Expression:
    def parse(self, tokens) -> Expression:
        """
        """
        Parse a list of tokens into an ordered expression.
        Parse a list of tokens into an ordered expression.
        """
        """