|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<language id="piccodescript" name="Piccodescript" version="2.0" _section="Script"> |
| 3 | + <metadata> |
| 4 | + <property name="mimetypes">text/x-piccodescript</property> |
| 5 | + <property name="globs">*.pics</property> |
| 6 | + <property name="line-comment-start">//</property> |
| 7 | + <property name="block-comment-start">/*</property> |
| 8 | + <property name="block-comment-end">*/</property> |
| 9 | + <property name="suggested-suffix">.pics</property> |
| 10 | + </metadata> |
| 11 | + |
| 12 | + <styles> |
| 13 | + <style id="comment" name="Comment" map-to="def:comment"/> |
| 14 | + <style id="escaped-character" name="Escaped Character" map-to="def:special-char"/> |
| 15 | + <style id="multiline-string" name="Multiline string" map-to="def:string"/> |
| 16 | + <style id="string" name="String" map-to="def:string"/> |
| 17 | + <style id="keyword" name="Keyword" map-to="def:keyword"/> |
| 18 | + <style id="boolean" name="Boolean value" map-to="def:boolean"/> |
| 19 | + <style id="floating-point" name="Floating-point number" map-to="def:floating-point"/> |
| 20 | + <style id="decimal" name="Decimal number" map-to="def:decimal"/> |
| 21 | + <style id="base-n-integer" name="Base-N number" map-to="def:base-n-integer"/> |
| 22 | + <style id="type" name="Data Type" map-to="def:type"/> |
| 23 | + </styles> |
| 24 | + |
| 25 | + <definitions> |
| 26 | + |
| 27 | + <define-regex id="escaped-character" extended="true"> |
| 28 | + \\( # leading backslash |
| 29 | + [\\\"\'nrbtfs] | # escaped character |
| 30 | + [0-7]{1,3} | # latin encoded char |
| 31 | + u+[0-9a-fA-F]{4} # unicode char |
| 32 | + ) |
| 33 | + </define-regex> |
| 34 | + |
| 35 | + <context id="string" style-ref="string" end-at-line-end="true" class="string" class-disabled="no-spell-check"> |
| 36 | + <start>"</start> |
| 37 | + <end>"</end> |
| 38 | + <include> |
| 39 | + <context id="escaped-character" style-ref="escaped-character"> |
| 40 | + <match>\%{escaped-character}</match> |
| 41 | + </context> |
| 42 | + </include> |
| 43 | + </context> |
| 44 | + |
| 45 | + <context id="multiline-string" style-ref="multiline-string" class="string" class-disabled="no-spell-check"> |
| 46 | + <start>"""\s*$</start> |
| 47 | + <end>"""</end> |
| 48 | + <include> |
| 49 | + <context style-ref="escaped-character"> |
| 50 | + <match>\%{escaped-character}</match> |
| 51 | + </context> |
| 52 | + </include> |
| 53 | + </context> |
| 54 | + |
| 55 | + <context id="flow" style-ref="keyword"> |
| 56 | + <keyword>import</keyword> |
| 57 | + <keyword>module</keyword> |
| 58 | + <keyword>when</keyword> |
| 59 | + <keyword>is</keyword> |
| 60 | + <keyword>if</keyword> |
| 61 | + <keyword>else</keyword> |
| 62 | + <keyword>do</keyword> |
| 63 | + <keyword>catch</keyword> |
| 64 | + <keyword>use</keyword> |
| 65 | + <keyword>let</keyword> |
| 66 | + <keyword>in</keyword> |
| 67 | + </context> |
| 68 | + |
| 69 | + <context id="boolean" style-ref="boolean"> |
| 70 | + <keyword>false</keyword> |
| 71 | + <keyword>true</keyword> |
| 72 | + </context> |
| 73 | + |
| 74 | + <context id="floating-point" style-ref="floating-point"> |
| 75 | + <match extended="true" case-sensitive="false"> |
| 76 | + \b( |
| 77 | + \d+[fd] | |
| 78 | + ((\d*\.\d+|\d+\.)(e[-+]?\d+)? | |
| 79 | + \d+e[-+]?\d+)[fd]? |
| 80 | + ) |
| 81 | + </match> |
| 82 | + </context> |
| 83 | + <context id="base-n-integer" style-ref="base-n-integer"> |
| 84 | + <match case-sensitive="false">\b(0x[\da-f]+|0[0-7]+)l?</match> |
| 85 | + </context> |
| 86 | + <context id="decimal" style-ref="decimal"> |
| 87 | + <match case-sensitive="false">\b([1-9]\d*|0)l?</match> |
| 88 | + </context> |
| 89 | + |
| 90 | + <context id="piccodescript" class="no-spell-check"> |
| 91 | + <include> |
| 92 | + <context ref="multiline-string"/> |
| 93 | + <context ref="string"/> |
| 94 | + <context ref="flow"/> |
| 95 | + <context ref="boolean"/> |
| 96 | + <context ref="floating-point"/> |
| 97 | + <context ref="base-n-integer"/> |
| 98 | + <context ref="decimal"/> |
| 99 | + </include> |
| 100 | + </context> |
| 101 | + |
| 102 | + </definitions> |
| 103 | +</language> |
0 commit comments