flat assembler
Message board for the users of flat assembler.

flat assembler > Compiler Internals > [fasmg] small error in line continuation with comments

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16702
Location: In your JS exploiting you and your system
Yay, I think I understand.
Post 21 Dec 2018, 10:00
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2791
Location: dank orb
Would it be accurate to say:

Labeling can only navigate the symbol space at the base of the current namespace. Although, the dot notation allows the creation of a symbolic hierarchy it doesn't change the symbolic base.

Additionally, when entering a namespace we don't know what the last base label was.
Code:
BASE.y:
BASE.r:

namespace BASE
  .x = 1 ; BASE.r.x = 1
end namespace    
I'm sure I'll be back to read this again.

_________________
¯\(°_o)/¯ unlicense.org
Post 21 Dec 2018, 23:13
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7310
Location: Kraków, Poland
I'm testing a modification to make this even more compatible with fasm 1. The fasmg engine allows the "last label" to be from a different namespace than the current one, so I could probably force this to use any label that was not started with a dot, regardless of the namespace where its final symbol resides.

The way initially I designed it for fasmg seemed simple and clear from theoretical point of view, but the parts where it differs from fasm 1 are not very usable in practice. So making it backwards-compatible might be a better choice, even if a little bit more clunky in internal implementation.
Post 16 Feb 2019, 08:28
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7310
Location: Kraków, Poland
I'm releasing it, it seems to work well. Is it very likely that the parts of fasmg's specification that were so non-intuitive in practical use have never been actually used by anyone, so this change may in fact not break anything. But please let me know if you find anything that stopped working because of this change.

The compatibility with fasm 1 is now stronger, even though underlying structures are very different:
Code:
BASE:
.x = 1 ; this is BASE.x

BASE.y:
.x = 2 ; this is BASE.y.x    


Additionally, I made NAMESPACE command nullify the "last label" setting and END NAMESPACE restore it:
Code:
BASE.x:

namespace BASE
  .y = 1 ; BASE..y = 1
  sub:
  .y = 2 ; BASE.sub.y = 2
end namespace

.y = 3 ; BASE.x.y = 3    
This allows to use NAMESPACE block to insert any code without disturbing the flow of labels in the surrounding source.
Post 16 Feb 2019, 11:54
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16702
Location: In your JS exploiting you and your system
Tomasz Grysztar wrote:
Code:
namespace BASE
  .y = 1 ; BASE..y = 1    
Hmm. That looks weird to me. Those double dots! Confused
Post 16 Feb 2019, 12:12
View user's profile Send private message Visit poster's website Reply with quote
Lost_Ghost123



Joined: 12 Feb 2019
Posts: 29
This change seems to be for the better. Will try to keep this in mind.
Post 16 Feb 2019, 12:59
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7310
Location: Kraków, Poland
revolution wrote:
Hmm. That looks weird to me. Those double dots! Confused
This is another aspect of how the new world of NAMESPACE needs to cooperate with the legacy "starting dot" syntax. You can ease it on the eyes with help of "#" operator, as in this excerpt from the manual
Quote:
[...] The following example demonstrates the two methods of identifying such symbol:
Code:
        namespace base
                ..other = 1
        end namespace

        result = base.#..other    
The "#" character has been inserted into the last identifier for a better readability, but the plain sequence of three dots would do the same.
Post 16 Feb 2019, 13:35
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16702
Location: In your JS exploiting you and your system
It looked like an empty namespace.
Code:
namespace BASE
  .y = 1 ; BASE.<empty>.y = 1    
Post 16 Feb 2019, 13:39
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7310
Location: Kraków, Poland
revolution wrote:
It looked like an empty namespace.
Code:
namespace BASE
  .y = 1 ; BASE.<empty>.y = 1    
Yes, you can also understand it that way. To quote the manual again:
Quote:
When an identifier starts with a dot, but there is no label that would be a parent for it, the identifier refers to the descendant of a special symbol that resides in the current namespace but has no name.
Both interpretations conclude the same.
Post 16 Feb 2019, 14:12
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7310
Location: Kraków, Poland
By making it possible to have a current base label that is not from current namespace, this new system allows for some pretty interesting tricks. I'm not going to encourage them, though - because mixing the two systems too much would be most likely not a good habit, considering clarity of the source text.
Post 16 Feb 2019, 17:29
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:  
Goto page Previous  1, 2

< 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


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.