-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement backtick syntax for defining commands #8
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good! I've left couple of notes and questions inline
@@ -43,7 +43,7 @@ pub enum TokenKind { | |||
ReturnKeyword, | |||
|
|||
// Non-zoglin | |||
CommandBegin, | |||
CommandBegin(bool), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to store this bool
in the token? It doesn't seem like it's used anywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used in tokenise
to determine whether the command literal uses a backtick or is just a keyword command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It probably can and should be refactored, but that was the easiest implementation without changing how commands were set to be lexed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Related: #7
Implements backtick syntax, replacing the forward slash syntax.
With this syntax multi-line commands are possible, and the lexer removes excess whitespace
when not within a string inside the command.
This is the first step towards having a command literal, but right now it still requires a newline first.