rip-lang 3.13.92 → 3.13.94

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 (74) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/README.md +3 -3
  3. package/bin/rip +11 -1
  4. package/docs/AGENTS.md +43 -0
  5. package/docs/RIP-LANG.md +3 -3
  6. package/docs/RIP-TYPES.md +72 -91
  7. package/docs/charts.html +15 -15
  8. package/docs/dist/rip.js +142 -38
  9. package/docs/dist/rip.min.js +174 -174
  10. package/docs/dist/rip.min.js.br +0 -0
  11. package/docs/index.html +2 -2
  12. package/package.json +1 -1
  13. package/src/AGENTS.md +456 -0
  14. package/src/lexer.js +1 -2
  15. package/src/typecheck.js +188 -6
  16. package/src/types.js +63 -38
  17. package/src/ui.rip +65 -0
  18. package/docs/ui/accordion.rip +0 -113
  19. package/docs/ui/alert-dialog.rip +0 -96
  20. package/docs/ui/autocomplete.rip +0 -141
  21. package/docs/ui/avatar.rip +0 -37
  22. package/docs/ui/badge.rip +0 -15
  23. package/docs/ui/breadcrumb.rip +0 -46
  24. package/docs/ui/button-group.rip +0 -26
  25. package/docs/ui/button.rip +0 -23
  26. package/docs/ui/card.rip +0 -25
  27. package/docs/ui/carousel.rip +0 -110
  28. package/docs/ui/checkbox-group.rip +0 -65
  29. package/docs/ui/checkbox.rip +0 -33
  30. package/docs/ui/collapsible.rip +0 -50
  31. package/docs/ui/combobox.rip +0 -155
  32. package/docs/ui/context-menu.rip +0 -105
  33. package/docs/ui/date-picker.rip +0 -214
  34. package/docs/ui/dialog.rip +0 -107
  35. package/docs/ui/drawer.rip +0 -79
  36. package/docs/ui/editable-value.rip +0 -80
  37. package/docs/ui/field.rip +0 -53
  38. package/docs/ui/fieldset.rip +0 -22
  39. package/docs/ui/form.rip +0 -39
  40. package/docs/ui/grid.rip +0 -901
  41. package/docs/ui/hljs-rip.js +0 -209
  42. package/docs/ui/index.css +0 -1772
  43. package/docs/ui/index.html +0 -2433
  44. package/docs/ui/input-group.rip +0 -28
  45. package/docs/ui/input.rip +0 -36
  46. package/docs/ui/label.rip +0 -16
  47. package/docs/ui/menu.rip +0 -162
  48. package/docs/ui/menubar.rip +0 -155
  49. package/docs/ui/meter.rip +0 -36
  50. package/docs/ui/multi-select.rip +0 -158
  51. package/docs/ui/native-select.rip +0 -32
  52. package/docs/ui/nav-menu.rip +0 -129
  53. package/docs/ui/number-field.rip +0 -162
  54. package/docs/ui/otp-field.rip +0 -89
  55. package/docs/ui/pagination.rip +0 -123
  56. package/docs/ui/popover.rip +0 -143
  57. package/docs/ui/preview-card.rip +0 -73
  58. package/docs/ui/progress.rip +0 -25
  59. package/docs/ui/radio-group.rip +0 -67
  60. package/docs/ui/resizable.rip +0 -123
  61. package/docs/ui/scroll-area.rip +0 -145
  62. package/docs/ui/select.rip +0 -184
  63. package/docs/ui/separator.rip +0 -17
  64. package/docs/ui/skeleton.rip +0 -22
  65. package/docs/ui/slider.rip +0 -165
  66. package/docs/ui/spinner.rip +0 -17
  67. package/docs/ui/table.rip +0 -27
  68. package/docs/ui/tabs.rip +0 -124
  69. package/docs/ui/textarea.rip +0 -48
  70. package/docs/ui/toast.rip +0 -87
  71. package/docs/ui/toggle-group.rip +0 -78
  72. package/docs/ui/toggle.rip +0 -24
  73. package/docs/ui/toolbar.rip +0 -46
  74. package/docs/ui/tooltip.rip +0 -115
@@ -1,209 +0,0 @@
1
- // highlight.js language definition for Rip
2
-
3
- export default function(hljs) {
4
- const KEYWORDS = [
5
- // Control flow
6
- 'if', 'else', 'unless', 'then', 'switch', 'when',
7
- 'for', 'while', 'until', 'loop', 'do',
8
- 'return', 'break', 'continue', 'throw',
9
- 'try', 'catch', 'finally',
10
- 'yield', 'await',
11
- // Modules
12
- 'import', 'export', 'from', 'default',
13
- // Operators as keywords
14
- 'delete', 'typeof', 'instanceof', 'new', 'super',
15
- 'and', 'or', 'not', 'is', 'isnt',
16
- // Declarations
17
- 'class', 'def', 'enum', 'interface', 'extends', 'own',
18
- // Iteration
19
- 'in', 'of', 'by', 'as',
20
- // Component system
21
- 'component', 'render', 'slot', 'offer', 'accept',
22
- // Other
23
- 'use', 'debugger', 'it',
24
- ];
25
-
26
- const LITERALS = [
27
- 'true', 'false', 'yes', 'no', 'on', 'off',
28
- 'null', 'undefined', 'NaN', 'Infinity', 'this',
29
- ];
30
-
31
- const BUILT_INS = [
32
- 'console', 'process', 'require', 'module', 'exports',
33
- 'setTimeout', 'setInterval', 'clearTimeout', 'clearInterval',
34
- 'requestAnimationFrame', 'cancelAnimationFrame',
35
- 'Promise', 'Array', 'Object', 'String', 'Number', 'Boolean',
36
- 'Math', 'Date', 'RegExp', 'Error', 'TypeError', 'RangeError',
37
- 'JSON', 'Map', 'Set', 'WeakMap', 'WeakSet',
38
- 'Symbol', 'Proxy', 'Reflect',
39
- 'Buffer', 'Bun',
40
- 'document', 'window', 'globalThis', 'navigator',
41
- 'fetch', 'URL', 'URLSearchParams', 'FormData',
42
- 'Event', 'CustomEvent', 'EventSource',
43
- 'HTMLElement', 'Node', 'NodeList', 'Element',
44
- 'DocumentFragment', 'MutationObserver', 'ResizeObserver',
45
- 'IntersectionObserver',
46
- // Rip stdlib
47
- 'p', 'pp', 'abort', 'assert', 'exit', 'kind', 'noop',
48
- 'raise', 'rand', 'sleep', 'todo', 'warn', 'zip',
49
- ];
50
-
51
- const INTERPOLATION = {
52
- className: 'subst',
53
- begin: /#\{/, end: /\}/,
54
- keywords: { keyword: KEYWORDS, literal: LITERALS },
55
- };
56
-
57
- const STRING_DOUBLE = {
58
- className: 'string',
59
- begin: '"', end: '"',
60
- contains: [hljs.BACKSLASH_ESCAPE, INTERPOLATION],
61
- };
62
-
63
- const STRING_SINGLE = {
64
- className: 'string',
65
- begin: "'", end: "'",
66
- contains: [hljs.BACKSLASH_ESCAPE],
67
- };
68
-
69
- const HEREDOC_DOUBLE = {
70
- className: 'string',
71
- begin: '"""', end: '"""',
72
- contains: [hljs.BACKSLASH_ESCAPE, INTERPOLATION],
73
- };
74
-
75
- const HEREDOC_SINGLE = {
76
- className: 'string',
77
- begin: "'''", end: "'''",
78
- contains: [hljs.BACKSLASH_ESCAPE],
79
- };
80
-
81
- const HEREGEX = {
82
- className: 'regexp',
83
- begin: '///', end: '///[gimsuy]*',
84
- contains: [INTERPOLATION, hljs.HASH_COMMENT_MODE],
85
- };
86
-
87
- const REGEX = {
88
- className: 'regexp',
89
- begin: /\/(?![/*])(?:[^\/\\]|\\.)*\/[gimsuy]*/,
90
- relevance: 0,
91
- };
92
-
93
- const BLOCK_COMMENT = {
94
- className: 'comment',
95
- begin: '###', end: '###',
96
- contains: [hljs.PHRASAL_WORDS_MODE],
97
- };
98
-
99
- const LINE_COMMENT = hljs.COMMENT('#', '$');
100
-
101
- const NUMBER = {
102
- className: 'number',
103
- variants: [
104
- { begin: /0x[0-9a-fA-F](?:_?[0-9a-fA-F])*n?/ },
105
- { begin: /0o[0-7](?:_?[0-7])*n?/ },
106
- { begin: /0b[01](?:_?[01])*n?/ },
107
- { begin: /\d[\d_]*(?:\.[\d][\d_]*)?(?:[eE][+-]?\d+)?n?/ },
108
- ],
109
- relevance: 0,
110
- };
111
-
112
- const INSTANCE_VAR = {
113
- className: 'variable',
114
- begin: /@[a-zA-Z_$][\w$]*/,
115
- };
116
-
117
- const SIGIL_ATTR = {
118
- className: 'attribute',
119
- begin: /\$[a-zA-Z_][\w]*/,
120
- };
121
-
122
- const CLASS_NAME = {
123
- className: 'title.class',
124
- begin: /[A-Z][\w]*/,
125
- };
126
-
127
- const FUNCTION_DEF = {
128
- className: 'function',
129
- begin: /\bdef\s+/,
130
- end: /[(\s]/,
131
- excludeEnd: true,
132
- keywords: { keyword: 'def' },
133
- contains: [
134
- { className: 'title.function', begin: /[a-zA-Z_$][\w$]*[!?]?/ },
135
- ],
136
- };
137
-
138
- const METHOD_DEF = {
139
- className: 'function',
140
- match: /[a-zA-Z_$][\w$]*[!?]?(?=\s*:\s*(?:\([^)]*\)\s*)?[-=]>)/,
141
- contains: [
142
- { className: 'title.function', begin: /[a-zA-Z_$][\w$]*[!?]?/ },
143
- ],
144
- };
145
-
146
- const COMPONENT_DEF = {
147
- className: 'class',
148
- begin: /\b(?:export\s+)?[A-Z][\w]*\s*=\s*component\b/,
149
- returnBegin: true,
150
- keywords: { keyword: ['export', 'component'] },
151
- contains: [
152
- { className: 'title.class', begin: /[A-Z][\w]*/ },
153
- ],
154
- };
155
-
156
- const CLASS_DEF = {
157
- className: 'class',
158
- beginKeywords: 'class',
159
- end: /$/,
160
- contains: [
161
- { className: 'title.class', begin: /[A-Z][\w]*/ },
162
- { beginKeywords: 'extends', contains: [CLASS_NAME] },
163
- ],
164
- };
165
-
166
- const OPERATORS = {
167
- className: 'operator',
168
- begin: /\|>|::=|::|:=|~=|~>|<=>|\.=|=!|!\?|\?!|=~|\?\?=|\?\?|\?\.|\.\.\.|\.\.|=>|->|\*\*|\/\/|%%|===|!==|==|!=|<=|>=|&&|\|\||[+\-*\/%&|^~<>=!?]/,
169
- relevance: 0,
170
- };
171
-
172
- const TYPE_KEYWORDS = {
173
- className: 'type',
174
- begin: /\b(?:number|string|boolean|void|any|never|unknown|object|symbol|bigint)\b/,
175
- };
176
-
177
- return {
178
- name: 'Rip',
179
- aliases: ['rip'],
180
- keywords: {
181
- keyword: KEYWORDS,
182
- literal: LITERALS,
183
- built_in: BUILT_INS,
184
- },
185
- contains: [
186
- BLOCK_COMMENT,
187
- LINE_COMMENT,
188
- HEREDOC_DOUBLE,
189
- HEREDOC_SINGLE,
190
- STRING_DOUBLE,
191
- STRING_SINGLE,
192
- HEREGEX,
193
- REGEX,
194
- COMPONENT_DEF,
195
- FUNCTION_DEF,
196
- METHOD_DEF,
197
- CLASS_DEF,
198
- NUMBER,
199
- INSTANCE_VAR,
200
- SIGIL_ATTR,
201
- TYPE_KEYWORDS,
202
- OPERATORS,
203
- { // inline JS (backtick)
204
- className: 'string',
205
- begin: /`[^`]*`/,
206
- },
207
- ],
208
- };
209
- }