Skip to content

Commit b98067a

Browse files
committed
Rename multiline strings to raw strings
1 parent b32b0ef commit b98067a

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

.vitepress/maml.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
}
141141
]
142142
},
143-
"multilinestring": {
143+
"rawstring": {
144144
"begin": "\"\"\"",
145145
"beginCaptures": {
146146
"0": {
@@ -172,7 +172,7 @@
172172
"include": "#number"
173173
},
174174
{
175-
"include": "#multilinestring"
175+
"include": "#rawstring"
176176
},
177177
{
178178
"include": "#string"

index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ hero:
2727
]
2828
2929
notes: """
30-
This is a multiline strings.
30+
This is a multiline raw strings.
3131
Keeps formatting as-is.
3232
"""
3333
}
@@ -40,7 +40,7 @@ JSON is the most popular _data-interchange_ format. But it isn't a very good _co
4040
**MAML** keeps JSON’s simplicity and adds only the needed bits for a good configuration language:
4141

4242
1. Comments
43-
2. Multiline strings
43+
2. Multiline raw strings
4444
3. Optional commas
4545
4. Optional key quotes
4646

spec/v0.1.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ are not permitted in comments.
4646
Values
4747
------
4848

49-
A MAML value is an object, array, string, multiline string, integer, float,
49+
A MAML value is an object, array, string, raw string, integer, float,
5050
boolean, or null.
5151

5252

@@ -146,10 +146,10 @@ MAML should produce an error. All strings must contain only valid UTF-8
146146
characters.
147147

148148

149-
Multiline String
149+
Raw String
150150
----------------
151151

152-
**Multiline Strings** are surrounded by `"""` three quotes on each
152+
**Raw strings** are surrounded by `"""` three quotes on each
153153
side and allow newlines. There is no escaping. A newline immediately following
154154
the opening delimiter is ignored. All other content between the delimiters is
155155
interpreted as-is without modification.
@@ -205,7 +205,7 @@ are interpreted as-is without modification.
205205
"""
206206
```
207207

208-
You can write one or two quotes anywhere within a multiline string,
208+
You can write one or two quotes anywhere within a raw string,
209209
but sequences of three or more quotes are not permitted.
210210

211211
```maml
@@ -215,10 +215,10 @@ But many if spaces: "1", "2", "3".
215215
"""
216216
```
217217

218-
Multiline string may also be written in a single line.
218+
Raw string may also be written in a single line.
219219

220220
```maml
221-
"""A multiline string and with "quotas"."""
221+
"""A raw string and with "quotas"."""
222222
```
223223

224224
The following example evaluates to the empty string `""`:
@@ -237,10 +237,10 @@ additional blank line between the delimiters:
237237
"""
238238
```
239239

240-
The single-line multiline string cannot represent an empty string. To write an
240+
The single-line raw string cannot represent an empty string. To write an
241241
empty string on one line, use a normal string `""`.
242242

243-
All multiline strings must contain only valid UTF-8 characters.
243+
All raw strings must contain only valid UTF-8 characters.
244244

245245

246246
Integer

spec/v0.1/maml.abnf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
maml = ws-comment-newline value ws-comment-newline
22

3-
value = object / array / string / multiline-string / number / "true" / "false" / "null"
3+
value = object / array / string / raw-string / number / "true" / "false" / "null"
44

55
object = "{" [ members ] ws-comment-newline "}"
66

@@ -22,7 +22,7 @@ separator = "," / newline
2222

2323
string = quote *char quote
2424

25-
multiline-string = 3quote 1*literal-char *( 1*2quote 1*literal-char ) 3quote
25+
raw-string = 3quote 1*literal-char *( 1*2quote 1*literal-char ) 3quote
2626

2727
literal-char = %x09 / %x20-21 / %x23-7E / non-ascii / newline
2828

spec/v0.1/maml.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import path from 'node:path'
33
import { parseFile } from 'abnf'
44
import peggy from 'peggy'
55

6-
const allowedStartRules = ['maml', 'multiline_string']
6+
const allowedStartRules = ['maml', 'raw_string']
77

88
async function generateParser() {
99
const __dirname = new URL('.', import.meta.url).pathname
@@ -121,15 +121,15 @@ describe('MAML v0.1', () => {
121121
expect(() => parse(`"\\u{1234567}"`)).toThrow()
122122
})
123123

124-
test('multiline string', () => {
124+
test('raw string', () => {
125125
parse(`"""
126126
Hello,
127127
world!
128-
"""`, 'multiline_string')
129-
parse(`""" """`, 'multiline_string')
130-
parse(`"""\n"""`, 'multiline_string')
131-
parse(`""" " """`, 'multiline_string')
132-
parse(`""" "" """`, 'multiline_string')
128+
"""`, 'raw_string')
129+
parse(`""" """`, 'raw_string')
130+
parse(`"""\n"""`, 'raw_string')
131+
parse(`""" " """`, 'raw_string')
132+
parse(`""" "" """`, 'raw_string')
133133

134134
expect(() => parse(`""""""`)).toThrow()
135135
expect(() => parse(`""" """""`)).toThrow()

0 commit comments

Comments
 (0)