ruby/ruby — pull request #503 by gam3 (2014-01-10 22:52:53+00:00)
Title: Add the ability to set __FILE__ and __LINE__

Added the ability to set __FILE__ and __LINE__

__FILE__ = "test.nw"
__LINE__ = 10 # this is the line number of the next line minus one

This helps when using tool like noweb to create ruby files.

Bugs: You get a warning about "warning: possibly useless use of a literal in void context".
and the RHS must be an integer for __LINE__ and a String for __FILE__. The RHS is not evaluated.

The following example would not change the __FILE__ or the __LINE__

__FILE__ = "A" + "B" # warning: __FILE__ can only be set to a String, ignored
__LINE__ = 10 + 1 # warning: __LINE__ can only be set to a Fixnum, ignored