Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

New UserDefinedLanguage module

Loreia2
2011-07-30
2015-04-30
<< < 1 .. 21 22 23 24 25 .. 27 > >> (Page 23 of 27)
  • Loreia2
    Loreia2
    2013-02-12

    Hi jjker,

    try to use "Folding in code 2" style.
    "Folding in code 1" is meant for special operators like { }.

    BR,
    Loreia

     
    • jjker
      jjker
      2013-02-18

      Thank you Loreia
      It is OK now with "Folding in code 2".

      BR

      Jean-Jacques

       
  • Ancient
    Ancient
    2013-02-13

    Hi,

    Is there any way to use ASCII control characters as delimiters? Or rather, use the hex value for delimiters?

    For example (replace the \x1B with the actual character):

    KEY \x1B\x1BVALUE\x1B\x1B

    I would like the \x1B\x1BVALUE\x1B\x1B part to be highlighted. I've tried putting in various representations of the character, but it doesn't seem to work...

    Thanks

     
  • Loreia2
    Loreia2
    2013-02-13

    Hi Ancient ,

    any value below ' ' (ASCII 32) is treated as white space, and cannot be used as Delimiter (or anything else in UDL).

    BR,
    Loreia

     
  • Gin
    Gin
    2013-02-14

    EDIT: I fixed my earlier problem. while the program itself will recognize all comments starting with a semicolon (aside from those inside strings obviously) I have them highlight by using 2 semicolons

    My last problem would be...
    is there any way to highlight variables

    for example ONScripter-EN uses a command called numalias to create number variables the order is, command, variable name, number alias (basically it's equivalent of a pointer)

    numalias mylife, 801 (tabs don't affect it)

    so that would be my last issue... is there a way to highlight number variables (not to concerned on character variables since there are few) names

     
    Last edit: Gin 2013-02-16
  • Loreia2
    Loreia2
    2013-02-16

    Hi Erwin,

    no, you can't highlight variables, because variables can have any name. Thus you can't specify them in UDL. The only exception would be naming all your variables with a common prefix, say varSOMENAME. Now you could specify Keyword1 type as 'var' (without quotes) and tick "Prefix" check box.

    BR,
    Loreia

     
  • Gin
    Gin
    2013-02-16

    I feared as much but this is a whole lot better than nothing since there nothing else I'm aware of to highlight this language. Thank you all I need is some help figuring out the two folding problems I been having and I'm set.

     
  • Gin
    Gin
    2013-02-16

    I feared as much but this is a whole lot better than nothing since there nothing else I'm aware of to highlight this language. Thank you all I need is some help figuring out the two folding problems I been having and I'm set.

     
  • Loreia2
    Loreia2
    2013-02-16

    Hi Erwin,

    you can't fold based on labels. The only thing you can do is to use "Folding in comment" style to create custom folding points:
    http://udl20.weebly.com/folding-in-comment.html

    BR,
    Loreia

     
  • Rachel Ayoroa
    Rachel Ayoroa
    2013-03-03

    Hi Loreia2. Fist. Thank you for making this UDL feature! It's pretty freaking sweat. I couldn't find anything comparable in gedit, programmer's notepad, etc etc

    http://i.imgur.com/PGVYesg.png

    In the above file, I set up my delimiters to close with ((EOL)) Is there anyway to do something like close with ((EOL)) OR | so that I could have my comments be recognized?

     
  • Loreia2
    Loreia2
    2013-03-03

    Hi Rachel,

    that one is very easy in UDL. Just allow nesting of comments within Delimiter. Go to Styler of Delimiter defined as "start:m end:((EOL))" and in Nesting section tick Comments check box. As easy as that, I guess it really is "pretty freaking sweat" :-)

    BR,
    Loreia

     
  • Rachel Ayoroa
    Rachel Ayoroa
    2013-03-04

    Yikes that was easy. I should have spotted that. Thanks!

     
  • usacad1
    usacad1
    2013-03-08

    Hi Loreia,

    I've stumbled upon a problem with UDL 2.1 and definition of number styler. Maybe its me, but I can't get UDL2.1 to recognize this as a hex number: 16#F0F00

    I am using "Prefix 2" for 16#, then A-F in "Extras 1". UDL2.1 recognizes a number up to the first zero; i.e., 16#F0 is a number, but I can't find a way to recognize the other F00 as a number.

    Do you have any suggestion?

    Thanks,

     
  • Loreia2
    Loreia2
    2013-03-08

    Hi usacad1,

    I can't reproduce the issue. Can you send me your userLangDefine.xml file at:
    udlv20 at_ gmail dot _ com

    BR,
    Loreia

     
    Last edit: Loreia2 2013-03-08
    • usacad1
      usacad1
      2013-03-11

      Hi Loreia. I can send you the userdefinelang.xml, but since you showed me the UDL2 working, I got a little curios, and found how to easily create the issue.

      You are right that your example works... as long as you do not have anything "incompatible" in "Folding in code 1 style" (FIC1S for short). The moment you do, numbers stop being highlighted at the first matching letter for each word defined in FIC1S.

      So, in the example you showed me, define F in FIC1S, and the second F turns off, while the two trailing zeroes still remains highlighted. It's even clearer if you define the number as 16#F0F000F00000F00000F0000. Try to see for yourself: the first F in FIC1S turns off all the F starting from the second; if you define F0, all the F0 turns off; if you define F1 (or F followed by anything except 0), anything after 16#F0 turns off.

      I've created a new test language for this test and the only thing I have in userDefineLang.xml is Prefix 2 16#2, Extras 1 F.

       
      Last edit: usacad1 2013-03-11
      Attachments
  • Loreia2
    Loreia2
    2013-03-11

    Hi usacad1 ,

    thanks for detailed explanation.
    This problem is very subtle. You see Folding in code 1 style always matches searched string, regardless of surrounding characters. It was primarily created for stuff similar to C curly brace folding points:

    int function{
    return 0;
    }
    

    How does that affect numbers?
    Well, numbers end when first whitespace is found, or first forward keyword type, and Folding in code 1 IS a forward keyword type.
    So, 16#F will trigger number recognition, but number algorithm will first check for number boundaries before checking for number content, thus "F" will be treated as Folding in code 1 rather than as a number.

    Think of your example rewritten in C-like syntax, and it will be more obvious what I am talking about.:

    16#F0{000{00000}00000}0000
    

    So, you can't have ambiguous characters/strings in both numbers and Folding in code 1 types. If you still need to use "F" as a folding in code type, try to use Folding in code 2 .

    BR,
    Loreia

     
    • usacad1
      usacad1
      2013-03-12

      Hi Loreia,

      I've used Style 2 and the problem disappears.

      I wanted to point out that F was an example. I can use "FOR" instead of F and it would still result in all digits after 16#F0 not to be regarded as number. It seems UDL2 does matching based on letters, but when matching fails it somehow forgets to say "oh, it was a number, after all".

      Thanks

       
  • Loreia2
    Loreia2
    2013-03-14

    Hi usacad1,

    that was a bug. It should be fixed in latest beta 2.1.0.14.
    You can download it from here:

    https://docs.google.com/file/d/0B0lMdiEG3L5CcGdYbG9oaDhCSnM/edit

    (go to File / Download)

    This version also fixes several issue regarding malfunctioning Folding.

    BR,
    Loreia

     
  • Nic
    Nic
    2013-03-15

    Loreia, great job and thanks so much. All my folding comments issues have been resolved. I'll let you know if anything pops up, but that was very quick!

     
  • Loreia2
    Loreia2
    2013-03-15

    Hi Nic,

    actually problem was reported 2-3 weeks ago, so I wasn't that quick :-).
    Anyway, version 2.1.0.14 has a new patch for Folding problem (much simpler than the one I implemented in 2.1.0.13 two weeks ago), so I was looking for a tester to give it a spin. You came in at perfect time.

    I am also very interested in someone testing numbers detection, bug that usacad1 reported was a pretty big one, I wonder why it wasn't reported earlier. I guess no one needed such combination of keywords.

    BR,
    Loreia

     
    • usacad1
      usacad1
      2013-03-15

      Hi Loreia,

      The number bug seems fixed. I will keep you posted if I find new stuff. I assume the change will go official in NP++6.3.1, right?

      Thank you

       
  • Loreia2
    Loreia2
    2013-03-16

    Hi usacad1,

    that bug is fixed, but I wonder if I introduced new bugs with this change. I prefer to keep this one a bit longer in beta status, before sending code to Don to include it into the main branch. Say few more weeks.

    BR,
    Loreia

     
  • piotr_cz
    piotr_cz
    2013-03-18

    Hi there
    excuse me if this issue has been discussed somewhere previously

    I've a 'convenience' problem with the default UserDefinedLnaguage module and styles/themes:
    At the moment for each language and style there should be be separate language file (ie. https://github.com/thomsmits/markdown_npp).

    By default language files are styled for default theme (black on white) and colors are redefined in language .xml file. I fell in love with 'Bespin' style for which I need to customize every custom language styles by hand.

    My idea is add possibility to link <WordsStyle> tag in language file with it's <WordsStyle> equivalent in style file by adding an attribute like 'styleName':

    <WordsStyle
        name="COMMENT LINE" 
        fgColor="1E9AE0" 
        bgColor="2A211C" 
        ... 
        styleName="COMMENT LINE"
    />
    

    with fGcolor and bGcolor being interpreted as fallback in case that style file doesn't have such name.

    This way when one could prepare just one language file that would work across all styles

     
  • Loreia2
    Loreia2
    2013-03-18

    Hi Piotr,

    support for themes was asked several times already, but it is pretty low on priority list. I will not be working on this before making UDL algorithm the way I want it to be (much more flexible and feature rich than it is now). I'd say it will take most of (or whole) 2013 before finishing this task. Only then I can start working on theme support.

    Also, do you have some suggestions how to implement styling in UDL? To "invert" colors for dark themes, or to have user create two separate schemes (for dark and light themes)?

    P.S.
    You just need one userDefineLang.xml file, use import function and it will automatically merge several language definitions into one file.

    BR,
    Loreia

     
    Last edit: Loreia2 2013-03-18
  • Hi Loreia,

    First thing: thank you very much for this incredible work :)
    I love it.

    I have one issue with comments.
    In jBASE BASIC language comments stars with * (if in beginning of the line), but it is also multiplication operator. Another feature is that comments can be anywhere if preceded by semicolon (;).
    Now, example:

    * This is comment
    *This is comment too
        * This is also comment (with preceding whitespace)
        * Multiplication below:
        VAR1 = VAR2 * VAR3 ;* comments can start after semicolon
        VAR4 = VAR5 * VAR6 ; * comments after semicolon and space
        VAR7 = VAR8 * VAR9      ;       * another comment
    

    My problem is that I cannot figure how to make comments colorized in all above cases and not in multiplication.

    I selected "Allow preceding whitespace" in "Line comment position", so first 4 lines are formatted properly as comments.
    I tried ;* as "Open" in "Comment style" with success (partial, because semicolon is also colorized as comment) in line 5, but for line 6 '; *' won’t work properly.

    Maybe I misunderstood something and it can be done in some simple way, but I cannot figure it out.

    I think of 3 ways to do that (and all needs new feature).

    1. First way is to make some wildcard for whitespaces for example ((SPC)) so it can be used like this: ;((SPC))* as "Open" and ((EOD)) as "Close" in "Comment style".
    2. Another way is to make selected character (in this example semicolon) to be treated as line breaker, so everything after this character would be treated as new line, so "Comment line style" would work.
    3. Modification of second approach would be adding "allow preceding characters and whitespaces" option in "Line comment position" which would allow inputting special characters that could precede comment (semicolon in this example).

    Second and third way is better in my opinion because semicolon is not the part of comment. However first way can be useful in other (not related to my problem) cases.

    Could you please consider adding these new features to your list? :)
    I would be awesome :)

    Again, thanks for your excellent work.

    BR

    Marek

     
    Last edit: Defiant Plumber 2013-03-29
<< < 1 .. 21 22 23 24 25 .. 27 > >> (Page 23 of 27)