rip-lang 3.13.129 → 3.13.130
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.
- package/README.md +6 -6
- package/docs/RIP-LANG.md +12 -0
- package/docs/dist/rip.js +469 -364
- package/docs/dist/rip.min.js +151 -149
- package/docs/dist/rip.min.js.br +0 -0
- package/docs/ui/hljs-rip.js +7 -0
- package/package.json +1 -1
- package/src/AGENTS.md +1 -0
- package/src/compiler.js +36 -4
- package/src/components.js +17 -8
- package/src/grammar/grammar.rip +40 -0
- package/src/lexer.js +31 -8
- package/src/parser.js +223 -221
- package/src/sourcemap-utils.js +46 -2
- package/src/typecheck.js +39 -9
- package/src/types.js +5 -5
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
|
-
<a href="CHANGELOG.md"><img src="https://img.shields.io/badge/version-3.13.
|
|
12
|
+
<a href="CHANGELOG.md"><img src="https://img.shields.io/badge/version-3.13.130-blue.svg" alt="Version"></a>
|
|
13
13
|
<a href="#zero-dependencies"><img src="https://img.shields.io/badge/dependencies-ZERO-brightgreen.svg" alt="Dependencies"></a>
|
|
14
14
|
<a href="#"><img src="https://img.shields.io/badge/tests-1%2C436%2F1%2C436-brightgreen.svg" alt="Tests"></a>
|
|
15
15
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License"></a>
|
|
@@ -410,16 +410,16 @@ Simple arrays (with `.loc`) instead of AST node classes. The compiler is self-ho
|
|
|
410
410
|
| Component | File | Lines |
|
|
411
411
|
|-----------|------|-------|
|
|
412
412
|
| Lexer + Rewriter | `src/lexer.js` | 1,778 |
|
|
413
|
+
| Grammar | `src/grammar/grammar.rip` | 948 |
|
|
414
|
+
| Parser Generator | `src/grammar/solar.rip` | 929 |
|
|
415
|
+
| Parser (generated) | `src/parser.js` | 359 |
|
|
413
416
|
| Compiler + Codegen | `src/compiler.js` | 3,334 |
|
|
414
|
-
| Type System | `src/types.js` | 1,091 |
|
|
415
417
|
| Component System | `src/components.js` | 2,026 |
|
|
418
|
+
| Browser Engine | `src/browser.js` | 194 |
|
|
416
419
|
| Source Maps | `src/sourcemaps.js` | 189 |
|
|
420
|
+
| Type System | `src/types.js` | 1,091 |
|
|
417
421
|
| Type Checking | `src/typecheck.js` | 442 |
|
|
418
|
-
| Parser (generated) | `src/parser.js` | 359 |
|
|
419
|
-
| Grammar | `src/grammar/grammar.rip` | 948 |
|
|
420
|
-
| Parser Generator | `src/grammar/solar.rip` | 929 |
|
|
421
422
|
| REPL | `src/repl.js` | 600 |
|
|
422
|
-
| Browser Entry | `src/browser.js` | 194 |
|
|
423
423
|
| **Total** | | **~11,890** |
|
|
424
424
|
|
|
425
425
|
---
|
package/docs/RIP-LANG.md
CHANGED
|
@@ -108,6 +108,14 @@ user = {name: "Alice", age: 30}
|
|
|
108
108
|
shorthand = {name, age} # Same as {name: name, age: age}
|
|
109
109
|
config = {api.host: "localhost", api.port: 3000} # Dotted keys → flat string keys
|
|
110
110
|
|
|
111
|
+
# Map literals — real JavaScript Map with any key type
|
|
112
|
+
table = *{
|
|
113
|
+
/^NAME:/: [""]
|
|
114
|
+
"CHOOSE 1": [1]
|
|
115
|
+
true: "yes"
|
|
116
|
+
null: "nothing"
|
|
117
|
+
}
|
|
118
|
+
|
|
111
119
|
# Ranges
|
|
112
120
|
nums = [1..5] # [1, 2, 3, 4, 5]
|
|
113
121
|
exclusive = [1...5] # [1, 2, 3, 4]
|
|
@@ -331,6 +339,7 @@ Multiple lines
|
|
|
331
339
|
| `not in` | Not in | `x not in arr` | Negated membership test |
|
|
332
340
|
| `not of` | Not of | `k not of obj` | Negated key existence |
|
|
333
341
|
| `<=>` | Two-way bind | `value <=> name` | Bidirectional reactive binding (render blocks) |
|
|
342
|
+
| `*{ }` | Map literal | `*{/pat/: val}` | `new Map([[/pat/, val]])` |
|
|
334
343
|
|
|
335
344
|
## Assignment Operators
|
|
336
345
|
|
|
@@ -2075,6 +2084,9 @@ a ?? b # nullish coalescing
|
|
|
2075
2084
|
# Word arrays
|
|
2076
2085
|
%w[foo bar baz] # ["foo", "bar", "baz"] — Ruby-style word literal
|
|
2077
2086
|
|
|
2087
|
+
# Map literals — real Map with any key type
|
|
2088
|
+
*{ /regex/: val, "key": val, 42: val }
|
|
2089
|
+
|
|
2078
2090
|
# Two-way binding (render blocks)
|
|
2079
2091
|
input value <=> @name # bidirectional reactive binding
|
|
2080
2092
|
Dialog open <=> @show # works with components too
|