identifier.go 402 B

1234567891011121314151617
  1. package ast
  2. import "code.osinet.fr/fgm/waiig15/token"
  3. // Identifier is the Node type for identifiers.
  4. type Identifier struct {
  5. Token token.Token // the token.IDENT token. Why do we need it ?
  6. Value string // The identifier string.
  7. }
  8. func (i *Identifier) expressionNode() {}
  9. // TokenLiteral satisfies the Node interface.
  10. func (i *Identifier) TokenLiteral() string {
  11. return i.Token.Literal
  12. }