Commit 5754130 1 parent 651a81d commit 5754130 Copy full SHA for 5754130
File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 43
43
"define" : " cppia" ,
44
44
"doc" : " Generate cpp instruction assembly."
45
45
},
46
+ {
47
+ "name" : " CppiaAbsoluteSourcePaths" ,
48
+ "define" : " cppia.absolute-source-paths" ,
49
+ "doc" : " Embed absolute paths to source files for debugging."
50
+ },
46
51
{
47
52
"name" : " NoCppiaAst" ,
48
53
"define" : " nocppiaast" ,
Original file line number Diff line number Diff line change @@ -521,6 +521,7 @@ class script_writer ctx filename asciiOut =
521
521
val fileTable = Hashtbl. create 0
522
522
val identBuffer = Buffer. create 0
523
523
val cppiaAst = not (Gctx. defined ctx.ctx_common Define. NoCppiaAst )
524
+ val absoluteSourcePaths = Gctx. defined ctx.ctx_common Define. CppiaAbsoluteSourcePaths
524
525
525
526
method stringId name =
526
527
try Hashtbl. find identTable name
@@ -785,8 +786,12 @@ class script_writer ctx filename asciiOut =
785
786
786
787
method wpos p =
787
788
if debug then
789
+ let filepath = if absoluteSourcePaths then
790
+ Path. get_full_path p.pfile
791
+ else p.pfile
792
+ in
788
793
this#write
789
- (this#fileText p.pfile ^ " \t "
794
+ (this#fileText filepath ^ " \t "
790
795
^ string_of_int (Lexer. get_error_line p)
791
796
^ indent)
792
797
You can’t perform that action at this time.
0 commit comments