let.go 404 B

1234567891011121314151617
  1. package ast
  2. import "code.osinet.fr/fgm/waiig15/token"
  3. // LetStatement is the Node type for Let statements.
  4. type LetStatement struct {
  5. Token token.Token // the token.LET token. Why do we need it ?
  6. Name *Identifier
  7. Value Expression
  8. }
  9. func (ls *LetStatement) statementNode() {}
  10. // TokenLiteral satisfies the Node interface.
  11. func (ls *LetStatement) TokenLiteral() string {
  12. return ls.Token.Literal
  13. }