mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
Shell: Parse comments
This commit is contained in:
committed by
Andreas Kling
parent
a862c230b1
commit
1d0d0e9d00
@@ -86,6 +86,19 @@ Vector<Command> Parser::parse()
|
||||
char ch = m_input.characters()[i];
|
||||
switch (state()) {
|
||||
case State::Free:
|
||||
if (ch == '#') {
|
||||
commit_token(Token::Bare);
|
||||
|
||||
while (i < m_input.length()) {
|
||||
ch = m_input.characters()[++i];
|
||||
++m_position;
|
||||
if (ch == '\n')
|
||||
break;
|
||||
m_token.append(ch);
|
||||
}
|
||||
commit_token(Token::Comment);
|
||||
break;
|
||||
}
|
||||
if (ch == ' ') {
|
||||
commit_token(Token::Bare);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user