flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Compiler Internals > [fasmg] [feature-request] __file__ as a list

Thread Post new topic Reply to topic

Joined: 22 May 2015
Posts: 60

[fasmg] [feature-request] __file__ as a list

__file__ currently holds the name of the file, that is compiled. It would be nice, if this is the list of files from the main-file to the file, which actually used __file__, e.g.


include 'file1'
include 'file3'



include 'file2'
macro foo
end macro



macro bar
  fail 'just fail'
end macro



macro fail message&
  irpv item__file__
    display '->'__file__    ;the last value of __file__ would be 'file3', but thats ok
    restore __file__
  end irpv
  display '->'message10
end macro

IMHO custom errors are nice, but it is sometimes a bit hard to find the actual cause, when I use a lot of macros. sometimes, I do not even know where I defined the macro.
A Plus would be, if I can just restore __line__ to get the line number in this file:


macro fail message&
  irpv item__file__
    display '->'__file__':'
    displayDecimal __line__   ;displays the line number as decimal value
    restore __line__
    restore __file__
  end irpv
  display '->'message10
  ;in this case:
  ;->main:3->file1:3->file2:2->file3:2->just fail
end macro

Post 21 Aug 2017, 01:27
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  

< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2018, Tomasz Grysztar.
Powered by rwasa.