Add MetaProcessor::awaitingMoreInput()
`MetaProcessor::awaitingMoreInput()` returns whether the collected input is incomplete, either because it contains unbalanced braces or we found a backslash-newline (the last seen token is a `\`). Part of a patch series to fix ROOT-5219. Co-authored-by: Axel Naumann <Axel.Naumann@cern.ch>
This commit is contained in:
parent
71cbd0a80e
commit
9ea7dd97e3
@ -123,6 +123,11 @@ namespace cling {
|
||||
/// input, resetting the continuation to a new line.
|
||||
void cancelContinuation() const;
|
||||
|
||||
///\brief Returns whether we are waiting for more input, either because the
|
||||
/// input contains imbalanced braces or a backslash-newline was seen (i.e.,
|
||||
/// the last token was a `\`).
|
||||
bool awaitingMoreInput() const;
|
||||
|
||||
///\brief Returns the number of imbalanced tokens seen in the current input.
|
||||
///
|
||||
int getExpectedIndent() const;
|
||||
|
@ -348,6 +348,11 @@ namespace cling {
|
||||
m_InputValidator->reset();
|
||||
}
|
||||
|
||||
bool MetaProcessor::awaitingMoreInput() const {
|
||||
return m_InputValidator->getLastResult() ==
|
||||
InputValidator::ValidationResult::kIncomplete;
|
||||
}
|
||||
|
||||
int MetaProcessor::getExpectedIndent() const {
|
||||
return m_InputValidator->getExpectedIndent();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user