1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

scanner: @FILE escape \

This commit is contained in:
unknown-v 2019-09-11 19:16:42 +02:00 committed by Alexander Medvednikov
parent f8d4d6cdc7
commit 26edb7d797

View File

@ -406,7 +406,7 @@ fn (s mut Scanner) scan() ScanRes {
// println( 'file: ' + @FILE + ' | line: ' + @LINE + ' | fn: ' + @FN)
// ... which is useful while debugging/tracing
if name == 'FN' { return scan_res(.str, s.fn_name) }
if name == 'FILE' { return scan_res(.str, os.realpath(s.file_path)) }
if name == 'FILE' { return scan_res(.str, os.realpath(s.file_path).replace('\\', '\\\\')) } // escape \
if name == 'LINE' { return scan_res(.str, (s.line_nr+1).str()) }
if name == 'COLUMN' { return scan_res(.str, (s.current_column()).str()) }
if name == 'VHASH' { return scan_res(.str, vhash()) }