Dark Basic Professional highlighting

Dark Basic Professional highlighting

3
NewbieNewbie
3

    Jan 15, 2006#1

    This is my first post. I have spent the last 6 hours trying to make UE understand the keywords used in Dark Basic Professional. Its a language for rapid development 3D applications. I like it - however the IDE it comes with sucks (its about 4 years old and all development on it has ceased). I really like UE - its just so friendly to work with. I have a full list of all the keywords, however they contain spaces. I researched on this forum but I fear that keywords have to be all "one word" keywords and this is something that IDM are looking into? On the off chance there is a genius here that can help me, I pose the following conundrum :-)

    For the most part, highlighting is ok - however, sometimes commands are not fully detected, for example, it does:
    array insert at bottom MenuOptions()
    when it should be:
    array insert at bottom MenuOptions()

    Basically, its detecting the short word before the longer word.

    I have written a syntax highlighting in PHP that works on the principle of matching the longest word possible first - works a treat. Problem is:
    1) UE seems to match in alphabetical order.
    2) You can seem to specify that each line should be matched from begining to end in the word file, for example:

    Code: Select all

    CAMERA ANGLE X
    CAMERA ANGLE Y
    CAMERA ANGLE Z
    CAMERA POSITION X
    CAMERA POSITION Y
    CAMERA POSITION Z
    should only match an entire line, not just the word camera.

    I understand you can delimit by characters other than space, but does this apply to the wordfile.txt too? Could I tell UE to delimit the keywords by "\n" only?

    Cheers guys :-)

    6,686585
    Grand MasterGrand Master
    6,686585

      Jan 15, 2006#2

      njt1982 wrote:I researched on this forum but I fear that keywords have to be all "one word" keywords and this is something that IDM are looking into?
      Yes, that's true. It is not possible to define more than one word as a "keyword". A space in the wordfile is always a word delimiter and it is not possible to define keyphrases what you would need.

      You can only add all words to the wordfile, that are part of a keyphrase of your language. The words of a color group must be sorted alphabetically and this sort must be case-sensitive, if the Nocase keyword does not exist in the language definition line.

      Best use my word definitions sorting macro at the ultimate word definitions sorting macro which knows all rules and produces clean wordfile definitions. I have done it on your file and it worked well.

      But you have to live with wrongly highlighted short words like "AT", "OF", "ON", "X", "Y", "Z", etc. if the are used not in a keyphrase.
      Best regards from an UC/UE/UES for Windows user from Austria

      3
      NewbieNewbie
      3

        Jan 15, 2006#3

        Thanks very much for your reply. Has IDM released any time scale for when this is to be sorted? Its easily sorted either by allowing the keyword(s) in length order, or alternatively, allowing some way or grouping them (speech marks, brakets, etc).
        Considering how advanced UE is, I'm very surprised this isn't a feature already - especially as we're up to V11.20a now!!!

        6,686585
        Grand MasterGrand Master
        6,686585

          Jan 16, 2006#4

          No, there are no plans for support of keyphrases instead of keywords. This would need a total change in concept of syntax highlighting and I estimate that 99% of the languages would not need it.
          Best regards from an UC/UE/UES for Windows user from Austria

          344
          MasterMaster
          344

            Jan 16, 2006#5

            Hi guys,

            I agree with Mofi. Most scenarios work well with UE.
            But things like "colorize all my 'length'-constants in blue":

            KO_LEN_KDNR
            KO_LEN_ANOTHERBLUE

            KO_LEFT_NO_MORE_BLUE

            cannot be done today without specifying each one of them explicitly :-(

            The only thing UE can do is to differentiate by the starting-stuff (** blabla).

            I posted a request long ago for regexp-coloring-support, but they rejected it because of performance troubles...

            rds Bego
            Normally using all newest english version incl. each hotfix. Win 10 64 bit

            3
            NewbieNewbie
            3

              Jan 16, 2006#6

              regexp coloring would work really well, but I can understand the performance fun.

              Then again - on anything more than 1Ghz, it shouldn't be too bad should it? Surely it only colours in the "effected" lines. It wouldn't require complete recoloring whenever there is a keypress, surely?

              6,686585
              Grand MasterGrand Master
              6,686585

                Jan 16, 2006#7

                I think, the performance would suffer dramatically if regular expressions are allowed for syntax highlighting everywhere. I have a 2 GHz Pentium 4 and a 500 MHz Celeron. The code folding feature already slows down working a lot, if the file is big.

                Well, code folding works on whole file and syntax highlighting have only to work on current visible part. But this is bad enough if you think about HTML files from Microsoft with a line length of more than 4000 characters. 40 lines visible each with more than 4000 characters (and not auto-wrap) there are many bytes to be searched.

                Additional problem: What about phrases which are found by more than one regular expression. That's not possible with a simple word list, but can easily happen with regular expressions.

                Also the method must be completely changed. I guess, actually UltraEdit identifies a word in the source file and then looks into the word list table, if it finds a match. It's a very good method to update syntax highlighting fast during editing. Using regular expressions would reverse the search. First search in the text and if found highlight the phrase. UltraEdit has then to remember which words are already highlighted and which not before doing next regular expression search.

                Many other things have to be taken into consideration for regular expression syntax highlighting (auto-correct keywords, auto-complete, etc.).
                Best regards from an UC/UE/UES for Windows user from Austria