rip-lang 1.3.0 → 1.3.3

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/CHANGELOG.md CHANGED
@@ -5,6 +5,139 @@ All notable changes to Rip will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.3.3] - 2025-11-06
9
+
10
+ ### Changed
11
+ - **Cleaner JavaScript output** (#34) - Removed unnecessary semicolons after block statements
12
+ - Function and class declarations no longer have trailing semicolons
13
+ - Control flow blocks (if/for/while/switch/try) no longer have trailing semicolons
14
+ - Produces more idiomatic, professional-looking JavaScript
15
+ - Matches standard formatters (Prettier, ESLint)
16
+ - Test count: 878 → 891 (+13 tests)
17
+
18
+ ## [1.3.2] - 2025-11-05
19
+
20
+ ### Changed
21
+ - Minor code cleanup and refinements
22
+ - Updated solar.rip indentation handling for better code generation
23
+
24
+ ## [1.3.1] - 2025-11-05
25
+
26
+ ### Added
27
+ - **Otherwise operator (`!?`)** (#32) - Undefined-only coalescing
28
+ - Returns first value that is NOT `undefined`
29
+ - Unlike `??` (nullish), treats `null`, `false`, `0`, `""` as valid values
30
+ - Perfect for optional parameters with meaningful falsy values
31
+ - Syntax: `value1 !? value2 !? 'default'`
32
+ - Example: `timeout = config.timeout !? 5000` (null/0 are valid!)
33
+ - Test count: 868 → 878 (+10 tests)
34
+
35
+ ## [1.3.0] - 2025-11-05
36
+
37
+ ### Added
38
+ - **Script execution with proper argument passing** - `rip script.rip -h` now passes `-h` to script
39
+ - Arguments before script name → rip options
40
+ - Arguments after script name → script arguments
41
+ - Fixes issue where rip would consume script's flags
42
+ - **Solar.rip synchronization** - Updated to match solar-parser 1.2.0
43
+ - New CLI options: `--version`, `--info`, `--sexpr`
44
+ - Removed `commonCode` architecture for simpler code generation
45
+ - Fixed file writing bug (was using `unless` incorrectly)
46
+
47
+ ### Changed
48
+ - Improved CLI argument parsing for better script execution
49
+
50
+ ## [1.2.2] - 2025-11-04
51
+
52
+ ### Added
53
+ - **Browser REPL UI improvements** - Cleaner, more intuitive interface
54
+ - Made "Live Compiler" the default tab
55
+ - Added Clear and Run buttons to Rip Source panel
56
+ - Converted checkboxes to toggle buttons (gray/blue states)
57
+ - Consistent header layout across both panes
58
+ - Helpful tooltips on all buttons
59
+
60
+ ### Fixed
61
+ - **For-loop destructuring with defaults** (#30) - Full CoffeeScript compatibility
62
+ - `for [a, b = 99, c = 88] in arr` now works correctly
63
+ - Generates proper ES6 destructuring with defaults
64
+ - Previously generated invalid s-expressions in patterns
65
+
66
+ ### Changed
67
+ - Test count: 867 → 868 (+1 test)
68
+
69
+ ## [1.2.1] - 2025-11-04
70
+
71
+ ### Fixed
72
+ - **Slice syntax with nested indices** (#28) - Property access after nested brackets now works
73
+ - `line[_[0].length..]` now compiles correctly
74
+ - Fixed lexer rewriter to use bracket depth counting
75
+ - Previously failed with parse error
76
+ - Example: `arr[obj.data[0].length..]` → `arr.slice(obj.data[0].length)`
77
+ - Test count: 865 → 867 (+2 tests)
78
+
79
+ ## [1.2.0] - 2025-11-04
80
+
81
+ ### Fixed
82
+ - **Switch without discriminant context bug** (#26) - Statement context no longer adds returns
83
+ - Switch in loops now generates correct code (no invalid returns)
84
+ - Made `generateSwitchAsIfChain()` context-aware
85
+ - Value context: adds returns (switch as expression)
86
+ - Statement context: plain statements (side effects only)
87
+ - **__DATA__ section generation** - Natural code emission without string surgery
88
+ - `var DATA;` now positioned logically before `_setDataSection()` call
89
+ - Removed ~50 lines of complex regex/string manipulation
90
+ - Clean, obvious code generation in `generateProgram()`
91
+ - **S-expression pretty printer** - Restored missing features
92
+ - Fixed heregex handling (multi-line regex collapsing)
93
+ - Fixed program node formatting with proper indentation
94
+ - Faster with Set lookup for INLINE_FORMS
95
+ - Modern JS with optional chaining and nullish coalescing
96
+
97
+ ### Changed
98
+ - Test count: 864 → 865 (+1 test)
99
+ - Improved code generation architecture
100
+
101
+ ## [1.1.5] - 2025-11-03
102
+
103
+ ### Fixed
104
+ - **npm package files** - Added `scripts/serve.js` for `rip -w` command
105
+ - Browser REPL now works for npm users
106
+ - Fixed missing dependency for web server functionality
107
+
108
+ ### Changed
109
+ - S-expression printer improvements backported to docs/examples/sexpr.rip
110
+
111
+ ## [1.1.4] - 2025-11-03
112
+
113
+ ### Fixed
114
+ - **S-expression printer** - Improved performance and correctness
115
+ - Faster Set-based INLINE_FORMS lookup
116
+ - Modern JavaScript features (optional chaining, nullish coalescing)
117
+ - Proper heregex and program node formatting
118
+ - All functionality restored and working
119
+
120
+ ## [1.1.3] - 2025-11-03
121
+
122
+ ### Fixed
123
+ - **Package files** - Included `scripts/serve.js` in npm package
124
+ - Required for `rip -w` browser REPL command
125
+
126
+ ## [1.1.2] - 2025-11-02
127
+
128
+ ### Added
129
+ - **npm publishing safeguards** (#24) - Professional package configuration
130
+ - `files` whitelist (only 51 essential files published)
131
+ - `prepublishOnly` script (runs tests + rebuilds browser bundle)
132
+ - `pack` script for previewing package contents
133
+ - **Comprehension optimization** (#22) - Eliminated wasteful IIFEs
134
+ - Function-final comprehension assignments ~24% smaller
135
+ - Smarter context detection for when to use IIFE vs plain loop
136
+
137
+ ### Changed
138
+ - Package size optimized: excludes test/, scripts/, dev files
139
+ - Test count: 864 tests (all passing)
140
+
8
141
  ## [1.1.1] - 2025-11-01
9
142
 
10
143
  ### Fixed
package/README.md CHANGED
@@ -9,9 +9,9 @@
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
- <a href="CHANGELOG.md"><img src="https://img.shields.io/badge/version-1.1.1-blue.svg" alt="Version"></a>
12
+ <a href="CHANGELOG.md"><img src="https://img.shields.io/badge/version-1.3.0-blue.svg" alt="Version"></a>
13
13
  <a href="#es2022-target"><img src="https://img.shields.io/badge/target-ES2022-blue.svg" alt="Target"></a>
14
- <a href="#current-status"><img src="https://img.shields.io/badge/tests-864%2F864-brightgreen.svg" alt="Tests"></a>
14
+ <a href="#current-status"><img src="https://img.shields.io/badge/tests-878%2F878-brightgreen.svg" alt="Tests"></a>
15
15
  <a href="#current-status"><img src="https://img.shields.io/badge/coverage-100%25-brightgreen.svg" alt="Coverage"></a>
16
16
  <a href="#zero-dependencies"><img src="https://img.shields.io/badge/dependencies-ZERO-brightgreen.svg" alt="Dependencies"></a>
17
17
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License"></a>
@@ -634,9 +634,20 @@ user?.profile?.name # ES6 optional chaining (native)
634
634
  arr?[0] # CoffeeScript soak (existence check)
635
635
  fn?(arg) # CoffeeScript soak call
636
636
 
637
- # Nullish coalescing
637
+ # Nullish coalescing (?? - rejects null OR undefined)
638
638
  port = config.port ?? 8080
639
639
 
640
+ # Otherwise operator (!? - rejects ONLY undefined)
641
+ timeout = config.timeout !? 5000 # null and 0 are valid!
642
+ enabled = options.enabled !? true # false means disabled, undefined means default
643
+
644
+ # Comparison:
645
+ null ?? 'default' # → 'default' (null fails)
646
+ null !? 'default' # → null (null is defined!)
647
+
648
+ # Use ?? when: Both null and undefined should use default
649
+ # Use !? when: Only undefined should use default (null/false/0 are meaningful)
650
+
640
651
  # Legacy existential operator (CoffeeScript compatibility)
641
652
  value = x ? y # SPACE? syntax (auto-converts to ??)
642
653
  value = x ?? y # Preferred modern syntax