Skip to content

Commit

Permalink
change the line break character to ;
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Jun 28, 2024
1 parent 1459c35 commit e7120f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/lex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ pub enum AsciiToken {
Underscore,
Bar,
Semicolon,
DoubleSemicolon,
Star,
Percent,
Caret,
Expand Down Expand Up @@ -650,6 +651,7 @@ impl fmt::Display for AsciiToken {
AsciiToken::Underscore => write!(f, "_"),
AsciiToken::Bar => write!(f, "|"),
AsciiToken::Semicolon => write!(f, ";"),
AsciiToken::DoubleSemicolon => write!(f, ";;"),
AsciiToken::Star => write!(f, "*"),
AsciiToken::Percent => write!(f, "%"),
AsciiToken::Caret => write!(f, "^"),
Expand Down Expand Up @@ -798,6 +800,7 @@ impl<'a> Lexer<'a> {
"⟩" => self.end(CloseAngle, start),
"_" if self.peek_char() != Some("_") => self.end(Underscore, start),
"|" => self.end(Bar, start),
";" if self.next_char_exact(";") => self.end(DoubleSemicolon, start),
";" => self.end(Semicolon, start),
"-" if self.next_chars_exact(["-", "-"]) => self.end(TripleMinus, start),
"'" if self.next_char_exact("'") => {
Expand Down
4 changes: 2 additions & 2 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -967,9 +967,9 @@ impl<'i> Parser<'i> {
spaces
} else if let Some(word) = self.try_func() {
word
} else if let Some(span) = self.try_exact(Quote.into()) {
} else if let Some(span) = self.try_exact(Semicolon.into()) {
span.sp(Word::BreakLine)
} else if let Some(span) = self.try_exact(Quote2.into()) {
} else if let Some(span) = self.try_exact(DoubleSemicolon.into()) {
span.sp(Word::UnbreakLine)
} else if let Some(span) = self.try_exact(Semicolon.into()) {
span.sp(Word::SemicolonPop)
Expand Down
1 change: 0 additions & 1 deletion todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
- 0.12
- Use `'` for modules
- Deprecate swizzles
- Use `;` for line splitting
- Make branch for `but`/`with` stabilization and `,` deprecation
- Stabilize labels
- Goto definition/Ctrl+click on git imports to go to the URL
Expand Down

0 comments on commit e7120f0

Please sign in to comment.