Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Defining own language - operators/comment style issue using the '§' sign

    Help wanted · · · – – – · · ·
    2
    2
    38
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • sesa150162
      sesa150162 last edited by

      I’ m having an issue adding styling for a custom language
      The issue :
      I want to add Syntax highlight for all operators starting and stopping with a ‘§’ sign , like : §operator§ §text§ §abcdefg§

      I’ve tried to add the § sign as Open and Close character in Operator style section as a Delimiter style but it seems that the specific § sign does not work .

      I also tried by using Comment Style Open and Close but with same result .

      I can use § in prefixmode in Keyword list but that does only tell if I am using it in the beginning , not that it has a § as a close sign.

      I would be more than happy if anyone can find a solution for my issue

      PeterJones 1 Reply Last reply Reply Quote 0
      • PeterJones
        PeterJones @sesa150162 last edited by

        @sesa150162 ,

        Unfortunately, the § is at codepoint U+00A7, which is outside the range that UDL officially supports (it is only guaranteed to work with U+0020 to U+007F). There have been at least two issues (#6014 and #8562) requesting Unicode support in UDL, but UDL doesn’t get much attention, so they remain open.

        As a workaround, you can add extra highlighting to a builtin lexer or to your User Defined Language (UDL) using regexes via the script EnhanceAnyLexer.py that @Ekopalypse shares in his github repo. Since the matching is done on the Python side, it has full Python 2.7 support for Unicode strings, so you should be able to define your regex inside that script like u'§\w+§' or maybe r'§\w+§'

        1 Reply Last reply Reply Quote 1
        • First post
          Last post
        Copyright © 2014 NodeBB Forums | Contributors