ravikumar10 / genyris

Automatically exported from code.google.com/p/genyris
Other
0 stars 0 forks source link

Add __FILE__ and __LINE__ expansion to lexer. #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I want to have magic tokens which are substituted for the current file name and 
line number so that I can write error routines which include this information 
such as

 raise ("Error %a %a"(.format @FILE @LINE ))

Although this can be extracted from a future backtrace object, it's very cheap 
to implement and might be fun.

i.e the same as cpp.

Original issue reported on code.google.com by birchb1...@gmail.com on 22 Apr 2013 at 3:56

GoogleCodeExporter commented 9 years ago
This would make it easier to unit test the basic line number catching. ie
1 # file is test-line-numbers.g
2 assertEqual @LINE 2
3 assertEqual @LINE 3
4 assertEqual @FILE 'test-line-numbers.g'

Original comment by birchb1...@gmail.com on 23 Apr 2013 at 4:46

GoogleCodeExporter commented 9 years ago
Added in 0.7.1

Original comment by birchb1...@gmail.com on 25 Apr 2013 at 1:47