summaryrefslogtreecommitdiffstats
path: root/Source/cmExprParserHelper.cxx
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2016-05-16 14:34:04 (GMT)
committerBrad King <brad.king@kitware.com>2016-05-16 20:05:19 (GMT)
commitd9fd2f5402eeaa345691313658e02b51038f570b (patch)
treedca71b9a7e267f4c6300da3eb770415381726785 /Source/cmExprParserHelper.cxx
parent82df6deaafb36cbbfd450202bb20b320f637751a (diff)
downloadCMake-d9fd2f5402eeaa345691313658e02b51038f570b.zip
CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.gz
CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.bz2
Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
Diffstat (limited to 'Source/cmExprParserHelper.cxx')
-rw-r--r--Source/cmExprParserHelper.cxx61
1 files changed, 25 insertions, 36 deletions
diff --git a/Source/cmExprParserHelper.cxx b/Source/cmExprParserHelper.cxx
index c5ecde4..2ba9b8d 100644
--- a/Source/cmExprParserHelper.cxx
+++ b/Source/cmExprParserHelper.cxx
@@ -16,7 +16,7 @@
#include "cmExprLexer.h"
-int cmExpr_yyparse( yyscan_t yyscanner );
+int cmExpr_yyparse(yyscan_t yyscanner);
//
cmExprParserHelper::cmExprParserHelper()
{
@@ -24,7 +24,6 @@ cmExprParserHelper::cmExprParserHelper()
this->FileName = 0;
}
-
cmExprParserHelper::~cmExprParserHelper()
{
this->CleanupParser();
@@ -32,11 +31,10 @@ cmExprParserHelper::~cmExprParserHelper()
int cmExprParserHelper::ParseString(const char* str, int verb)
{
- if ( !str)
- {
+ if (!str) {
return 0;
- }
- //printf("Do some parsing: %s\n", str);
+ }
+ // printf("Do some parsing: %s\n", str);
this->Verbose = verb;
this->InputBuffer = str;
@@ -50,20 +48,18 @@ int cmExprParserHelper::ParseString(const char* str, int verb)
cmExpr_yyset_extra(this, yyscanner);
int res = cmExpr_yyparse(yyscanner);
cmExpr_yylex_destroy(yyscanner);
- if ( res != 0 )
- {
- //str << "CAL_Parser returned: " << res << std::endl;
- //std::cerr << "When parsing: [" << str << "]" << std::endl;
+ if (res != 0) {
+ // str << "CAL_Parser returned: " << res << std::endl;
+ // std::cerr << "When parsing: [" << str << "]" << std::endl;
return 0;
- }
+ }
this->CleanupParser();
- if ( Verbose )
- {
- std::cerr << "Expanding [" << str << "] produced: ["
- << this->Result << "]" << std::endl;
- }
+ if (Verbose) {
+ std::cerr << "Expanding [" << str << "] produced: [" << this->Result << "]"
+ << std::endl;
+ }
return 1;
}
@@ -73,27 +69,22 @@ void cmExprParserHelper::CleanupParser()
int cmExprParserHelper::LexInput(char* buf, int maxlen)
{
- //std::cout << "JPLexInput ";
- //std::cout.write(buf, maxlen);
- //std::cout << std::endl;
- if ( maxlen < 1 )
- {
+ // std::cout << "JPLexInput ";
+ // std::cout.write(buf, maxlen);
+ // std::cout << std::endl;
+ if (maxlen < 1) {
return 0;
+ }
+ if (this->InputBufferPos < this->InputBuffer.size()) {
+ buf[0] = this->InputBuffer[this->InputBufferPos++];
+ if (buf[0] == '\n') {
+ this->CurrentLine++;
}
- if ( this->InputBufferPos < this->InputBuffer.size() )
- {
- buf[0] = this->InputBuffer[ this->InputBufferPos++ ];
- if ( buf[0] == '\n' )
- {
- this->CurrentLine ++;
- }
- return(1);
- }
- else
- {
+ return (1);
+ } else {
buf[0] = '\n';
- return( 0 );
- }
+ return (0);
+ }
}
void cmExprParserHelper::Error(const char* str)
@@ -108,5 +99,3 @@ void cmExprParserHelper::SetResult(int value)
{
this->Result = value;
}
-
-