Skip to content

Commit

Permalink
a few changes to the ast
Browse files Browse the repository at this point in the history
  • Loading branch information
tacheraSasi committed Dec 10, 2024
1 parent c587f1c commit 6418ade
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ast/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ type PropertyAssignment struct {

func (pa *PropertyAssignment) expressionNode() {}
func (pa *PropertyAssignment) TokenLiteral() string { return pa.Token.Literal }
func (pa *PropertyAssignment) String() string { return "Ngl I'm tired" }
func (pa *PropertyAssignment) String() string { return "tach" }

type PropertyExpression struct {
Expression
Expand All @@ -644,4 +644,4 @@ type PropertyExpression struct {

func (pe *PropertyExpression) expressionNode() {}
func (pe *PropertyExpression) TokenLiteral() string { return pe.Token.Literal }
func (pe *PropertyExpression) String() string { return "Ngl I'm tired part two" }
func (pe *PropertyExpression) String() string { return "Tach two" }
4 changes: 2 additions & 2 deletions ast/ast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func TestString(t *testing.T) {
program := &Program{
Statements: []Statement{
&LetStatement{
Token: token.Token{Type: token.LET, Literal: "fanya"},
Token: token.Token{Type: token.LET, Literal: "let"},
Name: &Identifier{
Token: token.Token{Type: token.IDENT, Literal: "myVar"},
Value: "myVar",
Expand All @@ -23,7 +23,7 @@ func TestString(t *testing.T) {
},
}

if program.String() != "fanya myVar = anotherVar;" {
if program.String() != "let myVar = anotherVar;" {
t.Errorf("program.String() wrong. got=%q", program.String())
}
}

0 comments on commit 6418ade

Please sign in to comment.