Skip to content

Commit

Permalink
fix: resolve formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
caiquetorres committed Dec 5, 2024
1 parent a8e585d commit 1961940
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
12 changes: 6 additions & 6 deletions documentation/docs/98-reference/.generated/compile-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,12 +400,6 @@ Expected token %token%
Expected whitespace
```

### unterminated_string_constant

```
Unterminated string constant
```

### export_undefined

```
Expand Down Expand Up @@ -994,6 +988,12 @@ Unexpected end of input
'%word%' is a reserved word in JavaScript and cannot be used here
```

### unterminated_string_constant

```
Unterminated string constant
```

### void_element_invalid_content

```
Expand Down
8 changes: 4 additions & 4 deletions packages/svelte/messages/compile-errors/template.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,6 @@

> Expected whitespace
## unterminated_string_constant

> Unterminated string constant
## illegal_element_attribute

> `<%name%>` does not support non-event attributes or spread attributes
Expand Down Expand Up @@ -414,6 +410,10 @@ See https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-ele

> '%word%' is a reserved word in JavaScript and cannot be used here
## unterminated_string_constant

> Unterminated string constant
## void_element_invalid_content

> Void elements cannot have children or closing tags
2 changes: 1 addition & 1 deletion packages/svelte/src/compiler/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -1553,4 +1553,4 @@ export function unexpected_reserved_word(node, word) {
*/
export function void_element_invalid_content(node) {
e(node, "void_element_invalid_content", "Void elements cannot have children or closing tags");
}
}
10 changes: 7 additions & 3 deletions packages/svelte/src/compiler/phases/1-parse/read/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ function read_expression_length(parser, start) {
} else if (is_bracket_close(code)) {
const popped = /** @type {number} */ (bracket_stack.pop());
if (!is_bracket_pair(popped, code)) {
e.expected_token(i, String.fromCharCode(/** @type {number} */(get_bracket_close(popped))));
e.expected_token(
i,
String.fromCharCode(/** @type {number} */ (get_bracket_close(popped)))
);
}
if (bracket_stack.length === 0) {
i += code <= 0xffff ? 1 : 2;
Expand Down Expand Up @@ -145,10 +148,11 @@ function read_string_length(parser, start, quote) {
if (
i < parser.template.length - 1 &&
is_back_quote(quote) &&
code === DOLAR && full_char_code_at(parser.template, i + 1) === LEFT_BRACKET
code === DOLAR &&
full_char_code_at(parser.template, i + 1) === LEFT_BRACKET
) {
i++;
i = read_expression_length(parser, i)
i = read_expression_length(parser, i);
} else {
i += code <= 0xffff ? 1 : 2;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte/src/compiler/phases/1-parse/utils/quote.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const SINGLE_QUOTE = '\''.charCodeAt(0);
const SINGLE_QUOTE = "'".charCodeAt(0);
const DOUBLE_QUOTE = '"'.charCodeAt(0);
const BACK_QUOTE = '`'.charCodeAt(0);

Expand Down

0 comments on commit 1961940

Please sign in to comment.