flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Question about matching "dot" symbol within a name

Author
Thread Post new topic Reply to topic
Siberian



Joined: 09 Mar 2010
Posts: 14
Siberian
A lot of questions from me today. Smile

Another one is concerning matching dot (.) symbol within a name. Example how this could work:
Code:
macro MatchDot name {
     match parent =. child, name \{
                display \`parent\#'.'\#\`child, 13, 10
        \}
}

MatchDot SimpleName   ; shouldn't display anything
MatchDot Dotted.Name   ; Should display "Dotted.Name"
    

The example itself doesn't work, and the question is, how to make it work
(if it is possible at all).
Post 13 Mar 2010, 19:21
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
Siberian,

It wouldn't work because «Dotted.Name» is a single token, not «Dotted»«.»«Name». You may force this with Dotted\.\Name, though (backslashes will be stripped as a step of macro expansion).
Post 13 Mar 2010, 19:55
View user's profile Send private message Reply with quote
Siberian



Joined: 09 Mar 2010
Posts: 14
Siberian
Thanks, again.
I guess, in that case I will have to use some other symbol instead of dot to divide parts of symbolic names.
Though in your example it is also possible to use space symbol instead of backslash. It works as well.
Post 13 Mar 2010, 20:16
View user's profile Send private message Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
Yes, space separates symbols. You don't even need a dot in that case.

_________________
Previously known as The_Grey_Beast
Post 14 Mar 2010, 13:32
View user's profile Send private message 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


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.