basant307/AI_Governance_Project
048
1/*2Language: Smali3Author: Dennis Titze <dennis.titze@gmail.com>4Description: Basic Smali highlighting5Website: https://github.com/JesusFreke/smali6Category: assembler7*/8 9function smali(hljs) {10 const smali_instr_low_prio = [11 'add',12 'and',13 'cmp',14 'cmpg',15 'cmpl',16 'const',17 'div',18 'double',19 'float',20 'goto',21 'if',22 'int',23 'long',24 'move',25 'mul',26 'neg',27 'new',28 'nop',29 'not',30 'or',31 'rem',32 'return',33 'shl',34 'shr',35 'sput',36 'sub',37 'throw',38 'ushr',39 'xor'40 ];41 const smali_instr_high_prio = [42 'aget',43 'aput',44 'array',45 'check',46 'execute',47 'fill',48 'filled',49 'goto/16',50 'goto/32',51 'iget',52 'instance',53 'invoke',54 'iput',55 'monitor',56 'packed',57 'sget',58 'sparse'59 ];60 const smali_keywords = [61 'transient',62 'constructor',63 'abstract',64 'final',65 'synthetic',66 'public',67 'private',68 'protected',69 'static',70 'bridge',71 'system'72 ];73 return {74 name: 'Smali',75 contains: [76 {77 className: 'string',78 begin: '"',79 end: '"',80 relevance: 081 },82 hljs.COMMENT(83 '#',84 '$',85 { relevance: 0 }86 ),87 {88 className: 'keyword',89 variants: [90 { begin: '\\s*\\.end\\s[a-zA-Z0-9]*' },91 {92 begin: '^[ ]*\\.[a-zA-Z]*',93 relevance: 094 },95 {96 begin: '\\s:[a-zA-Z_0-9]*',97 relevance: 098 },99 { begin: '\\s(' + smali_keywords.join('|') + ')' }100 ]101 },102 {103 className: 'built_in',104 variants: [105 { begin: '\\s(' + smali_instr_low_prio.join('|') + ')\\s' },106 {107 begin: '\\s(' + smali_instr_low_prio.join('|') + ')((-|/)[a-zA-Z0-9]+)+\\s',108 relevance: 10109 },110 {111 begin: '\\s(' + smali_instr_high_prio.join('|') + ')((-|/)[a-zA-Z0-9]+)*\\s',112 relevance: 10113 }114 ]115 },116 {117 className: 'class',118 begin: 'L[^\(;:\n]*;',119 relevance: 0120 },121 { begin: '[vp][0-9]+' }122 ]123 };124}125 126export { smali as default };127 