mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Formatting 🌿
This commit is contained in:
parent
d986bc4b0a
commit
56acc9982c
@ -81,7 +81,7 @@ impl Parser<'_> {
|
|||||||
} else {
|
} else {
|
||||||
SyntaxNode::Spacing
|
SyntaxNode::Spacing
|
||||||
})
|
})
|
||||||
},
|
}
|
||||||
|
|
||||||
Token::LineComment(_) | Token::BlockComment(_) => {
|
Token::LineComment(_) | Token::BlockComment(_) => {
|
||||||
self.at_block_or_line_start = was_at_block_or_line_start;
|
self.at_block_or_line_start = was_at_block_or_line_start;
|
||||||
@ -182,9 +182,7 @@ impl Parser<'_> {
|
|||||||
self.skip_white();
|
self.skip_white();
|
||||||
|
|
||||||
let mut tree = SyntaxTree::new();
|
let mut tree = SyntaxTree::new();
|
||||||
while !self.eof()
|
while !self.eof() && !matches!(self.peekv(), Some(Token::Space(n)) if n >= 1) {
|
||||||
&& !matches!(self.peekv(), Some(Token::Space(n)) if n >= 1)
|
|
||||||
{
|
|
||||||
if let Some(node) = self.parse_node() {
|
if let Some(node) = self.parse_node() {
|
||||||
tree.push(node);
|
tree.push(node);
|
||||||
}
|
}
|
||||||
|
@ -269,7 +269,7 @@ impl<'s> Iterator for Tokens<'s> {
|
|||||||
'`' if self.mode == Body => self.read_raw_or_code(),
|
'`' if self.mode == Body => self.read_raw_or_code(),
|
||||||
|
|
||||||
// Sections.
|
// Sections.
|
||||||
'#' if self.mode == Body => Hashtag,
|
'#' if self.mode == Body => Hashtag,
|
||||||
|
|
||||||
// Non-breaking spaces.
|
// Non-breaking spaces.
|
||||||
'~' if self.mode == Body => Text("\u{00A0}"),
|
'~' if self.mode == Body => Text("\u{00A0}"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user