Class: Chelsy::Directive::Line

Inherits:
Base show all
Defined in:
lib/chelsy/ast.rb

Overview

#line

#line digits ["filename"]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lineno, filename = nil, **rest) ⇒ Line

Returns a new instance of Line.



1256
1257
1258
1259
1260
1261
# File 'lib/chelsy/ast.rb', line 1256

def initialize(lineno, filename=nil, **rest)
  @lineno = Syntax::Coercers::Int.ensure(lineno)
  @filename = Chelsy.immutable_stringify(filename) if filename

  super **rest
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



1254
1255
1256
# File 'lib/chelsy/ast.rb', line 1254

def filename
  @filename
end

#linenoObject (readonly)

Returns the value of attribute lineno.



1254
1255
1256
# File 'lib/chelsy/ast.rb', line 1254

def lineno
  @lineno
end