UDL code folding



  • I have a user defined language for blamscript the language used in the halo games, it’s basically lisp with different keywords. I cant figure out how to set up code folding correctly though.

    If I use the built in lisp language folding works (but not highlighting etc), is there any way i can just look at the lisp language in the user defined language viewer window?



  • @Sean-Bertoniere said in UDL code folding:

    is there any way i can just look at the lisp language in the user defined language viewer window

    No, UDL and builtin lexers are totally different.
    If you provide some examples we might be able to offer some suggestions.



  • @Sean-Bertoniere said in UDL code folding:

    it’s basically lisp with different keywords.

    Then that should be really easy to do in the builtin Lexer. Settings > Style Configurator > LISP has User-defined keywords available on FUNCTION WORD, FUNCTION WORD2, and OPERATOR. (By default, FUNCTION WORD and FUNCTION WORD2 have the same stylings applied, but you could change that, in order to get 3 distinct highlights; maybe leave FUNCTION WORD as the standard lisp keywords, and put the halo-specific keywords in FUNCTION WORD2 and/or OPERATOR.) All you have to do is add a space-separated list of keywords into the User-defined keywords box, then click Save & Close



  • @PeterJones said in UDL code folding:

    @Sean-Bertoniere said in UDL code folding:

    it’s basically lisp with different keywords.

    Then that should be really easy to do in the builtin Lexer. Settings > Style Configurator > LISP has User-defined keywords available on FUNCTION WORD, FUNCTION WORD2, and OPERATOR. (By default, FUNCTION WORD and FUNCTION WORD2 have the same stylings applied, but you could change that, in order to get 3 distinct highlights; maybe leave FUNCTION WORD as the standard lisp keywords, and put the halo-specific keywords in FUNCTION WORD2 and/or OPERATOR.) All you have to do is add a space-separated list of keywords into the User-defined keywords box, then click Save & Close

    I tried this method, it only sort of works, problem is i cant remove default function keywords so they get autosuggested/completed even if they are not supported. Also not sure I can easily share between pcs this as i could the UDL file.

    @Ekopalypse said in UDL code folding:

    @Sean-Bertoniere said in UDL code folding:

    is there any way i can just look at the lisp language in the user defined language viewer window

    No, UDL and builtin lexers are totally different.
    If you provide some examples we might be able to offer some suggestions.

    heres the document everyone uses as reference:
    http://www.modacity.net/docs/bslbible/

    simple real example:

    (script continuous v2_killzone
    	(begin
    	(sleep 11)
              (if (and (= (vehicle_test_seat_list v2 "" (players)) false)(volume_test_object resetzone1 v2))
                (begin 
    	    (vehicle_unload v2 "")
                (object_create_anew v2)
               ))
    ))
    
    


  • This example doesn’t seem to be appropriate to show your issue with code folding.
    If I put ( and ) in Folding in code 1 style then I get the same what lisp seems to do. Left one is UDL, right one is LISP

    b8ebe726-8822-4082-9458-46da11fa680d-image.png

    The link provided doesn’t explain code workflow.
    At the moment I have to assume that a code block is, indeed,
    identified as the part between an open bracket and a closing bracket.


Log in to reply