diff options
Diffstat (limited to 'Shell/Parser.cpp')
-rw-r--r-- | Shell/Parser.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Shell/Parser.cpp b/Shell/Parser.cpp index e7be78647d..0c1d17eebb 100644 --- a/Shell/Parser.cpp +++ b/Shell/Parser.cpp @@ -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; |