Skip to content

Commit 6f5f066

Browse files
committed
docs(readme): update to cover new features
1 parent 96911b8 commit 6f5f066

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,25 +211,39 @@ let {
211211

212212
Strings must be surrounded by double quotes. All unicode is supported.
213213

214+
The following escape codes are supported: `\\`, `\"`, `\n`, `\r`, `\t`.
215+
You can also add any unicode character using a `\uXXXX` escape.
216+
214217
```corn
215218
foo = "bar"
219+
two_lines = "hello\nworld"
216220
```
217221

218222
#### Integer
219223

220224
Integers are signed and 64 bit, meaning you can use any value
221225
between `-9223372036854775808` and `9223372036854775807`.
222226

227+
You can use a single underscore `_` separator between digits in decimal values to break up larger numbers.
228+
229+
Hexadecimal values are also supported.
230+
223231
```corn
224232
answer = 42
233+
big_value = 1_000_000
234+
color = 0xfafafa
225235
```
226236

227237
#### Float
228238

229239
Double precision (64-bit) floats are used.
230240

241+
Very large or very small values can be represented with an exponent `e`.
242+
231243
```corn
232244
pi = 3.14159
245+
very_big = 1.01e+10
246+
very_small = 1.01e-10
233247
```
234248

235249
#### Boolean
@@ -375,6 +389,26 @@ let {
375389
Inputs are intentionally quite limited as to what they can do -
376390
if you need more power you should use a full language.
377391

392+
#### String Interpolation
393+
394+
String inputs can be put inside string values to interpolate their values, like so:
395+
396+
```corn
397+
let {
398+
$subject = "world"
399+
} in {
400+
greeting = "hello, $subject"
401+
}
402+
```
403+
404+
Evaluates to:
405+
406+
```json
407+
{
408+
"greeting": "hello, world"
409+
}
410+
```
411+
378412
#### Merging
379413

380414
Somtimes you want to re-use an object or array to compose a larger object/array.

0 commit comments

Comments
 (0)