flat assembler
Message board for the users of flat assembler.

Index > Main > [fasmg] Troubles with defined/definite

Goto page Previous  1, 2, 3
Author
Thread Post new topic Reply to topic
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8427
Location: Kraków, Poland
Tomasz Grysztar 22 May 2025, 07:24
Did a bit of fuzzing to ensure that it's stable enough to not catch fire immediately, and I merged it into main branch. My long experience with fasm development tells me that I get the best testing coverage by releasing early. Wink And I really want to have this in fasm2 project, it's an invaluable addition there.
Post 22 May 2025, 07:24
View user's profile Send private message Visit poster's website Reply with quote
fabbel



Joined: 30 Oct 2012
Posts: 103
fabbel 22 May 2025, 12:02
Hi,
'?' preffix prepended to identifier seems to be causing problems to fasmg when using number modifier.... running for some time then exiting with exit code -1073741819

Code:
calminstruction test_num? arg&
        local _arg

                arrange _arg, arg
                stringify _arg

                match arg=number, arg, =
                jno @fail

                display _arg bappend ' is a litteral number' bappend  0x0A0D
                exit

        @fail:
                display _arg bappend ' is NOT a litteral number' bappend  0x0A0D
end calminstruction


test_num ?dummy
    
Post 22 May 2025, 12:02
View user's profile Send private message Reply with quote
fabbel



Joined: 30 Oct 2012
Posts: 103
fabbel 22 May 2025, 12:12
... actually it looks to be same err behavior with any special character except '#'
Post 22 May 2025, 12:12
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8427
Location: Kraków, Poland
Tomasz Grysztar 22 May 2025, 12:31
Fixed!
Post 22 May 2025, 12:31
View user's profile Send private message Visit poster's website Reply with quote
fabbel



Joined: 30 Oct 2012
Posts: 103
fabbel 22 May 2025, 12:39
... indeed... amazingy fast as always .. tx !
Post 22 May 2025, 12:39
View user's profile Send private message Reply with quote
fabbel



Joined: 30 Oct 2012
Posts: 103
fabbel 11 Jun 2025, 13:34
Hi Tomasz,

the new match /modifier feature is really nice.. helping to greatly simplify code,
where advanced parsing is needed..

however, i have a small issue, illustrated by below snippet
Code:
calminstruction test arg*&
        local _name, _tail

                match _name:name _tail?, arg, :
                jno @err_invalid_name

                arrange _name, _name.=suffix
                stringify _name
                display 'suffixed name: ' bappend _name bappend 0x0A0D
                exit

        @err_invalid_name:
                stringify arg
                err 'invalid identifier / name specif. -> ' bappend arg bappend 0x0A0D
end calminstruction

test dummy = 1
    


... which gives below output :
Quote:

flat assembler version g.ktge
suffixed name: dummy .suffix


=> note the space after identifier 'dummy' in 'dummy .suffix' - where i would have expected 'dummy.suffix'
=> is this intended ? am i missing sthg ?
can u pls have a look
tx
Post 11 Jun 2025, 13:34
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8427
Location: Kraków, Poland
Tomasz Grysztar 11 Jun 2025, 13:59
Yes, I'm aware of that issue, I was hoping it would not be a big deal. It's a limitation of the engine that causes the trailing whitespace to be consumed when parsing an identifier. This was never a problem when fasmg was only using it internally, because identifier was always interpreted as already complete pointer to a symbol, but once you try to append anything, like in your example, the redundant whitespace causes trouble.

Unfortunately, this limitation is integral to the old core of fasmg's engine, so the only workaround I can offer is to strip the whitespace afterwards with just a regular wildcard matching:
Code:
                match _name:name _tail?, arg, :
                jno @err_invalid_name
                match _name,_name ; this strips the whitespace    
Post 11 Jun 2025, 13:59
View user's profile Send private message Visit poster's website Reply with quote
fabbel



Joined: 30 Oct 2012
Posts: 103
fabbel 11 Jun 2025, 14:03
ok i see.. will use workaround as suggested then... tx
Post 11 Jun 2025, 14:03
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3

< 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.