# -*- coding: utf-8 -*- ## frozen_string_literal: truemoduleRougemoduleLexersclassArmAsm<RegexLexertitle"ArmAsm"desc"Arm assembly syntax"tag'armasm'filenames'*.s'defself.preproc_keyword@preproc_keyword||=%w(
define elif else endif error if ifdef ifndef include line pragma undef warning
)enddefself.file_directive@file_directive||=%w(
BIN GET INCBIN INCLUDE LNK
)enddefself.general_directive@general_directive||=%w(
ALIAS ALIGN AOF AOUT AREA ARM ASSERT ATTR CN CODE16 CODE32 COMMON CP
DATA DCB DCD DCDO DCDU DCFD DCFDU DCFH DCFHU DCFS DCFSU DCI DCI.N DCI.W
DCQ DCQU DCW DCWU DN ELIF ELSE END ENDFUNC ENDIF ENDP ENTRY EQU EXPORT
EXPORTAS EXTERN FIELD FILL FN FRAME FUNCTION GBLA GBLL GBLS GLOBAL IF
IMPORT INFO KEEP LCLA LCLL LCLS LEADR LEAF LTORG MACRO MAP MEND MEXIT
NOFP OPT ORG PRESERVE8 PROC QN RELOC REQUIRE REQUIRE8 RLIST RN ROUT
SETA SETL SETS SN SPACE STRONG SUBT THUMB THUMBX TTL WEND WHILE
\[ \] [|!#*=%&^]
)enddefself.shift_or_condition@shift_or_condition||=%w(
ASR LSL LSR ROR RRX AL CC CS EQ GE GT HI HS LE LO LS LT MI NE PL VC VS
asr lsl lsr ror rrx al cc cs eq ge gt hi hs le lo ls lt mi ne pl vc vs
)enddefself.builtin@builtin||=%w(
ARCHITECTURE AREANAME ARMASM_VERSION CODESIZE COMMANDLINE CONFIG CPU
ENDIAN FALSE FPIC FPU INPUTFILE INTER LINENUM LINENUMUP LINENUMUPPER
OBJASM_VERSION OPT PC PCSTOREOFFSET REENTRANT ROPI RWPI TRUE VAR
)enddefself.operator@operator||=%w(
AND BASE CC CC_ENCODING CHR DEF EOR FATTR FEXEC FLOAD FSIZE INDEX LAND
LEFT LEN LEOR LNOT LOR LOWERCASE MOD NOT OR RCONST REVERSE_CC RIGHT ROL
ROR SHL SHR STR TARGET_ARCH_[0-9A-Z_]+ TARGET_FEATURE_[0-9A-Z_]+
TARGET_FPU_[A-Z_] TARGET_PROFILE_[ARM] UAL UPPERCASE
)endstate:rootdorule%r/\n/,Textrule%r/^([ \t]*)(#[ \t]*(?:(?:#{ArmAsm.preproc_keyword.join('|')})(?:[ \t].*)?)?)(\n)/dogroupsText,Comment::Preproc,Textendrule%r/[ \t]+/,Text,:commandrule%r/;.*/,Commentrule%r/\$[a-z_]\w*\.?/i,Name::Namespace# variable substitution or macro argumentrule%r/\w+|\|[^|\n]+\|/,Name::Labelendstate:commanddorule%r/\n/,Text,:pop!rule%r/[ \t]+/do|m|tokenTextgoto:argsendrule%r/;.*/,Comment,:pop!rule%r/(?:#{ArmAsm.file_directive.join('|')})\b/do|m|tokenKeywordgoto:filespecendrule%r/(?:#{ArmAsm.general_directive.join('|')})(?=[; \t\n])/,Keywordrule%r/(?:[A-Z][\dA-Z]*|[a-z][\da-z]*)(?:\.[NWnw])?(?:\.[DFIPSUdfipsu]?(?:8|16|32|64)?){,3}\b/,Name::Builtin# rather than attempt to list all opcodes, rely on all-uppercase or all-lowercase rulerule%r/[a-z_]\w*|\|[^|\n]+\|/i,Name::Function# probably a macro namerule%r/\$[a-z]\w*\.?/i,Name::Namespaceendstate:argsdorule%r/\n/,Text,:pop!rule%r/[ \t]+/,Textrule%r/;.*/,Comment,:pop!rule%r/(?:#{ArmAsm.shift_or_condition.join('|')})\b/,Name::Builtinrule%r/[a-z_]\w*|\|[^|\n]+\|/i,Name::Variable# various types of symbolrule%r/%[bf]?[at]?\d+(?:[a-z_]\w*)?/i,Name::Labelrule%r/(?:&|0x)\h+(?!p)/i,Literal::Number::Hexrule%r/(?:&|0x)[.\h]+(?:p[-+]?\d+)?/i,Literal::Number::Floatrule%r/0f_\h{8}|0d_\h{16}/i,Literal::Number::Floatrule%r/(?:2_[01]+|3_[0-2]+|4_[0-3]+|5_[0-4]+|6_[0-5]+|7_[0-6]+|8_[0-7]+|9_[0-8]+|\d+)(?!e)/i,Literal::Number::Integerrule%r/(?:2_[.01]+|3_[.0-2]+|4_[.0-3]+|5_[.0-4]+|6_[.0-5]+|7_[.0-6]+|8_[.0-7]+|9_[.0-8]+|[.\d]+)(?:e[-+]?\d+)?/i,Literal::Number::Floatrule%r/[@:](?=[ \t]*(?:8|16|32|64|128|256)[^\d])/,Operatorrule%r/[.@]|\{(?:#{ArmAsm.builtin.join('|')})\}/,Name::Constantrule%r/[-!#%&()*+,\/<=>?^{|}]|\[|\]|!=|&&|\/=|<<|<=|<>|==|><|>=|>>|\|\||:(?:#{ArmAsm.operator.join('|')}):/,Operatorrule%r/\$[a-z]\w*\.?/i,Name::Namespacerule%r/'/do|m|tokenLiteral::String::Chargoto:singlequotedendrule%r/"/do|m|tokenLiteral::String::Doublegoto:doublequotedendendstate:singlequoteddorule%r/\n/,Text,:pop!rule%r/\$\$/,Literal::String::Charrule%r/\$[a-z]\w*\.?/i,Name::Namespacerule%r/'/do|m|tokenLiteral::String::Chargoto:argsendrule%r/[^$'\n]+/,Literal::String::Charendstate:doublequoteddorule%r/\n/,Text,:pop!rule%r/\$\$/,Literal::String::Doublerule%r/\$[a-z]\w*\.?/i,Name::Namespacerule%r/"/do|m|tokenLiteral::String::Doublegoto:argsendrule%r/[^$"\n]+/,Literal::String::Doubleendstate:filespecdorule%r/\n/,Text,:pop!rule%r/\$\$/,Literal::String::Otherrule%r/\$[a-z]\w*\.?/i,Name::Namespacerule%r/[^$\n]+/,Literal::String::Otherendendendend