/source/core/ast/StringLit.ooc

http://github.com/nddrylliog/oc · Unknown · 22 lines · 14 code · 8 blank · 0 comment · 0 complexity · 1780d4ee5278386668b61f770241399d MD5 · raw file

  1. import Expression, Type
  2. import middle/Resolver
  3. StringLit: class extends Expression {
  4. value: String
  5. type := static BaseType new("String")
  6. init: func (=value) {}
  7. resolve: func (task: Task) {
  8. task queue(type)
  9. }
  10. getType: func -> Type { type }
  11. toString: func -> String {
  12. "\"" + value + "\""
  13. }
  14. }