Bug 463797 - Keyword list items w/ context
Summary: Keyword list items w/ context
Status: REPORTED
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: framework (other bugs)
Version First Reported In: unspecified
Platform: unspecified All
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-03 21:05 UTC by Alex Turbov
Modified: 2023-01-03 21:05 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Turbov 2023-01-03 21:05:30 UTC
Doing a new syntax file, I again hit the pattern when I need per keyword context switch. E.g. smth like this:
```xml
  <highlighting>
    <list name="commands">
        <item>satu</item>
        <item context="dua_ctx">dua</item>
        <item>tiga</item>
        <item context="empat_ctx">empat</item>
    </list>

    <contexts>
        <context attribute="Normal Text" lineEndContext="#stay" name="Normal Text">
            <!-- ... -->
            <keyword attribute="Command" context="#stay" String="commands"/>
            <!-- ... -->
        </context>

        <context attribute="Command Args" lineEndContext="#stay" name="dua_ctx">
            <!-- special case for the `dua` command -->
        </context>

        <context attribute="Command Args" lineEndContext="#stay" name="empat_ctp">
            <!-- special case for the `empat` command -->
        </context>

        <!-- ... -->

    </contexts>
    <!-- ... -->
```

I.e., for the keyword list items w/ context attribute, switch to the specified context in case of a match. Otherwise, if not specified per item context, switch to the context specified in the `keyword` rule.

It'll be nice if anyone can implement it ;-)