Skip to content

Commit

Permalink
[Fix/hphpd] remove the trailing ';' for '=' command
Browse files Browse the repository at this point in the history
Summary:
In a recent change, () were added to wrap the expression for '=', which
made ';' in the expression a syntax error. We were thinking on a general
fix but it seems hard to do without calling php parser for the command
line. This diff fixes one common benign case with traling ';', which used
to work before the () were added.

Test Plan:
make fast_tests
tried with hphpd on command line
hphpd> =123;
123

Reviewers: mwilliams, myang

Reviewed By: myang

CC: ps, mwilliams, myang, qigao

Differential Revision: 351726

Task ID: 747161
  • Loading branch information
qigao authored and macvicar committed Nov 29, 2011
1 parent a83873f commit 87d42ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/runtime/eval/debugger/debugger_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1580,6 +1580,10 @@ bool DebuggerClient::processTakeCode() {
m_code = string("<?php ") + (m_line.c_str() + 1) + ";";
return processEval();
} else if (first == '=') {
while (m_line.at(m_line.size() - 1) == ';') {
// strip the trailing ;
m_line = m_line.substr(0, m_line.size() - 1);
}
m_code = string("<?php $_=(") + m_line.substr(1) + "); " + m_printFunction;
return processEval();
} else if (first != '<') {
Expand Down

0 comments on commit 87d42ed

Please sign in to comment.