Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001779Inform 6Generalpublic2015-11-19 14:432016-10-01 12:40
Reporterzarf 
Assigned ToDavidK 
PrioritynormalSeveritymildReproducibilityN/A
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version6.32 
Target VersionFixed in Version 
Summary0001779: Feature: #origsource directive
DescriptionWhen compiling I7 to I6 code, we might want to record the I7 line number that corresponds to I6 line numbers. We can then use this information when reporting I6 compile errors, and in the gamedbg (-k) file.

Suggested syntax:

#origsource FILE;
#origsource FILE LINE;
#origsource FILE LINE CHAR;
#origsource;

The first three forms set position information, describing a source location in the I7 file (or whatever is generating the I6). FILE is a quoted string; LINE and CHAR are (optional) nonnegative integers. The position information sticks until the next #origsource directive. (But does not carry down into #included files.)

The fourth form unsets the position information.

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0004524)
zarf (developer)
2016-08-08 13:19

I have started on this -- see my https://github.com/erkyrath/inform6/tree/origsource [^] branch. It's not finished yet.

It turns out to require a moderate amount of code surgery, because we want to put the #origsource file references in the InputFiles table. But the lexer assumes that any new entry in InputFiles is a freshly-opened #include file. I had to add some logic to tell the difference.

The good news is that for any game without #origsource directives (i.e., all existing I6 and I7 code) none of this logic makes a difference.
(0004525)
zarf (developer)
2016-08-08 13:23

I may wind up changing the slines array (in symbols.c) from int32 to structs. (It currently records source file/line in a compressed format, which is hacky to begin with. We'd like to record source file/line *and* the #origsource file/line, if available.)
(0004526)
zarf (developer)
2016-08-08 13:29

Also: the current debug-file spec says that the <language> of a source location can be "Inform 6" or "Inform 7". I will be setting #origsource up to generate "Inform 7", because that's the only option on the horizon. However, we might someday want an option to change this.
(0004527)
zarf (developer)
2016-08-17 10:00

Because of the bulkier structures, Inform now uses more memory and is slightly slower *even when the #origsource directive is not used*. My tests indicate that it's about 4% slower on most compiles. This is not a huge cost -- I6 is only a small fraction of the time of an I7 compile anyhow. But it's enough that I wanted to bring it up here.
(0004528)
zarf (developer)
2016-08-19 10:17

I have now merged these changes to (my) master branch. (Many commits starting with dc6c72bd2e4171b51b3501d20856382d2fc63e2a.)

- Issue History
Date Modified Username Field Change
2015-11-19 14:43 zarf New Issue
2015-11-19 14:43 zarf Status new => assigned
2015-11-19 14:43 zarf Assigned To => zarf
2016-08-08 13:19 zarf Note Added: 0004524
2016-08-08 13:23 zarf Note Added: 0004525
2016-08-08 13:29 zarf Note Added: 0004526
2016-08-17 10:00 zarf Note Added: 0004527
2016-08-19 10:17 zarf Note Added: 0004528
2016-08-19 10:17 zarf Assigned To zarf => DavidK
2016-10-01 12:40 DavidK Status assigned => resolved
2016-10-01 12:40 DavidK Resolution open => fixed


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker