Last active
May 14, 2018 10:57
-
-
Save wallneradam/fba807085e174d03db12d5c90e34ca04 to your computer and use it in GitHub Desktop.
Broadcom QPU assembler language specification file for Textmate, and compatible editors like Visual Studio Code and IntelliJ platform (CLion)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>QASM</string> | |
<key>scopeName</key> | |
<string>source.asm.qasm</string> | |
<key>comment</key> | |
<string>Broadcom QPU assembly language</string> | |
<key>fileTypes</key> | |
<array> | |
<string>qasm</string> | |
<string>qinc</string> | |
</array> | |
<key>uuid</key> | |
<string>E82E7ADE-56A9-11E8-A223-1C3947C23EE3</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#comments</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#labels</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#mnemonics</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#includes</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#macro-func-decs</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#directives</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#alu-separators</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#macro-invocs</string> | |
</dict> | |
</array> | |
<key>repository</key> | |
<dict> | |
<key>comments</key> | |
<dict> | |
<key>comment</key> | |
<string>Comment</string> | |
<key>name</key> | |
<string>comment.line.number-sign</string> | |
<key>match</key> | |
<string>#.*$</string> | |
</dict> | |
<key>literals</key> | |
<dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>comment</key> | |
<string>Decimal</string> | |
<key>name</key> | |
<string>constant.numeric.dec</string> | |
<key>match</key> | |
<string>\b-?(?:[1-9][0-9]*|0)\b</string> | |
</dict> | |
<dict> | |
<key>comment</key> | |
<string>Hexadecimal</string> | |
<key>name</key> | |
<string>constant.numeric.hex</string> | |
<key>match</key> | |
<string>\b-?0x[0-9a-fA-F]+\b</string> | |
</dict> | |
<dict> | |
<key>comment</key> | |
<string>Binary</string> | |
<key>name</key> | |
<string>constant.numeric.binary</string> | |
<key>match</key> | |
<string>\b-?0b[01]+\b</string> | |
</dict> | |
<dict> | |
<key>comment</key> | |
<string>Octal</string> | |
<key>name</key> | |
<string>constant.numeric.octal</string> | |
<key>match</key> | |
<string>\b-?0[0-7]+\b</string> | |
</dict> | |
<dict> | |
<key>comment</key> | |
<string>Float</string> | |
<key>name</key> | |
<string>constant.numeric.binary</string> | |
<key>match</key> | |
<string>\b-?(?:[1-9][0-9]*|0)(?:\.[0-9]+)?(?:[eE][+\-]?[0-9]+)?\b</string> | |
</dict> | |
</array> | |
</dict> | |
<key>modifiers</key> | |
<dict> | |
<key>comment</key> | |
<string>Modifiers</string> | |
<key>name</key> | |
<string>keyword.modifier</string> | |
<key>match</key> | |
<string>\b\.(setf|sf|ifnz|nz|ifzc|zc|ifz|z|ifzs|zs|ifnn|nn|ifnc|nc|ifn|n|ifns|ns|ifcc|cc|ifc|c|ifcs|cs|allz|alln|allc|allnz|allnn|allnc|anyz|anyn|anyc|anynz|anynn|anync)\b</string> | |
</dict> | |
<key>operators</key> | |
<dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>comment</key> | |
<string>Single Operators</string> | |
<key>name</key> | |
<string>keyword.operator.single</string> | |
<key>match</key> | |
<string>(?:\b|\s|\(|\)|,)(?:[\()+\-~!*/%><&\^|]|<<|>>|<<|>>|<<<|>>>|><<|>><|><<<|>>><|>=|<=|<=>|\*\*|!\^|&&|\^\^|!\^\^|\|\|){1}(?:\b|\s|\(|\))</string> | |
</dict> | |
<dict> | |
<key>comment</key> | |
<string>Keyword operators</string> | |
<key>name</key> | |
<string>keyword.operator.keywords</string> | |
<key>match</key> | |
<string>\b(abs|ceil|floor|exp2|exp10|exp|log2|log10|log|cos|sin|tan|acos|asin|atan|cosh|sinh|tanh|acosh|asinh|atanh|erfc|erf)\b</string> | |
</dict> | |
</array> | |
</dict> | |
<key>pack-unpacks</key> | |
<dict> | |
<key>comment</key> | |
<string>Pack-unpacks</string> | |
<key>name</key> | |
<string>storage.modifier</string> | |
<key>match</key> | |
<string>\b\.(pack|unpack)?(32|32s|32si|16a|16ai|16af|16as|16asi|16b|16bi|16bf|16bs|16bsi|8888|8abcd|8888i|8abcdi|8888s|8abcds|8888si|8abcdsi|8888sf|8abcdsf|8a|8ai|8af|8as|8asi|8asf|8b|8bi|8bf|8bs|8bsi|8bsf|8c|8ci|8cf|8cs|8csi|8csf|8d|8di|8df|8ds|8dsi|8dsf|8dr)\b</string> | |
</dict> | |
<key>addresses</key> | |
<dict> | |
<key>comment</key> | |
<string>Relative addresses</string> | |
<key>match</key> | |
<string>(r)?(:\w+)</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>storage.modifier</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>string.label</string> | |
</dict> | |
</dict> | |
</dict> | |
<key>registers</key> | |
<dict> | |
<key>comment</key> | |
<string>Registers</string> | |
<key>name</key> | |
<string>variable.other.asm.register</string> | |
<key>match</key> | |
<string>\b(unif|vary|r0|r1|r2|r3|r4|r5|tmurs|r5quad|r5rep|elem_num|qpu_num|irq|interrupt|unif_addr|unif_addr_rel|x_coord|y_coord|ms_mask|rev_flag|stencil|tlbz|tlbm|tlbc|tlbam|vpm|vr_busy|vw_busy|vr_setup|vw_setup|vr_wait|vw_wait|vr_addr|vw_addr|mutex|mutex_acq|mutex_rel|recip|recipqstr|exp|t0s|t0t|t0r|t0b|t1s|t1t|t1r|t1b|ra1|ra2|ra3|ra4|ra5|ra6|ra7|ra8|ra9|ra10|ra11|ra12|ra13|ra14|ra15|ra16|ra17|ra18|ra19|ra20|ra21|ra22|ra23|ra24|ra25|ra26|ra27|ra28|ra29|ra30|ra31|ra32|ra33|ra34|ra25|ra36|ra37|ra38|ra39|ra40|ra41|ra42|ra43|ra44|ra45|ra46|ra47|ra48|ra49|ra50|ra51|ra52|ra53|ra54|ra55|ra56|ra57|ra58|ra59|ra60|ra61|ra62|ra63|rb1|rb2|rb3|rb4|rb5|rb6|rb7|rb8|rb9|rb10|rb11|rb12|rb13|rb14|rb15|rb16|rb17|rb18|rb19|rb20|rb21|rb22|rb23|rb24|rb25|rb26|rb27|rb28|rb29|rb30|rb31|rb32|rb33|rb34|rb25|rb36|rb37|rb38|rb39|rb40|rb41|rb42|rb43|rb44|rb45|rb46|rb47|rb48|rb49|rb50|rb51|rb52|rb53|rb54|rb55|rb56|rb57|rb58|rb59|rb60|rb61|rb62|rb63)\b</string> | |
</dict> | |
<key>labels</key> | |
<dict> | |
<key>comment</key> | |
<string>Labels</string> | |
<key>name</key> | |
<string>string.label</string> | |
<key>match</key> | |
<string>^\s*:(?:[A-Za-z_][A-Za-z_0-9]*|\d+)\b</string> | |
</dict> | |
<key>default-macros</key> | |
<dict> | |
<key>comment</key> | |
<string>Default macros</string> | |
<key>name</key> | |
<string>entity.name.function.preprocessor.asm.qasm,</string> | |
<key>match</key> | |
<string>\b(vdr_setup_0|vdr_setup_1|vdr_setup_modew|vdr_h32|vdr_v32|vdw_setup_0|vdw_setup_1|dma_h32|dma_h16p|dma_h8p|dma_v32|dma_v16p|dma_v8p|vpm_setup|h32|h16p|h16l|h8p|h8l|v32|v16p|v16l|v8p|v8l|min|max|ilog2|countBits|reverseBits4|reverseBits8|reverseBits16|reverseBits32|reverseBits64|reverseBits|mutex_lock|mutex_unlock|exit|sacq|srel|isConstant|isLdPE|isLdPES|isLdPEU|isRegister|isRegfileA|isRegfileB|isAccu|isReadable|isWritable|isRotate|isSemaphore|isLabel|isSmallImmd|M_E|M_LOG2E|M_LOG10E|M_LN2|M_LN10|M_PI|M_2PI|M_PI_2|M_PI_4|M_1_PI|M_2_PI|M_2_SQRTPI|M_SQRT2|M_SQRT1_2|M_NAN|M_INF)\b</string> | |
</dict> | |
<key>alu-separators</key> | |
<dict> | |
<key>comment</key> | |
<string>ALU Separators</string> | |
<key>name</key> | |
<string>keyword.other.asm.qasm.alu_separator</string> | |
<key>match</key> | |
<string>;</string> | |
</dict> | |
<key>mnemonics</key> | |
<dict> | |
<key>comment</key> | |
<string>Mnemonics</string> | |
<key>begin</key> | |
<string>(?:\b|^\s*)(add|min|sub|max|and|or|xor|shl|shr|asr|ror|not|clz|mul24|fadd|fsub|fmin|fmax|fminabs|fmaxabs|fmul|itof|ftoi|v8adds|v8subs|v8min|v8max|v8muld|mov|ldi|nop|anop|mnop|read|sacq|srel|bra|brr|bra|bkpt|thrsw|thrend|sbwait|sbdone|lthrsw|loadcv|loadc|ldcend|ldtmu0|ldtmu1|loadam)\b</string> | |
<key>end</key> | |
<string>(?=$|;|#|\n)</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>keyword.mnemonic</string> | |
</dict> | |
</dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#modifiers</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#pack-unpacks</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#func-invocs</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#operators</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#literals</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#addresses</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#registers</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#default-macros</string> | |
</dict> | |
</array> | |
</dict> | |
<key>includes</key> | |
<dict> | |
<key>comment</key> | |
<string>Includes</string> | |
<key>match</key> | |
<string>^\s*(\.include)\s+(["<][^">]*[">])[^#]*$?</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>constant.name</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>string.quoted</string> | |
</dict> | |
</dict> | |
</dict> | |
<key>macro-func-decs</key> | |
<dict> | |
<key>comment</key> | |
<string>Macro and function declarations</string> | |
<key>begin</key> | |
<string>^\s*(\.macro|\.func)\s+(\w+)</string> | |
<key>end</key> | |
<string>(?=$|\n|#)</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>constant.name</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>entity.name.function.asm.qasm.macro_declaration</string> | |
</dict> | |
</dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#operators</string> | |
</dict> | |
</array> | |
</dict> | |
<key>directives</key> | |
<dict> | |
<key>comment</key> | |
<string>Directives</string> | |
<key>begin</key> | |
<string>^\s*(\.)(const|set|lconst|lset|unset|lunset|local|endloc|endf|endm|rep|endr|foreach|endfor|back|endb|clone|if|elseif|else|endif|ifset|assert|byte|short|int|long|bit|float|half|double|align|global|code|rodata|text)\b</string> | |
<key>end</key> | |
<string>(?=$|\n|#)</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>constant.name</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>constant.name</string> | |
</dict> | |
</dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#func-invocs</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#operators</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#literals</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#registers</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#default-macros</string> | |
</dict> | |
</array> | |
</dict> | |
<key>macro-invocs</key> | |
<dict> | |
<key>comment</key> | |
<string>Macro invocations</string> | |
<key>begin</key> | |
<string>^\s*(\w+)</string> | |
<key>end</key> | |
<string>(?=#|$|\n)</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>entity.name.function.asm.qasm.macro_invocation</string> | |
</dict> | |
</dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#func-invocs</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#literals</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#registers</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#default-macros</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#addresses</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#pack-unpacks</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#operators</string> | |
</dict> | |
</array> | |
</dict> | |
<key>func-invocs</key> | |
<dict> | |
<key>comment</key> | |
<string>Function invocations</string> | |
<key>begin</key> | |
<string>\b(\w+)\s*(?=\()</string> | |
<key>end</key> | |
<string>(?=\)|$|\n)</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>entity.name.function.asm.qasm.macro_invocation</string> | |
</dict> | |
</dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#func-invocs</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#operators</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#literals</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#registers</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#default-macros</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#addresses</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#pack-unpacks</string> | |
</dict> | |
</array> | |
</dict> | |
</dict> | |
</dict> | |
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: QASM | |
scopeName: source.asm.qasm | |
comment: 'Broadcom QPU assembly language' | |
fileTypes: | |
- qasm | |
- qinc | |
uuid: E82E7ADE-56A9-11E8-A223-1C3947C23EE3 | |
patterns: | |
- include: '#comments' | |
- include: '#labels' | |
- include: '#mnemonics' | |
- include: '#includes' | |
- include: '#macro-func-decs' | |
- include: '#directives' | |
- include: '#alu-separators' | |
- include: '#macro-invocs' | |
repository: | |
comments: | |
comment: Comment | |
name: comment.line.number-sign | |
match: '#.*$' | |
literals: | |
patterns: | |
- comment: Decimal | |
name: constant.numeric.dec | |
match: '\b-?(?:[1-9][0-9]*|0)\b' | |
- comment: Hexadecimal | |
name: constant.numeric.hex | |
match: '\b-?0x[0-9a-fA-F]+\b' | |
- comment: Binary | |
name: constant.numeric.binary | |
match: '\b-?0b[01]+\b' | |
- comment: Octal | |
name: constant.numeric.octal | |
match: '\b-?0[0-7]+\b' | |
- comment: Float | |
name: constant.numeric.binary | |
match: '\b-?(?:[1-9][0-9]*|0)(?:\.[0-9]+)?(?:[eE][+\-]?[0-9]+)?\b' | |
modifiers: | |
comment: Modifiers | |
name: keyword.modifier | |
match: '\b\.(setf|sf|ifnz|nz|ifzc|zc|ifz|z|ifzs|zs|ifnn|nn|ifnc|nc|ifn|n|ifns|ns|ifcc|cc|ifc|c|ifcs|cs|allz|alln|allc|allnz|allnn|allnc|anyz|anyn|anyc|anynz|anynn|anync)\b' | |
operators: | |
patterns: | |
- comment: Single Operators | |
name: keyword.operator.single | |
match: '(?:\b|\s|\(|\)|,)(?:[\()+\-~!*/%><&\^|]|<<|>>|<<|>>|<<<|>>>|><<|>><|><<<|>>><|>=|<=|<=>|\*\*|!\^|&&|\^\^|!\^\^|\|\|){1}(?:\b|\s|\(|\))' | |
- comment: Keyword operators | |
name: keyword.operator.keywords | |
match: '\b(abs|ceil|floor|exp2|exp10|exp|log2|log10|log|cos|sin|tan|acos|asin|atan|cosh|sinh|tanh|acosh|asinh|atanh|erfc|erf)\b' | |
pack-unpacks: | |
comment: Pack-unpacks | |
name: storage.modifier | |
match: '\b\.(pack|unpack)?(32|32s|32si|16a|16ai|16af|16as|16asi|16b|16bi|16bf|16bs|16bsi|8888|8abcd|8888i|8abcdi|8888s|8abcds|8888si|8abcdsi|8888sf|8abcdsf|8a|8ai|8af|8as|8asi|8asf|8b|8bi|8bf|8bs|8bsi|8bsf|8c|8ci|8cf|8cs|8csi|8csf|8d|8di|8df|8ds|8dsi|8dsf|8dr)\b' | |
addresses: | |
comment: Relative addresses | |
match: '(r)?(:\w+)' | |
captures: | |
'1': { name: storage.modifier } | |
'2': { name: string.label } | |
registers: | |
comment: Registers | |
name: variable.other.asm.register | |
match: '\b(unif|vary|r0|r1|r2|r3|r4|r5|tmurs|r5quad|r5rep|elem_num|qpu_num|irq|interrupt|unif_addr|unif_addr_rel|x_coord|y_coord|ms_mask|rev_flag|stencil|tlbz|tlbm|tlbc|tlbam|vpm|vr_busy|vw_busy|vr_setup|vw_setup|vr_wait|vw_wait|vr_addr|vw_addr|mutex|mutex_acq|mutex_rel|recip|recipqstr|exp|t0s|t0t|t0r|t0b|t1s|t1t|t1r|t1b|ra1|ra2|ra3|ra4|ra5|ra6|ra7|ra8|ra9|ra10|ra11|ra12|ra13|ra14|ra15|ra16|ra17|ra18|ra19|ra20|ra21|ra22|ra23|ra24|ra25|ra26|ra27|ra28|ra29|ra30|ra31|ra32|ra33|ra34|ra25|ra36|ra37|ra38|ra39|ra40|ra41|ra42|ra43|ra44|ra45|ra46|ra47|ra48|ra49|ra50|ra51|ra52|ra53|ra54|ra55|ra56|ra57|ra58|ra59|ra60|ra61|ra62|ra63|rb1|rb2|rb3|rb4|rb5|rb6|rb7|rb8|rb9|rb10|rb11|rb12|rb13|rb14|rb15|rb16|rb17|rb18|rb19|rb20|rb21|rb22|rb23|rb24|rb25|rb26|rb27|rb28|rb29|rb30|rb31|rb32|rb33|rb34|rb25|rb36|rb37|rb38|rb39|rb40|rb41|rb42|rb43|rb44|rb45|rb46|rb47|rb48|rb49|rb50|rb51|rb52|rb53|rb54|rb55|rb56|rb57|rb58|rb59|rb60|rb61|rb62|rb63)\b' | |
labels: | |
comment: Labels | |
name: string.label | |
match: '^\s*:(?:[A-Za-z_][A-Za-z_0-9]*|\d+)\b' | |
default-macros: | |
comment: Default macros | |
name: entity.name.function.preprocessor.asm.qasm, | |
match: '\b(vdr_setup_0|vdr_setup_1|vdr_setup_modew|vdr_h32|vdr_v32|vdw_setup_0|vdw_setup_1|dma_h32|dma_h16p|dma_h8p|dma_v32|dma_v16p|dma_v8p|vpm_setup|h32|h16p|h16l|h8p|h8l|v32|v16p|v16l|v8p|v8l|min|max|ilog2|countBits|reverseBits4|reverseBits8|reverseBits16|reverseBits32|reverseBits64|reverseBits|mutex_lock|mutex_unlock|exit|sacq|srel|isConstant|isLdPE|isLdPES|isLdPEU|isRegister|isRegfileA|isRegfileB|isAccu|isReadable|isWritable|isRotate|isSemaphore|isLabel|isSmallImmd|M_E|M_LOG2E|M_LOG10E|M_LN2|M_LN10|M_PI|M_2PI|M_PI_2|M_PI_4|M_1_PI|M_2_PI|M_2_SQRTPI|M_SQRT2|M_SQRT1_2|M_NAN|M_INF)\b' | |
alu-separators: | |
comment: ALU Separators | |
name: keyword.other.asm.qasm.alu_separator | |
match: ';' | |
mnemonics: | |
comment: Mnemonics | |
begin: '(?:\b|^\s*)(add|min|sub|max|and|or|xor|shl|shr|asr|ror|not|clz|mul24|fadd|fsub|fmin|fmax|fminabs|fmaxabs|fmul|itof|ftoi|v8adds|v8subs|v8min|v8max|v8muld|mov|ldi|nop|anop|mnop|read|sacq|srel|bra|brr|bra|bkpt|thrsw|thrend|sbwait|sbdone|lthrsw|loadcv|loadc|ldcend|ldtmu0|ldtmu1|loadam)\b' | |
end: '(?=$|;|#|\n)' | |
beginCaptures: | |
'1': { name: keyword.mnemonic } | |
patterns: | |
- include: '#modifiers' | |
- include: '#pack-unpacks' | |
- include: '#func-invocs' | |
- include: '#operators' | |
- include: '#literals' | |
- include: '#addresses' | |
- include: '#registers' | |
- include: '#default-macros' | |
includes: | |
comment: Includes | |
match: '^\s*(\.include)\s+(["<][^">]*[">])[^#]*$?' | |
captures: | |
'1': { name: constant.name } | |
'2': { name: string.quoted } | |
macro-func-decs: | |
comment: Macro and function declarations | |
begin: '^\s*(\.macro|\.func)\s+(\w+)' | |
end: '(?=$|\n|#)' | |
beginCaptures: | |
'1': { name: constant.name } | |
'2': { name: entity.name.function.asm.qasm.macro_declaration } | |
patterns: | |
- include: '#operators' | |
directives: | |
comment: Directives | |
begin: '^\s*(\.)(const|set|lconst|lset|unset|lunset|local|endloc|endf|endm|rep|endr|foreach|endfor|back|endb|clone|if|elseif|else|endif|ifset|assert|byte|short|int|long|bit|float|half|double|align|global|code|rodata|text)\b' | |
end: '(?=$|\n|#)' | |
beginCaptures: | |
'1': { name: constant.name } | |
'2': { name: constant.name } | |
patterns: | |
- include: '#func-invocs' | |
- include: '#operators' | |
- include: '#literals' | |
- include: '#registers' | |
- include: '#default-macros' | |
macro-invocs: | |
comment: Macro invocations | |
begin: '^\s*(\w+)' | |
end: '(?=#|$|\n)' | |
beginCaptures: | |
'1': { name: entity.name.function.asm.qasm.macro_invocation } | |
patterns: | |
- include: '#func-invocs' | |
- include: '#literals' | |
- include: '#registers' | |
- include: '#default-macros' | |
- include: '#addresses' | |
- include: '#pack-unpacks' | |
- include: '#operators' | |
func-invocs: | |
comment: Function invocations | |
begin: '\b(\w+)\s*(?=\()' | |
end: '(?=\)|$|\n)' | |
beginCaptures: | |
'1': { name: entity.name.function.asm.qasm.macro_invocation } | |
patterns: | |
- include: '#func-invocs' | |
- include: '#operators' | |
- include: '#literals' | |
- include: '#registers' | |
- include: '#default-macros' | |
- include: '#addresses' | |
- include: '#pack-unpacks' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment