Commenting character also part of an operator

Commenting character also part of an operator

Melianor

    Jul 17, 2005#1

    Hello,

    In the language I'm using | is the comment character (till the end of the line) but || is the OR operator.

    I've been trying to handle this by using:

    Line Comment Preceding Chars = [~|]
    Line Comment Num = 2|
    Block Comment On = |*
    Block Comment Off = *|

    It's a cludgy workaround since technically "| " is not a comment. Everytime I just use | for the comment character, however, it ends up commenting out the rest of the OR operator and the rest of the line.

    Anyone have any suggestions on how I fix this?

    The basic rule is | is a comment till the end of the line except
    || which is the OR Operator

    Thanks!

    6,683583
    Grand MasterGrand Master
    6,683583

      Jul 18, 2005#2

      The definition looks correct. Have you also added | to the /Delimiters list?
      Best regards from an UC/UE/UES for Windows user from Austria

      Melianor
      Melianor

        Jul 18, 2005#3

        Yes, and I put the || as an operator as well.


        Here is the whole section of the Wordfile.txt

        Code: Select all

        /L11"Macroscript" Nocase Line Comment Preceding Chars = [~|] Line Comment = | Block Comment On = |* Block Comment Off = *| Escape Char = \ String Chars = "' File Extensions = MAC INC
        /Delimiters = <>=~!@%^&()+{}[];"'    ,?|
        /Function String = "%^([a-zA-Z_0-9^[^]*]+^)[ ^t]+([^p*&, ^t^[^]a-zA-Z_0-9.!]++)[~;]"
        /Function String 1 = "%[a-zA-Z_0-9*]*::^([a-zA-Z_0-9^~]+^)[ ^t^p]++([^p*&, ^t^[^]/*=:&a-zA-Z_0-9./(!]++)[~;]"
        /Function String 2 = "%[a-zA-Z_0-9^][a-zA-Z_0-9^[^]]+[ ^t*]+^([a-zA-Z_0-9]+^)[ ^t]++([^p*&, ^t^[^]a-zA-Z_0-9./(!]++)[~;]"
        /Function String 3 = "%[a-zA-Z_0-9*&$^[^]*]+[ ^t]+[a-zA-Z_0-9*&$^[^]]+[ ^t*]+^([a-zA-Z_0-9]+^)[ ^t]++([^p*&, ^t^[^]a-zA-Z_0-9./(!]++)[~;]"
        /Function String 4 = "%[a-z_0-9^[^]*]++ [a-z_0-9*^[^]]+[ ^t]++[a-z_0-9*^[^]]+[ ^t]++^([*a-z_0-9]+^)[ ^t]++([^p*&, ^t^[^]a-z_0-9./(!]++)[~;]"
        /Function String 5 = "%^([a-zA-Z_0-9^[^]*]+^)[ ^t]++([^p*&, ^t^[^]a-zA-Z_0-9./()!]++)[~;]"
        /Indent Strings = "{" ":"
        /Unindent Strings = "}"
        /C1"Commands"
        // /alert /alias
        // /breakin /banklist /beep /buyitem
        // /call /cast /charinfo /click
        // /declare /delay /destroy /doevents /doors /doortarget
        // /echo /editmacro /endmacro
        // /face /filter /finditem /for
        // /goto
        // /help
        // /identify /if /ini /items /itemtarget
        // /keepkeys
        // /listmacros /loadspells /location /loginname /look
        // /macro /mapfilter /maxfps /memspell /mouseclickl /mouseclickr /mouseto /mqlog /mqpause
        // /press
        // /return
        // /selectitem /sellitem /sendkey /setautorun /seterror /shout /skills /spew
        // /telnet /target
        // /unload /updateitems
        // /varadd /varand /varcalc /varcat /varlshift /varor /varrshift /varset /varsub
        // /where /who /whofilter /whotarget /windowstate
        // /zapvars /zem
        /C2"Variables"
        $abs $acos $alert $arg $asin $atan
        $banker
        $char $combat $corpse $cos $count $cursor
        $date $dec $defined $distance $door
        $envopen $equip
        $find $freeinv
        $gamestate $getlasterror $getlastfindslot $gm $ground $group
        $heading $hex
        $id $if $ini $instr $int $invpanel $item
        $lastcommand $lasttell $lcase $left $loginname
        $macro $merchant $mid $mouse
        $pack
        $rand $return $right $running
        $searchspawn $selecteditem $sin $spawn $spell $strlen
        $tan $target $time
        $ucase
        $zone
        /C3"EQ Commands"
        // /adriver /afk /anon /assist /auction /autosplit /autoinventory /attack
        // /book /bug
        // /camp /cast /channel /charinfo /chatfontsize /consent /consider /corpse
        // /decline /disband /doability /duck /duel /dynamiclights /destroy 
        // /emote /exit 
        // /fastdrop /feedback /filter /follow /friend /ftell 
        // /g /gems /getguildmotd /gsay /guilddelete /guildinvite /guildmotd /guildpeace /guildleader /guildremove /guildsay /guildstatus /guildwar
        // /help /hidecorpses
        // /ignore /inspect /invite /invwinlabels
        // /language /lfg /log /loc /loot /lootnodrop
        // /mcicontrol /mousespeed /msg
        // /note
        // /ooc
        // /pet /petition /played
        // /quit
        // /random /reply /report /resetwindows /reverb /reversesound /roleplay
        // /say /sdriver /serverfilter /shout /shownames /shownpcnames /showspelleffects /sit /split /stopsong /surname
        // /tell /time /toggleinspect /trackfilter /trackplayers /tracksort
        // /usecolor
        // /vrdelay
        // /who
        // /yell
        /C4"Array Index/Operators"
        *
        +
        -
        =
        // /
        %
        &
        >
        <
        ==
        !=
        <=
        >=
        ~~
        !~
        \
        ^
        ||
        /C5"Macro Keywords"
        aa ability add alert all ammo any arms array array2 auto
        back bank birth book bound buff buy
        castradius casttime charm chest class clear color combine concolor corpse count cur
        debug defaultheading defaultx defaulty defaultz distance done door down duration
        ear1 ear2 else encumber enhanced enviro
        face fast feet finger1 finger2 food
        gem gender give global gold gm ground guild
        h hands head heading headingto held hotkey hp hslider
        id increased inv item
        left leggs level lfg light list loc local look lore
        m macro magic main mana map master max merchant money mycasttime mycorpse myself
        n name npc neck next noalert noarrays nodrop none nopcnear nopredict norent notid notimers novars npctrade nearalert notnearalert
        off on open
        pack pc pct pet plat position previous predict primary
        race radius range ranged recasttime recoverytime remove right
        s secondary sell shoulder silver size shield slot skills speed spell spellbook stack stamina state spawnradius
        target timer to trigger type
        up
        value vector
        waist weight wrist1 wrist2
        x
        y
        z zradius zrange
        ** Event_
        /C6"EQ Emotes"
        // /Agree /Amaze /Apologize /Applaud
        // /Bite /Bleed /Blink /Blush /Boggle /Bonk /Bored /Bow /Brb /Burp /Bye
        // /Cackle /Calm /Cheer /Clap /Comfort /Congratulate /Cough /Cringe /Cry /Curious
        // /Dance /Drool /Duck
        // /Eye
        // /Fidget /Flex
        // /Gasp /Giggle /Glare /Grin /Groan /Grovel
        // /Happy /Hungry
        // /Introduce
        // /Jk
        // /Kneel
        // /Lost
        // /Massage /Moan /Mourn
        // /Nod /Nudge
        // /Panic /Pat /Peer /Plead /Point /Ponder /Purr /Puzzle
        // /Raise /Ready /Roar /Rofl /Salute
        // /Shiver /Shrug /Sigh /Smack /Smirk /Snarl /Snicker /Stare
        // /Tap /Tease /Thank /Thirsty
        // /Veto
        // /Wave /Welcome /Whine /Whistle
        // /Yawn
        /C7"Functions"
        ** :
        /C8"Pre-Processor"
        #turbo
        #define
        #include
        #event
        #chat
        /C9"Inventory Slots"
        ammo arms
        back
        charm chest
        face feet
        hands head
        leftear leftfinger leftwrist legs
        mainhand
        neck
        offhand
        ranged rightear rightfinger rightwrist
        shoulder
        waist
        ** bank bazaar enviro inspect loot merchant pack sharedbank trade
        /C10"Spawn Filters"
        alert any
        bard beastlord ber berserker brd bst body
        check checknext class cleric clr corpse
        enc enchanter
        dru druid
        GUILD
        gm group guild
        id
        knight
        light lfg loc
        mag magician mnk monk
        named nearalert nec necromancer next noalert noguild nopcnear nopet notid notnearalert npc
        pal paladin pc pet prev
        ranger rng rog rogue
        shd shm shaman shadow
        timer trader trap trigger
        untargetable
        radius range
        war warrior wiz wizard
        zradius
        
        Here's a simple snippet of what's wrong:

        Code: Select all

        |This is a comment that works correctly
        
        /declare Hiya string outer |Comments work fine at the endof the line
        
        |* Here is a comment block that works correctly *|
        
        /if (This && That || theOther) { /echo Hi }
        
        | The previous line on my installation has from || to the end of the line as a comment.

        6,683583
        Grand MasterGrand Master
        6,683583

          Jul 18, 2005#4

          Your line comment is not what you wrote at your first post. Use

          Code: Select all

          /L20"Macroscript" Nocase Line Comment Preceding Chars = [~*|] Line Comment Num = 2|  Block Comment On = |* Block Comment Off = *| Escape Char = \ String Chars = "' File Extensions = MAC INC
          Note the 2 spaces after Num = 2|.

          You have to write always a space after |, if you want it as line comment. There is no workaround for it at the moment. Use a regular expression replace to quickly modify existing line comments without space after |.

          Other mistakes:

          The "words" == != <= >= ~~ !~ || in color group /C4 are useless. Because these characters are also delimiters, != for example is "word" ! and "word" =. So remove these combinations of delimiters and add a single ! and ~ to the group.

          UltraEdit supports only 8 color groups. /C9 and /C10 are not interpreted by UE. You have to move these words to other color groups.
          Best regards from an UC/UE/UES for Windows user from Austria