1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:58:11 +00:00

Shell: Clear expansions after committing a word in the POSIX parser

This commit is contained in:
Ali Mohammad Pur 2023-02-16 21:35:03 +03:30 committed by Ali Mohammad Pur
parent 2881bb4c3a
commit 6da438e992

View file

@ -533,6 +533,7 @@ Lexer::ReductionResult Lexer::reduce_start()
if (m_lexer.is_eof()) {
auto tokens = Token::maybe_from_state(m_state);
m_state.buffer.clear();
m_state.expansions.clear();
m_state.position.start_offset = m_state.position.end_offset;
m_state.position.start_line = m_state.position.end_line;
@ -615,6 +616,7 @@ Lexer::ReductionResult Lexer::reduce_start()
m_state.on_new_line = true;
m_state.buffer.clear();
m_state.expansions.clear();
m_state.position.start_offset = m_state.position.end_offset;
m_state.position.start_line = m_state.position.end_line;
@ -637,6 +639,7 @@ Lexer::ReductionResult Lexer::reduce_start()
auto tokens = Token::maybe_from_state(m_state);
m_state.buffer.clear();
m_state.buffer.append(consume());
m_state.expansions.clear();
m_state.position.start_offset = m_state.position.end_offset;
m_state.position.start_line = m_state.position.end_line;