capacitor-dex-editor 0.0.38 → 0.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/android/src/main/AndroidManifest.xml +8 -0
  2. package/android/src/main/assets/availableSyntax.json +54 -0
  3. package/android/src/main/assets/c.json +42 -0
  4. package/android/src/main/assets/colors.json +21 -0
  5. package/android/src/main/assets/cpp.json +79 -0
  6. package/android/src/main/assets/dart.json +108 -0
  7. package/android/src/main/assets/java.json +46 -0
  8. package/android/src/main/assets/js.json +54 -0
  9. package/android/src/main/assets/json.json +33 -0
  10. package/android/src/main/assets/kotlin.json +53 -0
  11. package/android/src/main/assets/lua.json +54 -0
  12. package/android/src/main/assets/php.json +69 -0
  13. package/android/src/main/assets/python.json +87 -0
  14. package/android/src/main/assets/rust.json +139 -0
  15. package/android/src/main/assets/smali.json +131 -0
  16. package/android/src/main/assets/xml.json +96 -0
  17. package/android/src/main/java/com/aetherlink/dexeditor/DexEditorPluginPlugin.java +48 -0
  18. package/android/src/main/java/com/aetherlink/dexeditor/SmaliEditorActivity.java +205 -0
  19. package/android/src/main/java/com/aetherlink/dexeditor/editor/EditView.java +4022 -0
  20. package/android/src/main/java/com/aetherlink/dexeditor/editor/WordWrapLayout.java +275 -0
  21. package/android/src/main/java/com/aetherlink/dexeditor/editor/buffer/BufferCache.java +113 -0
  22. package/android/src/main/java/com/aetherlink/dexeditor/editor/buffer/GapBuffer.java +685 -0
  23. package/android/src/main/java/com/aetherlink/dexeditor/editor/component/ClipboardPanel.java +1380 -0
  24. package/android/src/main/java/com/aetherlink/dexeditor/editor/component/Magnifier.java +363 -0
  25. package/android/src/main/java/com/aetherlink/dexeditor/editor/highlight/Candidate.java +52 -0
  26. package/android/src/main/java/com/aetherlink/dexeditor/editor/highlight/CommentDef.java +47 -0
  27. package/android/src/main/java/com/aetherlink/dexeditor/editor/highlight/LineResult.java +49 -0
  28. package/android/src/main/java/com/aetherlink/dexeditor/editor/highlight/MHSyntaxHighlightEngine.java +841 -0
  29. package/android/src/main/java/com/aetherlink/dexeditor/editor/highlight/Rule.java +53 -0
  30. package/android/src/main/java/com/aetherlink/dexeditor/editor/highlight/Token.java +48 -0
  31. package/android/src/main/java/com/aetherlink/dexeditor/editor/listener/OnTextChangedListener.java +6 -0
  32. package/android/src/main/java/com/aetherlink/dexeditor/editor/treeObserver/OnComputeInternalInsetsListener.java +92 -0
  33. package/android/src/main/java/com/aetherlink/dexeditor/editor/treeObserver/ViewTreeObserverReflection.java +87 -0
  34. package/android/src/main/java/com/aetherlink/dexeditor/editor/utils/LinkChecker.java +28 -0
  35. package/android/src/main/java/com/aetherlink/dexeditor/editor/utils/Pair.java +80 -0
  36. package/android/src/main/java/com/aetherlink/dexeditor/editor/utils/ScreenUtils.java +63 -0
  37. package/android/src/main/java/com/aetherlink/dexeditor/editor/utils/menuUtils/MenuAction.java +49 -0
  38. package/android/src/main/java/com/aetherlink/dexeditor/editor/utils/menuUtils/MenuItemConfig.java +49 -0
  39. package/android/src/main/java/com/aetherlink/dexeditor/editor/utils/menuUtils/MenuItemData.java +49 -0
  40. package/android/src/main/java/com/aetherlink/dexeditor/editor/utils/menuUtils/ViewFader.java +76 -0
  41. package/android/src/main/res/drawable/abc_text_cursor_material.xml +9 -0
  42. package/android/src/main/res/drawable/abc_text_select_handle_left_mtrl.png +0 -0
  43. package/android/src/main/res/drawable/abc_text_select_handle_middle_mtrl.png +0 -0
  44. package/android/src/main/res/drawable/abc_text_select_handle_right_mtrl.png +0 -0
  45. package/android/src/main/res/drawable/ic_arrow_back.xml +12 -0
  46. package/android/src/main/res/drawable/ic_copy.xml +11 -0
  47. package/android/src/main/res/drawable/ic_cut.xml +10 -0
  48. package/android/src/main/res/drawable/ic_delete.xml +12 -0
  49. package/android/src/main/res/drawable/ic_edit_white_24dp.xml +10 -0
  50. package/android/src/main/res/drawable/ic_goto.xml +10 -0
  51. package/android/src/main/res/drawable/ic_launcher_background.xml +186 -0
  52. package/android/src/main/res/drawable/ic_look_white_24dp.xml +11 -0
  53. package/android/src/main/res/drawable/ic_more.xml +10 -0
  54. package/android/src/main/res/drawable/ic_open_link.xml +11 -0
  55. package/android/src/main/res/drawable/ic_paste.xml +11 -0
  56. package/android/src/main/res/drawable/ic_redo_white_24dp.xml +10 -0
  57. package/android/src/main/res/drawable/ic_select.xml +11 -0
  58. package/android/src/main/res/drawable/ic_select_all.xml +10 -0
  59. package/android/src/main/res/drawable/ic_share.xml +11 -0
  60. package/android/src/main/res/drawable/ic_toggle_comment.xml +12 -0
  61. package/android/src/main/res/drawable/ic_translate.xml +10 -0
  62. package/android/src/main/res/drawable/ic_undo_white_24dp.xml +11 -0
  63. package/android/src/main/res/drawable/magnifier_bg.xml +5 -0
  64. package/android/src/main/res/drawable/popup_background.xml +8 -0
  65. package/android/src/main/res/drawable/ripple_effect.xml +9 -0
  66. package/android/src/main/res/drawable/selection_menu_background.xml +5 -0
  67. package/android/src/main/res/layout/custom_selection_menu.xml +44 -0
  68. package/android/src/main/res/layout/expand_button.xml +23 -0
  69. package/android/src/main/res/layout/item_autocomplete.xml +25 -0
  70. package/android/src/main/res/layout/magnifier_popup.xml +17 -0
  71. package/android/src/main/res/layout/menu_item.xml +30 -0
  72. package/android/src/main/res/layout/text_selection_menu.xml +36 -0
  73. package/package.json +1 -1
@@ -1,2 +1,10 @@
1
1
  <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+ <application>
3
+ <activity
4
+ android:name=".SmaliEditorActivity"
5
+ android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
6
+ android:configChanges="orientation|screenSize|keyboardHidden"
7
+ android:windowSoftInputMode="adjustResize"
8
+ android:exported="false" />
9
+ </application>
2
10
  </manifest>
@@ -0,0 +1,54 @@
1
+ [
2
+ {
3
+ "Syntax": "C",
4
+ "Path": "c.json"
5
+ },
6
+ {
7
+ "Syntax": "C++",
8
+ "Path": "cpp.json"
9
+ },
10
+ {
11
+ "Syntax": "Dart",
12
+ "Path": "dart.json"
13
+ },
14
+ {
15
+ "Syntax": "Json",
16
+ "Path": "json.json"
17
+ },
18
+ {
19
+ "Syntax": "Java",
20
+ "Path": "java.json"
21
+ },
22
+ {
23
+ "Syntax": "JavaScript",
24
+ "Path": "js.json"
25
+ },
26
+ {
27
+ "Syntax": "Kotlin",
28
+ "Path": "kotlin.json"
29
+ },
30
+ {
31
+ "Syntax": "Lua",
32
+ "Path": "lua.json"
33
+ },
34
+ {
35
+ "Syntax": "Php",
36
+ "Path": "php.json"
37
+ },
38
+ {
39
+ "Syntax": "Python",
40
+ "Path": "python.json"
41
+ },
42
+ {
43
+ "Syntax": "Rust",
44
+ "Path": "rust.json"
45
+ },
46
+ {
47
+ "Syntax": "Smali",
48
+ "Path": "smali.json"
49
+ },
50
+ {
51
+ "Syntax": "Xml",
52
+ "Path": "xml.json"
53
+ }
54
+ ]
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": ["C", ".c", ".h"],
3
+ "comment": [
4
+ { "startsWith": "//" },
5
+ { "startsWith": "/*", "endsWith": "*/" }
6
+ ],
7
+
8
+ "rules": [
9
+ // Single-line and multi-line comments
10
+ { "type": "comment", "regex": "//.*" },
11
+ { "type": "comment", "regex": "/\\*[\\s\\S]*?\\*/" },
12
+
13
+ // Quoted strings
14
+ { "type": "string", "regex": "\"(?:\\\\.|[^\"])*\"" },
15
+ { "type": "string", "regex": "'(?:\\\\.|[^'])'" },
16
+
17
+ // Numbers
18
+ { "type": "number", "regex": "\\b\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?[fFdDlL]?\\b" },
19
+
20
+ // Preprocessor directives
21
+ {
22
+ "regex": "(?m)^[ \\t]*(#[ \\t]*include)(\\s*<.*?>)",
23
+ "groupStyles": { "1": "meta", "2": "string" }
24
+ },
25
+ {
26
+ "type": "meta",
27
+ "regex": "(?m)^[ \\t]*#[ \\t]*\\S+"
28
+ },
29
+
30
+ // Keywords
31
+ {
32
+ "type": "keyword",
33
+ "regex": "\\b(?:auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while|inline|restrict|_Bool|_Complex|_Imaginary|_Alignas|_Alignof|_Atomic|_Static_assert|_Noreturn|_Thread_local|_Generic)\\b"
34
+ },
35
+
36
+ // Operators
37
+ { "type": "operator", "regex": "[+\\-*/%=&|!<>^~?:]+|\\.|,|;|\\(|\\)|\\{|\\}|\\[|\\]" },
38
+
39
+ // Default fallback
40
+ { "type": "default", "regex": "." }
41
+ ]
42
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "default": { "day": "#000000", "night": "#A9B7C6" },
3
+ "string": { "day": "#067D17", "night": "#6A8759" },
4
+ "strEscape": { "day": "#0037A6", "night": "#CC7832" },
5
+ "comment": { "day": "#8C8C8C", "night": "#808080" },
6
+ "meta": { "day": "#9E880D", "night": "#BBB529" },
7
+ "number": { "day": "#1750EB", "night": "#6897BB" },
8
+ "keyword": { "day": "#0033B3", "night": "#CC7832" },
9
+ "keyword2": { "day": "#800000", "night": "#AE8ABE" },
10
+ "constant": { "day": "#871094", "night": "#9876AA" },
11
+ "type": { "day": "#808000", "night": "#808000" },
12
+ "label": { "day": "#7050E0", "night": "#6080B0" },
13
+ "variable": { "day": "#1750EB", "night": "#58908A" },
14
+ "operator": { "day": "#205060", "night": "#508090" },
15
+ "propKey": { "day": "#083080", "night": "#CC7832" },
16
+ "propVal": { "day": "#067D17", "night": "#6A8759" },
17
+ "tagName": { "day": "#0030B3", "night": "#E8BF6A" },
18
+ "attrName": { "day": "#174AD4", "night": "#BABABA" },
19
+ "namespace": { "day": "#871094", "night": "#9876AA" },
20
+ "error": { "day": "#F50000", "night": "#BC3F3C" }
21
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": ["C++", ".cpp", ".cxx", ".hpp", ".hxx", ".cc"],
3
+ "comment": [
4
+ { "startsWith": "//" },
5
+ { "startsWith": "/*", "endsWith": "*/" }
6
+ ],
7
+
8
+ "rules": [
9
+ // Single-line and multi-line comments
10
+ { "type": "comment", "regex": "//.*" },
11
+ { "type": "comment", "regex": "/\\*[\\s\\S]*?\\*/" },
12
+
13
+ // Quoted strings
14
+ { "type": "string", "regex": "\"(?:\\\\.|[^\"])*\"" },
15
+ { "type": "string", "regex": "'(?:\\\\.|[^'])'" },
16
+
17
+ // Numbers
18
+ { "type": "number", "regex": "\\b\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?[fFdDlL]?\\b" },
19
+
20
+ // Preprocessor directives (using meta type)
21
+ {
22
+ "regex": "(?m)^[ \\t]*(#[ \\t]*include)(\\s*<.*?>)",
23
+ "groupStyles": { "1": "meta", "2": "string" }
24
+ },
25
+ {
26
+ "type": "meta",
27
+ "regex": "(?m)^[ \\t]*#[ \\t]*\\S+"
28
+ },
29
+
30
+ // Standard C++ Keywords
31
+ {
32
+ "type": "keyword",
33
+ "keywords": [
34
+ "alignas", "alignof", "and", "and_eq", "asm", "auto", "bitand", "bitor", "bool", "break",
35
+ "case", "catch", "char", "char8_t", "char16_t", "char32_t", "class", "compl", "concept",
36
+ "const", "const_cast", "consteval", "constexpr", "sizeof", "continue", "co_await",
37
+ "co_return", "co_yield", "decltype", "default", "delete", "do", "double", "dynamic_cast",
38
+ "else", "enum", "explicit", "export", "extern", "false", "float", "for", "friend", "goto",
39
+ "if", "inline", "int", "long", "xor", "mutable", "namespace", "new", "noexcept", "not",
40
+ "not_eq", "nullptr", "operator", "or", "or_eq", "private", "xor_eq", "protected", "public",
41
+ "register", "reinterpret_cast", "requires", "return", "short", "signed", "constinit",
42
+ "static", "static_assert", "static_cast", "struct", "switch", "template", "this",
43
+ "thread_local", "throw", "true", "try", "typedef", "typeid", "typename", "union",
44
+ "unsigned", "using", "virtual", "void", "volatile", "wchar_t", "while"
45
+ ]
46
+ },
47
+
48
+ // Microsoft C++ Keywords
49
+ {
50
+ "type": "keyword",
51
+ "keywords": [
52
+ "__alignof", "__asm", "__assume", "__based", "__cdecl", "__declspec", "__event", "__except",
53
+ "__fastcall", "__finally", "__forceinline", "__hook", "__if_exists", "__if_not_exists",
54
+ "__inline", "__int16", "__int32", "__int64", "__int8", "__interface", "__leave", "__m128",
55
+ "__m128d", "__m128i", "__m64", "__w64", "__wchar_t", "__ptr32", "__ptr64", "__raise",
56
+ "__restrict", "__single_inheritance", "__sptr", "__stdcall", "__super", "__thiscall",
57
+ "__unaligned", "__unhook", "__uptr", "__uuidof", "__vectorcall", "__virtual_inheritance",
58
+ "__multiple_inheritance"
59
+ ]
60
+ },
61
+
62
+ // C++/CLI, C++/CX Keywords
63
+ {
64
+ "type": "keyword",
65
+ "keywords": [
66
+ "__abstract", "__box", "__delegate", "__gc", "__identifier", "__nogc", "__noop", "__pin",
67
+ "__property", "__sealed", "__try_cast", "__value", "abstract", "array", "as_friend",
68
+ "delegate", "event", "finally", "gcnew", "generic", "initonly", "interior_ptr", "literal",
69
+ "property", "safecast", "sealed"
70
+ ]
71
+ },
72
+
73
+ // Operators
74
+ { "type": "operator", "regex": "[+\\-*/%=&|!<>^~?:]+|\\.|,|;|\\(|\\)|\\{|\\}|\\[|\\]" },
75
+
76
+ // Default fallback
77
+ { "type": "default", "regex": "." }
78
+ ]
79
+ }
@@ -0,0 +1,108 @@
1
+ {
2
+ "name": ["Dart", ".dart"],
3
+ "comment": [
4
+ { "startsWith": "//" },
5
+ { "startsWith": "/*", "endsWith": "*/" }
6
+ ],
7
+
8
+ "rules": [
9
+ // Single-line comments
10
+ { "type": "comment", "regex": "//.*" },
11
+
12
+ // Multi-line comments
13
+ { "type": "comment", "regex": "/\\*[\\s\\S]*?\\*/" },
14
+
15
+ // Triple double quoted strings with interpolation
16
+ {
17
+ "regex": "\"\"\"[\\s\\S]*?\"\"\"",
18
+ "groupStyles": { "0": "string" }
19
+ },
20
+
21
+ // Triple single quoted strings with interpolation
22
+ {
23
+ "regex": "'''[\\s\\S]*?'''",
24
+ "groupStyles": { "0": "string" }
25
+ },
26
+
27
+ // Double quoted strings with interpolation
28
+ {
29
+ "regex": "\"(?:\\\\.|[^\"])*\"",
30
+ "groupStyles": { "0": "string" }
31
+ },
32
+
33
+ // Single quoted strings with interpolation
34
+ {
35
+ "regex": "'(?:\\\\.|[^'])*'",
36
+ "groupStyles": { "0": "string" }
37
+ },
38
+
39
+ // String interpolation ${...}
40
+ { "type": "variable", "regex": "\\$\\{[^}]*\\}" },
41
+
42
+ // Simple string interpolation $identifier
43
+ { "type": "variable", "regex": "\\$[a-zA-Z_$][\\w$]*" },
44
+
45
+ // Raw triple double quoted strings
46
+ { "type": "string", "regex": "r\"\"\"[\\s\\S]*?\"\"\"" },
47
+
48
+ // Raw triple single quoted strings
49
+ { "type": "string", "regex": "r'''[\\s\\S]*?'''" },
50
+
51
+ // Raw double quoted strings
52
+ { "type": "string", "regex": "r\"(?:[^\"])*\"" },
53
+
54
+ // Raw single quoted strings
55
+ { "type": "string", "regex": "r'(?:[^'])*'" },
56
+
57
+ // String escape sequences
58
+ { "type": "strEscape", "regex": "\\\\u[0-9a-fA-F]{4}|\\\\x[0-9a-fA-F]{2}|\\\\[0-7]{1,3}|\\\\." },
59
+
60
+ // Numbers
61
+ { "type": "number", "regex": "\\b\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?[fFdD]?\\b" },
62
+ { "type": "number", "regex": "\\b0[xX][0-9a-fA-F_]+\\b" },
63
+ { "type": "number", "regex": "\\b0[bB][01_]+\\b" },
64
+ { "type": "number", "regex": "\\b0[oO][0-7_]+\\b" },
65
+
66
+ // Annotations
67
+ { "type": "meta", "regex": "@[a-zA-Z_$][\\w$]*(?:\\.[a-zA-Z_$][\\w$]*)*" },
68
+
69
+ // Constants (UPPER_CASE)
70
+ { "type": "constant", "regex": "\\b[A-Z][A-Z0-9_]+\\b" },
71
+
72
+ // Keywords
73
+ {
74
+ "type": "keyword",
75
+ "regex": "\\b(?:abstract|as|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|external|factory|false|final|finally|for|Function|get|if|implements|import|in|interface|is|library|mixin|new|null|on|operator|part|rethrow|return|set|static|super|switch|sync|this|throw|true|try|typedef|var|void|while|with|yield|late|required)\\b"
76
+ },
77
+
78
+ // Built-in types
79
+ {
80
+ "type": "type",
81
+ "regex": "\\b(?:bool|double|int|List|Map|Never|Null|Object|String|Symbol|void|Future|Stream|Iterable|Set|DateTime|Duration|RegExp|Uri|Runes|Comparable|Matcher|Pattern|Stopwatch)\\b"
82
+ },
83
+
84
+ // Function names (lowerCamelCase followed by parentheses)
85
+ { "type": "funName", "regex": "\\b[a-z][a-zA-Z_$\\d]*(?=\\s*\\()" },
86
+
87
+ // Class names (UpperCamelCase)
88
+ { "type": "className", "regex": "\\b[A-Z][a-zA-Z_$\\d]*\\b" },
89
+
90
+ // Cascade operator
91
+ { "type": "operator", "regex": "\\.\\." },
92
+
93
+ // Arrow function
94
+ { "type": "operator", "regex": "=>" },
95
+
96
+ // Operators
97
+ { "type": "operator", "regex": "[+\\-*/%<>=!&|^~?:]+|\\.\\.<|\\?\\?" },
98
+
99
+ // Brackets
100
+ { "type": "bracket", "regex": "[(){}\\[\\]]" },
101
+
102
+ // Separators
103
+ { "type": "separator", "regex": "[,;]" },
104
+
105
+ // Default fallback
106
+ { "type": "default", "regex": "." }
107
+ ]
108
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": ["Java", ".java", ".jsp"],
3
+ "comment": [
4
+ { "startsWith": "//" },
5
+ { "startsWith": "/*", "endsWith": "*/" }
6
+ ],
7
+
8
+ "rules": [
9
+ // Single-line and multi-line comments
10
+ { "type": "comment", "regex": "//.*" },
11
+ { "type": "comment", "regex": "/\\*[\\s\\S]*?\\*/" },
12
+
13
+ // Triple-quoted strings
14
+ {
15
+ "regex": "\"\"\"[\\s\\S]*?\"\"\"",
16
+ "groupStyles": { "0": "string" }
17
+ },
18
+
19
+ // Quoted strings
20
+ { "type": "string", "regex": "\"(?:\\\\.|[^\"])*\"" },
21
+ { "type": "string", "regex": "'(?:\\\\.|[^'])'" },
22
+
23
+ // Numbers
24
+ { "type": "number", "regex": "\\b\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?[fFdDlL]?\\b" },
25
+
26
+ // Annotations
27
+ { "type": "meta", "regex": "@\\w+(?:\\.\\w+)*" },
28
+
29
+ // Constants (all caps)
30
+ { "type": "constant", "regex": "\\b(?!(?:CRC32|URL)\\b)[A-Z][A-Z0-9]+\\b(?!\\.)(?!\\s{0,10}\\()" },
31
+ { "type": "constant", "regex": "\\b[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)+\\b(?!\\.)(?!\\s{0,10}\\()" },
32
+
33
+ // Keywords
34
+ {
35
+ "type": "keyword",
36
+ "regex": "\\b(?:while|volatile|void|try|true|transient|throws|throw|this|synchronized|switch|super|strictfp|static|short|return|public|protected|private|package|null|new|native|long|interface|int|instanceof|import|implements|if|goto|for|float|finally|final|false|extends|enum|else|double|do|default|continue|const|class|char|catch|case|byte|break|boolean|assert|abstract|var|record|yield|sealed|non-sealed|permits|when)\\b"
37
+ },
38
+
39
+ // Operators
40
+ { "type": "operator", "regex": "[+\\-*/%=&|!<>^~?:]+|\\.|,|;|\\(|\\)|\\{|\\}" },
41
+
42
+ // Default fallback
43
+ { "type": "default", "regex": "." }
44
+ ]
45
+ }
46
+
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": ["JavaScript", ".js", ".es"],
3
+ "comment": [
4
+ { "startsWith": "//" },
5
+ { "startsWith": "/*", "endsWith": "*/" }
6
+ ],
7
+
8
+ "rules": [
9
+ // Single-line comments
10
+ { "type": "comment", "regex": "//.*" },
11
+
12
+ // Multi-line comments
13
+ { "type": "comment", "regex": "/\\*[\\s\\S]*?\\*/" },
14
+
15
+ // Single quoted strings
16
+ { "type": "string", "regex": "'(?:\\\\.|[^'])*'" },
17
+
18
+ // Double quoted strings
19
+ { "type": "string", "regex": "\"(?:\\\\.|[^\"])*\"" },
20
+
21
+ // Template literals (backticks)
22
+ { "type": "string", "regex": "`(?:\\\\.|[^`])*`" },
23
+
24
+ // String escape sequences
25
+ { "type": "strEscape", "regex": "\\\\u[0-9a-fA-F]{4}|\\\\x[0-9a-fA-F]{2}|\\\\[0-7]{1,3}|\\\\." },
26
+
27
+ // Template literal expressions ${...}
28
+ { "type": "strEscape", "regex": "\\$\\{[^}]*\\}" },
29
+
30
+ // Regular expressions - simplified pattern
31
+ { "type": "meta", "regex": "/(?:\\\\.|[^/\\n])*/[gimuy]*" },
32
+
33
+ // Numbers
34
+ { "type": "number", "regex": "\\b\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\b" },
35
+ { "type": "number", "regex": "\\b0[xX][0-9a-fA-F]+\\b" },
36
+ { "type": "number", "regex": "\\b0[oO][0-7]+\\b" },
37
+ { "type": "number", "regex": "\\b0[bB][01]+\\b" },
38
+
39
+ // Keywords - simplified without lookbehind
40
+ {
41
+ "type": "keyword",
42
+ "regex": "\\b(break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|if|implements|import|instanceof|interface|let|new|null|package|private|protected|public|return|static|super|switch|this|with|throw|true|try|typeof|var|void|while|yield|function)\\b"
43
+ },
44
+
45
+ // Operators
46
+ { "type": "operator", "regex": "[+\\-*/%=&|!<>^~?:]+" },
47
+
48
+ // Punctuation
49
+ { "type": "operator", "regex": "[.,;(){}[\\]]" },
50
+
51
+ // Default fallback
52
+ { "type": "default", "regex": "." }
53
+ ]
54
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": ["JSON", ".json"],
3
+ "comment": [
4
+ { "startsWith": "//" },
5
+ { "startsWith": "/*", "endsWith": "*/" }
6
+ ],
7
+
8
+ "rules": [
9
+ // Single-line comments
10
+ { "type": "comment", "regex": "//.*" },
11
+
12
+ // Multi-line comments
13
+ { "type": "comment", "regex": "/\\*[\\s\\S]*?\\*/" },
14
+
15
+ // Double quoted strings
16
+ { "type": "string", "regex": "\"(?:\\\\.|[^\"])*\"" },
17
+
18
+ // Numbers
19
+ { "type": "number", "regex": "-?\\b\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\b" },
20
+
21
+ // JSON literals
22
+ {
23
+ "type": "keyword",
24
+ "regex": "\\b(?:true|false|null)\\b"
25
+ },
26
+
27
+ // Punctuation
28
+ { "type": "operator", "regex": "[{},:\\[\\]]" },
29
+
30
+ // Default fallback
31
+ { "type": "default", "regex": "." }
32
+ ]
33
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": ["Kotlin", ".kt"],
3
+ "comment": [
4
+ { "startsWith": "//" },
5
+ { "startsWith": "/*", "endsWith": "*/" }
6
+ ],
7
+
8
+ "rules": [
9
+ // Single-line comments
10
+ { "type": "comment", "regex": "//.*" },
11
+
12
+ // Multi-line comments
13
+ { "type": "comment", "regex": "/\\*[\\s\\S]*?\\*/" },
14
+
15
+ // Triple quoted strings
16
+ {
17
+ "regex": "\"\"\"[\\s\\S]*?\"\"\"",
18
+ "groupStyles": { "0": "string" }
19
+ },
20
+
21
+ // Double quoted strings
22
+ {
23
+ "regex": "\"(?:\\\\.|[^\"])*\"",
24
+ "groupStyles": { "0": "string" }
25
+ },
26
+
27
+ // Single quoted characters
28
+ {
29
+ "regex": "'(?:\\\\.|[^'])'",
30
+ "groupStyles": { "0": "string" }
31
+ },
32
+
33
+ // Numbers
34
+ { "type": "number", "regex": "\\b\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?[fFdDlL]?\\b" },
35
+ { "type": "number", "regex": "\\b0[xX][0-9a-fA-F]+\\b" },
36
+ { "type": "number", "regex": "\\b0[bB][01]+\\b" },
37
+
38
+ // Annotations
39
+ { "type": "meta", "regex": "@\\w+" },
40
+
41
+ // Keywords - using regex with word boundaries
42
+ {
43
+ "type": "keyword",
44
+ "regex": "\\b(?:as|break|class|continue|do|else|false|for|fun|if|in|interface|is|null|object|package|return|super|this|throw|true|try|typealias|typeof|val|var|when|while|catch|constructor|delegate|dynamic|finally|import|actual|abstract|annotation|companion|const|crossinline|data|enum|expect|external|final|infix|inline|inner|internal|lateinit|noinline|open|operator|out|override|private|protected|public|reified|sealed|suspend|tailrec|vararg)\\b"
45
+ },
46
+
47
+ // Operators
48
+ { "type": "operator", "regex": "[+\\-*/%=&|!<>^~?:]+|\\.|,|;|\\(|\\)|\\{|\\}|\\[|\\]" },
49
+
50
+ // Default fallback
51
+ { "type": "default", "regex": "." }
52
+ ]
53
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": ["Lua", ".lua"],
3
+ "comment": [
4
+ { "startsWith": "--" },
5
+ { "startsWith": "--[[", "endsWith": "]]" }
6
+ ],
7
+
8
+ "rules": [
9
+ // Single-line comments
10
+ { "type": "comment", "regex": "--.*" },
11
+
12
+ // Multi-line comments
13
+ { "type": "comment", "regex": "--\\[[\\s\\S]*?\\]\\]" },
14
+
15
+ // Double quoted strings
16
+ { "type": "string", "regex": "\"(?:\\\\.|[^\"])*\"" },
17
+
18
+ // Single quoted strings
19
+ { "type": "string", "regex": "'(?:\\\\.|[^'])*'" },
20
+
21
+ // Numbers - decimal
22
+ { "type": "number", "regex": "\\b\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\b" },
23
+
24
+ // Numbers - hex
25
+ { "type": "number", "regex": "\\b0[xX][0-9a-fA-F]+\\b" },
26
+
27
+ // Types
28
+ {
29
+ "type": "type",
30
+ "regex": "\\b(?:local|global|boolean|number|userdata)\\b"
31
+ },
32
+
33
+ // Constants
34
+ {
35
+ "type": "constant",
36
+ "regex": "\\b(?:true|false|nil)\\b"
37
+ },
38
+
39
+ // Keywords
40
+ {
41
+ "type": "keyword",
42
+ "regex": "\\b(?:return|then|while|and|break|do|else|elseif|end|for|function|if|in|not|or|repeat|until|thread|table)\\b"
43
+ },
44
+
45
+ // Operators
46
+ { "type": "operator", "regex": "[+\\-*/%=&|!<>^~#:]+" },
47
+
48
+ // Punctuation
49
+ { "type": "operator", "regex": "[.,;(){}[\\]]" },
50
+
51
+ // Default fallback
52
+ { "type": "default", "regex": "." }
53
+ ]
54
+ }
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": ["PHP", ".php"],
3
+ "comment": [
4
+ { "startsWith": "//" },
5
+ { "startsWith": "/*", "endsWith": "*/" }
6
+ ],
7
+
8
+ "rules": [
9
+ // Single-line comments
10
+ { "type": "comment", "regex": "//.*" },
11
+
12
+ // Multi-line comments
13
+ { "type": "comment", "regex": "/\\*[\\s\\S]*?\\*/" },
14
+
15
+ // Hash comments
16
+ { "type": "comment", "regex": "#.*" },
17
+
18
+ // Attributes
19
+ { "type": "meta", "regex": "#\\[.*?\\]" },
20
+
21
+ // Double quoted strings
22
+ { "type": "string", "regex": "\"(?:\\\\.|[^\"])*\"" },
23
+
24
+ // Single quoted strings
25
+ { "type": "string", "regex": "'(?:\\\\.|[^'])*'" },
26
+
27
+ // Backtick strings
28
+ { "type": "string", "regex": "`(?:\\\\.|[^`])*`" },
29
+
30
+ // String escape sequences
31
+ { "type": "strEscape", "regex": "\\\\." },
32
+
33
+ // Numbers - decimal
34
+ { "type": "number", "regex": "\\b\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\b" },
35
+
36
+ // Numbers - hex
37
+ { "type": "number", "regex": "\\b0[xX][0-9a-fA-F]+\\b" },
38
+
39
+ // Numbers - octal
40
+ { "type": "number", "regex": "\\b0[0-7]+\\b" },
41
+
42
+ // Numbers - binary
43
+ { "type": "number", "regex": "\\b0[bB][01]+\\b" },
44
+
45
+ // Variables
46
+ { "type": "constant", "regex": "\\$\\w+" },
47
+
48
+ // Keywords
49
+ {
50
+ "type": "keyword",
51
+ "regex": "\\b(?:abstract|and|as|break|callable|case|catch|class|clone|const|continue|declare|default|do|echo|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|final|finally|fn|for|foreach|function|global|goto|if|match|implements|include|include_once|instanceof|insteadof|interface|namespace|new|or|print|private|protected|public|readonly|require|xor|require_once|return|static|switch|throw|trait|try|use|var|while|yield)\\b"
52
+ },
53
+
54
+ // Built-in functions
55
+ {
56
+ "type": "keyword2",
57
+ "regex": "\\b(?:__halt_compiler|array|die|empty|eval|exit|isset|list|unset|echo|print_r|sort|htmlentities|mkdir|fopen|fread|rewind|fwrite|fclose|opendir|readdir|closedir|is_dir|is_link|readlink)\\b"
58
+ },
59
+
60
+ // Operators
61
+ { "type": "operator", "regex": "[+\\-*/%=&|!<>^~?:]+" },
62
+
63
+ // Punctuation
64
+ { "type": "operator", "regex": "[.,;(){}[\\]]" },
65
+
66
+ // Default fallback
67
+ { "type": "default", "regex": "." }
68
+ ]
69
+ }