1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-07 04:10:08 +00:00

Minor clean-ups.

This commit is contained in:
Julian Storer 2010-04-15 11:09:20 +01:00
parent e6237b5154
commit c76e500574
32 changed files with 329 additions and 357 deletions

View file

@ -43,13 +43,13 @@ CPlusPlusCodeTokeniser::~CPlusPlusCodeTokeniser()
namespace CppTokeniser
{
static bool isIdentifierStart (const tchar c) throw()
static bool isIdentifierStart (const juce_wchar c) throw()
{
return CharacterFunctions::isLetter (c)
|| c == '_' || c == '@';
}
static bool isIdentifierBody (const tchar c) throw()
static bool isIdentifierBody (const juce_wchar c) throw()
{
return CharacterFunctions::isLetter (c)
|| CharacterFunctions::isDigit (c)
@ -58,26 +58,26 @@ static bool isIdentifierBody (const tchar c) throw()
static int parseIdentifier (CodeDocument::Iterator& source) throw()
{
static const tchar* keywords2Char[] =
static const juce_wchar* keywords2Char[] =
{ T("if"), T("do"), T("or"), 0 };
static const tchar* keywords3Char[] =
static const juce_wchar* keywords3Char[] =
{ T("for"), T("int"), T("new"), T("try"), T("xor"), T("and"), T("asm"), T("not"), 0 };
static const tchar* keywords4Char[] =
static const juce_wchar* keywords4Char[] =
{ T("bool"), T("void"), T("this"), T("true"), T("long"), T("else"), T("char"),
T("enum"), T("case"), T("goto"), T("auto"), 0 };
static const tchar* keywords5Char[] =
static const juce_wchar* keywords5Char[] =
{ T("while"), T("bitor"), T("break"), T("catch"), T("class"), T("compl"), T("const"), T("false"),
T("float"), T("short"), T("throw"), T("union"), T("using"), T("or_eq"), 0 };
static const tchar* keywords6Char[] =
static const juce_wchar* keywords6Char[] =
{ T("return"), T("struct"), T("and_eq"), T("bitand"), T("delete"), T("double"), T("extern"),
T("friend"), T("inline"), T("not_eq"), T("public"), T("sizeof"), T("static"), T("signed"),
T("switch"), T("typeid"), T("wchar_t"), T("xor_eq"), 0};
static const tchar* keywordsOther[] =
static const juce_wchar* keywordsOther[] =
{ T("const_cast"), T("continue"), T("default"), T("explicit"), T("mutable"), T("namespace"),
T("operator"), T("private"), T("protected"), T("register"), T("reinterpret_cast"), T("static_cast"),
T("template"), T("typedef"), T("typename"), T("unsigned"), T("virtual"), T("volatile"),
@ -85,11 +85,11 @@ static int parseIdentifier (CodeDocument::Iterator& source) throw()
T("@private"), T("@property"), T("@protected"), T("@class"), 0 };
int tokenLength = 0;
tchar possibleIdentifier [19];
juce_wchar possibleIdentifier [19];
while (isIdentifierBody (source.peekNextChar()))
{
const tchar c = source.nextChar();
const juce_wchar c = source.nextChar();
if (tokenLength < numElementsInArray (possibleIdentifier) - 1)
possibleIdentifier [tokenLength] = c;
@ -100,7 +100,7 @@ static int parseIdentifier (CodeDocument::Iterator& source) throw()
if (tokenLength > 1 && tokenLength <= 16)
{
possibleIdentifier [tokenLength] = 0;
const tchar** k;
const juce_wchar** k;
switch (tokenLength)
{
@ -329,7 +329,7 @@ int CPlusPlusCodeTokeniser::readNextToken (CodeDocument::Iterator& source)
int result = tokenType_error;
source.skipWhitespace();
tchar firstChar = source.peekNextChar();
juce_wchar firstChar = source.peekNextChar();
switch (firstChar)
{

View file

@ -34,7 +34,7 @@ BEGIN_JUCE_NAMESPACE
class CodeDocumentLine
{
public:
CodeDocumentLine (const tchar* const line_,
CodeDocumentLine (const juce_wchar* const line_,
const int lineLength_,
const int numNewLineChars,
const int lineStartInFile_)
@ -404,7 +404,7 @@ const CodeDocument::Position CodeDocument::Position::movedByLines (const int del
return p;
}
const tchar CodeDocument::Position::getCharacter() const throw()
const juce_wchar CodeDocument::Position::getCharacter() const throw()
{
const CodeDocumentLine* const l = owner->lines [line];
return l == 0 ? 0 : l->line [getIndexInLine()];
@ -603,7 +603,7 @@ bool CodeDocument::hasChangedSinceSavePoint() const throw()
}
//==============================================================================
static int getCodeCharacterCategory (const tchar character) throw()
static int getCodeCharacterCategory (const juce_wchar character) throw()
{
return (CharacterFunctions::isLetterOrDigit (character) || character == '_')
? 2 : (CharacterFunctions::isWhitespace (character) ? 0 : 1);
@ -656,7 +656,7 @@ const CodeDocument::Position CodeDocument::findWordBreakBefore (const Position&
while (i < maxDistance)
{
const tchar c = p.movedBy (-1).getCharacter();
const juce_wchar c = p.movedBy (-1).getCharacter();
if (c == '\r' || c == '\n')
{

View file

@ -175,7 +175,7 @@ public:
/** Returns the character in the document at this position.
@see getLineText
*/
const tchar getCharacter() const throw();
const juce_wchar getCharacter() const throw();
/** Returns the line from the document that this position is within.
@see getCharacter, getLineNumber