diff options
author | dim <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
commit | 3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65 (patch) | |
tree | dbbd4047878da71c1a706e26ce05b4e7791b14cc /lib/Format/UnwrappedLineParser.h | |
parent | 38d6f2e7f2ce51a5b3836d26596c6c34a3288752 (diff) | |
download | FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.zip FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.tar.gz |
Vendor import of clang trunk r238337:
https://llvm.org/svn/llvm-project/cfe/trunk@238337
Diffstat (limited to 'lib/Format/UnwrappedLineParser.h')
-rw-r--r-- | lib/Format/UnwrappedLineParser.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/Format/UnwrappedLineParser.h b/lib/Format/UnwrappedLineParser.h index 3218afe..6a6e56f 100644 --- a/lib/Format/UnwrappedLineParser.h +++ b/lib/Format/UnwrappedLineParser.h @@ -65,8 +65,7 @@ public: ArrayRef<FormatToken *> Tokens, UnwrappedLineConsumer &Callback); - /// Returns true in case of a structural error. - bool parse(); + void parse(); private: void reset(); @@ -95,6 +94,7 @@ private: void parseCaseLabel(); void parseSwitch(); void parseNamespace(); + void parseNew(); void parseAccessSpecifier(); void parseEnum(); void parseJavaEnumBody(); @@ -103,16 +103,22 @@ private: void parseObjCUntilAtEnd(); void parseObjCInterfaceOrImplementation(); void parseObjCProtocol(); + void parseJavaScriptEs6ImportExport(); bool tryToParseLambda(); bool tryToParseLambdaIntroducer(); void tryToParseJSFunction(); + /// \brief Parses tokens until encountering the CloseKind token, but balances + /// tokens when encountering more OpenKind tokens. Useful for e.g. parsing a + /// curly brace delimited block that can contain nested blocks. + /// The parser must be positioned on a token of OpenKind. + void parseBalanced(tok::TokenKind OpenKind, tok::TokenKind CloseKind); void addUnwrappedLine(); bool eof() const; void nextToken(); void readToken(); void flushComments(bool NewlineBeforeNext); void pushToken(FormatToken *Tok); - void calculateBraceTypes(); + void calculateBraceTypes(bool ExpectClassBody = false); // Marks a conditional compilation edge (for example, an '#if', '#ifdef', // '#else' or merge conflict marker). If 'Unreachable' is true, assumes @@ -156,10 +162,6 @@ private: // whether we are in a compound statement or not. std::vector<bool> DeclarationScopeStack; - // Will be true if we encounter an error that leads to possibily incorrect - // indentation levels. - bool StructuralError; - const FormatStyle &Style; const AdditionalKeywords &Keywords; |