summaryrefslogtreecommitdiffstats
path: root/tools/designer/editor/yyindent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/designer/editor/yyindent.cpp')
-rw-r--r--tools/designer/editor/yyindent.cpp76
1 files changed, 38 insertions, 38 deletions
diff --git a/tools/designer/editor/yyindent.cpp b/tools/designer/editor/yyindent.cpp
index d8498dc3a..d7228c0b6 100644
--- a/tools/designer/editor/yyindent.cpp
+++ b/tools/designer/editor/yyindent.cpp
@@ -137,8 +137,8 @@ static TQChar firstNonWhiteSpace( const TQString& t )
}
/*
- Returns TRUE if string t is made only of white space; otherwise
- returns FALSE.
+ Returns true if string t is made only of white space; otherwise
+ returns false.
*/
static bool isOnlyWhiteSpace( const TQString& t )
{
@@ -272,8 +272,8 @@ static inline TQChar lastParen( const TQString& t )
}
/*
- Returns TRUE if typedIn the same as okayCh or is null; otherwise
- returns FALSE.
+ Returns true if typedIn the same as okayCh or is null; otherwise
+ returns false.
*/
static inline bool okay( TQChar typedIn, TQChar okayCh )
{
@@ -331,7 +331,7 @@ static bool readLine()
do {
if ( yyLinizerState->iter == yyProgram->begin() ) {
yyLinizerState->line = TQString::null;
- return FALSE;
+ return false;
}
--yyLinizerState->iter;
@@ -345,7 +345,7 @@ static bool readLine()
of that and eventually yyLine will contain a slash-aster.
Notice that both if's can be executed, since
- yyLinizerState->inCComment is potentially set to FALSE in
+ yyLinizerState->inCComment is potentially set to false in
the first if. The order of the if's is also important.
*/
@@ -357,7 +357,7 @@ static bool readLine()
yyLinizerState->line = TQString::null;
} else {
yyLinizerState->line.truncate( k );
- yyLinizerState->inCComment = FALSE;
+ yyLinizerState->inCComment = false;
}
}
@@ -368,7 +368,7 @@ static bool readLine()
if ( k != -1 ) {
for ( int i = 0; i < k + 2; i++ )
eraseChar( yyLinizerState->line, i, ' ' );
- yyLinizerState->inCComment = TRUE;
+ yyLinizerState->inCComment = true;
}
}
@@ -421,7 +421,7 @@ static bool readLine()
yyLinizerState->braceDepth--;
} while ( yyLinizerState->line.isEmpty() );
- return TRUE;
+ return true;
}
/*
@@ -431,8 +431,8 @@ static bool readLine()
static void startLinizer()
{
yyLinizerState->braceDepth = 0;
- yyLinizerState->inCComment = FALSE;
- yyLinizerState->pendingRightBrace = FALSE;
+ yyLinizerState->inCComment = false;
+ yyLinizerState->pendingRightBrace = false;
yyLine = &yyLinizerState->line;
yyBraceDepth = &yyLinizerState->braceDepth;
@@ -445,9 +445,9 @@ static void startLinizer()
}
/*
- Returns TRUE if the start of the bottom line of yyProgram (and
+ Returns true if the start of the bottom line of yyProgram (and
potentially the whole line) is part of a C-style comment; otherwise
- returns FALSE.
+ returns false.
*/
static bool bottomLineStartsInCComment()
{
@@ -463,20 +463,20 @@ static bool bottomLineStartsInCComment()
for ( int i = 0; i < BigRoof; i++ ) {
if ( p == yyProgram->begin() )
- return FALSE;
+ return false;
--p;
if ( (*p).find(slashAster) != -1 || (*p).find(asterSlash) != -1 ) {
TQString trimmed = trimmedCodeLine( *p );
if ( trimmed.find(slashAster) != -1 ) {
- return TRUE;
+ return true;
} else if ( trimmed.find(asterSlash) != -1 ) {
- return FALSE;
+ return false;
}
}
}
- return FALSE;
+ return false;
}
/*
@@ -515,15 +515,15 @@ static int indentWhenBottomLineStartsInCComment()
/*
A function called match...() modifies the linizer state. If it
- returns TRUE, yyLine is the top line of the matched construct;
+ returns true, yyLine is the top line of the matched construct;
otherwise, the linizer is left in an unknown state.
A function called is...() keeps the linizer state intact.
*/
/*
- Returns TRUE if the current line (and upwards) forms a braceless
- control statement; otherwise returns FALSE.
+ Returns true if the current line (and upwards) forms a braceless
+ control statement; otherwise returns false.
The first line of the following example is a "braceless control
statement":
@@ -536,10 +536,10 @@ static bool matchBracelessControlStatement()
int delimDepth = 0;
if ( yyLine->endsWith("else") )
- return TRUE;
+ return true;
if ( !yyLine->endsWith(")") )
- return FALSE;
+ return false;
for ( int i = 0; i < SmallRoof; i++ ) {
int j = yyLine->length();
@@ -564,7 +564,7 @@ static bool matchBracelessControlStatement()
"if ( x )" is not part of the statement
"y".
*/
- return TRUE;
+ return true;
}
}
if ( delimDepth == -1 ) {
@@ -579,7 +579,7 @@ static bool matchBracelessControlStatement()
if ( 1 +
2 )
*/
- return FALSE;
+ return false;
}
break;
case '{':
@@ -592,19 +592,19 @@ static bool matchBracelessControlStatement()
though.
*/
if ( ch != TQChar(';') || delimDepth == 0 )
- return FALSE;
+ return false;
}
}
if ( !readLine() )
break;
}
- return FALSE;
+ return false;
}
/*
- Returns TRUE if yyLine is an unfinished line; otherwise returns
- FALSE.
+ Returns true if yyLine is an unfinished line; otherwise returns
+ false.
In many places we'll use the terms "standalone line", "unfinished
line" and "continuation line". The meaning of these should be
@@ -618,12 +618,12 @@ static bool matchBracelessControlStatement()
*/
static bool isUnfinishedLine()
{
- bool unf = FALSE;
+ bool unf = false;
YY_SAVE();
if ( yyLine->isEmpty() )
- return FALSE;
+ return false;
TQChar lastCh = (*yyLine)[(int) yyLine->length() - 1];
if ( TQString("{};").find(lastCh) == -1 && !yyLine->endsWith("...") ) {
@@ -640,7 +640,7 @@ static bool isUnfinishedLine()
for ( int i = 1; i < 10;
*/
- unf = TRUE;
+ unf = true;
} else if ( readLine() && yyLine->endsWith(";") &&
lastParen(*yyLine) == TQChar('(') ) {
/*
@@ -649,7 +649,7 @@ static bool isUnfinishedLine()
for ( int i = 1;
i < 10;
*/
- unf = TRUE;
+ unf = true;
}
}
@@ -658,12 +658,12 @@ static bool isUnfinishedLine()
}
/*
- Returns TRUE if yyLine is a continuation line; otherwise returns
- FALSE.
+ Returns true if yyLine is a continuation line; otherwise returns
+ false.
*/
static bool isContinuationLine()
{
- bool cont = FALSE;
+ bool cont = false;
YY_SAVE();
if ( readLine() )
@@ -992,11 +992,11 @@ static int indentForStandaloneLine()
static void initializeIndenter()
{
literal = new TQRegExp( "([\"'])(?:\\\\.|[^\\\\])*\\1" );
- literal->setMinimal( TRUE );
+ literal->setMinimal( true );
label = new TQRegExp(
"^\\s*((?:case\\b([^:]|::)+|[a-zA-Z_0-9]+)(?:\\s+slots)?:)(?!:)" );
inlineCComment = new TQRegExp( "/\\*.*\\*/" );
- inlineCComment->setMinimal( TRUE );
+ inlineCComment->setMinimal( true );
braceX = new TQRegExp( "^\\s*\\}\\s*(?:else|catch)\\b" );
iflikeKeyword = new TQRegExp( "\\b(?:catch|do|for|if|while)\\b" );
@@ -1136,7 +1136,7 @@ int main( int argc, char **argv )
}
TQString code = fileContents( argv[1] );
- TQStringList program = TQStringList::split( '\n', code, TRUE );
+ TQStringList program = TQStringList::split( '\n', code, true );
TQStringList p;
TQString out;