@danielx/civet 0.4.19-pre.11 → 0.4.19-pre.12

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 CHANGED
@@ -88,6 +88,9 @@ Things Kept from CoffeeScript
88
88
  - Simplified number method calls `1.toFixed()` -> `1..toFixed()`
89
89
  - `if`/`switch`/`for`/`loop`/`while`/`throw` expressions
90
90
  - Destructuring object assignment doesn't require being wrapped in parens at the statement level `{a, b} = c` -> `({a, b} = c)`
91
+ - Prefix or postfix splats `[...a]`, `x = [a...]`
92
+ - `///` Heregexp
93
+ - With some [changes](#things-changed-from-coffeescript).
91
94
  - JSX 😿
92
95
 
93
96
  Things Removed from CoffeeScript
@@ -117,7 +120,6 @@ Civet.
117
120
  - Optional assignment `x?.y = 3` -> `x != null ? x.y = 3 : undefined`
118
121
  - Conditional assignment `a?[x] = 3` -> `a ? a[x] = 3 : undefined`
119
122
  - Might add later
120
- - `///` Heregexp
121
123
  - Rest parameter in any assignment position
122
124
  - Multiple slice assignment `otherNumbers[0...] = numbers[3..6] = [-3, -4, -5, -6]`
123
125
 
@@ -127,7 +129,6 @@ Things Changed from CoffeeScript
127
129
  - `==` -> `==` rather than `===` (can be kept with `"civet coffeeCompat"` or `"civet coffeeEq"`)
128
130
  - `!=` -> `!=` rather than `!==` (can be kept with `"civet coffeeCompat"` or `"civet coffeeEq"`)
129
131
  - `for in` and `for of` are no longer swapped and become their JS equivalents.
130
- - `a...` is now `...a` just like JS
131
132
  - `a in b` is now `a in b` rather than `b.indexOf(a) >= 0`
132
133
  - `x?.y` now compiles to `x?.y` rather than the `if typeof x !== 'undefined' && x !== null` if check
133
134
  - Existential `x?` -> `(x != null)` no longer checks for undeclared variables.
@@ -150,6 +151,15 @@ Things Changed from CoffeeScript
150
151
  x + 3
151
152
  ```
152
153
  remains as is.
154
+ - Heregex
155
+ - Allows both kinds of substitutions `#{..}`, `${..}`.
156
+ - Also allows both kinds of single line comments `//`, `#`.
157
+ - Keeps non-newline whitespace inside of character classes.
158
+ - Doesn't require escaping `#` after space inside of character classes.
159
+ - `#` is always the start of a comment outside of character classes regardless of leading space (CoffeeScript treats
160
+ `\s+#` as comment starts inside and outside of character classes).
161
+ - Might later add a compat flag to get more CoffeeScript compatibility.
162
+ - Might also later add a compat flag to only use ES interpolations and comments inside Heregexes.
153
163
 
154
164
  Things Added that CoffeeScript didn't
155
165
  ---