File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1160,6 +1160,8 @@ class Preprocessor {
1160
1160
// / invoked (at which point the last position is popped).
1161
1161
std::vector<CachedTokensTy::size_type> BacktrackPositions;
1162
1162
1163
+ // / Stack of cached tokens/initial number of cached tokens pairs, allowing
1164
+ // / nested unannotated backtracks.
1163
1165
std::vector<std::pair<CachedTokensTy, CachedTokensTy::size_type>>
1164
1166
UnannotatedBacktrackTokens;
1165
1167
@@ -1725,6 +1727,8 @@ class Preprocessor {
1725
1727
// / at some point after EnableBacktrackAtThisPos. If you don't, caching of
1726
1728
// / tokens will continue indefinitely.
1727
1729
// /
1730
+ // / \param Unannotated Whether token annotations are reverted upon calling
1731
+ // / Backtrack().
1728
1732
void EnableBacktrackAtThisPos (bool Unannotated = false );
1729
1733
1730
1734
private:
@@ -1744,6 +1748,8 @@ class Preprocessor {
1744
1748
// / caching of tokens is on.
1745
1749
bool isBacktrackEnabled () const { return !BacktrackPositions.empty (); }
1746
1750
1751
+ // / True if EnableBacktrackAtThisPos() was called and
1752
+ // / caching of unannotated tokens is on.
1747
1753
bool isUnannotatedBacktrackEnabled () const {
1748
1754
return !UnannotatedBacktrackTokens.empty ();
1749
1755
}
Original file line number Diff line number Diff line change @@ -1025,6 +1025,8 @@ class Parser : public CodeCompletionHandler {
1025
1025
// / ....
1026
1026
// / TPA.Revert();
1027
1027
// /
1028
+ // / If the Unannotated parameter is true, any token annotations created
1029
+ // / during the tentative parse are reverted.
1028
1030
class TentativeParsingAction {
1029
1031
Parser &P;
1030
1032
PreferredTypeBuilder PrevPreferredType;
You can’t perform that action at this time.
0 commit comments