diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-01 06:12:53 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-01 06:12:53 +0400 |
commit | 2365c64014b3e067bb212b2061f1d14c1f944090 (patch) | |
tree | ccf060ca327a060e524ec92bba3622d9a1139a64 /source/gameengine/Expressions | |
parent | 00143a3d557d87dda2bb7074dfe2b1a3acf5f28f (diff) |
whitespace bge edits
Diffstat (limited to 'source/gameengine/Expressions')
-rw-r--r-- | source/gameengine/Expressions/InputParser.cpp | 210 |
1 files changed, 105 insertions, 105 deletions
diff --git a/source/gameengine/Expressions/InputParser.cpp b/source/gameengine/Expressions/InputParser.cpp index 7957c82e7f9..27f4f0b10cb 100644 --- a/source/gameengine/Expressions/InputParser.cpp +++ b/source/gameengine/Expressions/InputParser.cpp @@ -192,89 +192,89 @@ void CParser::NextSym() switch(ch) { - case '(': - sym = lbracksym; NextCh(); - break; - case ')': - sym = rbracksym; NextCh(); - break; - case ',': - sym = commasym; NextCh(); - break; - case '%' : - sym = opsym; opkind = OPmodulus; NextCh(); - break; - case '+' : - sym = opsym; opkind = OPplus; NextCh(); - break; - case '-' : - sym = opsym; opkind = OPminus; NextCh(); - break; - case '*' : - sym = opsym; opkind = OPtimes; NextCh(); - break; - case '/' : - sym = opsym; opkind = OPdivide; NextCh(); - break; - case '&' : - sym = opsym; opkind = OPand; NextCh(); TermChar('&'); - break; - case '|' : - sym = opsym; opkind = OPor; NextCh(); TermChar('|'); - break; - case '=' : - sym = opsym; opkind = OPequal; NextCh(); TermChar('='); - break; - case '!' : - sym = opsym; - NextCh(); - if (ch == '=') - { - opkind = OPunequal; + case '(': + sym = lbracksym; NextCh(); + break; + case ')': + sym = rbracksym; NextCh(); + break; + case ',': + sym = commasym; NextCh(); + break; + case '%' : + sym = opsym; opkind = OPmodulus; NextCh(); + break; + case '+' : + sym = opsym; opkind = OPplus; NextCh(); + break; + case '-' : + sym = opsym; opkind = OPminus; NextCh(); + break; + case '*' : + sym = opsym; opkind = OPtimes; NextCh(); + break; + case '/' : + sym = opsym; opkind = OPdivide; NextCh(); + break; + case '&' : + sym = opsym; opkind = OPand; NextCh(); TermChar('&'); + break; + case '|' : + sym = opsym; opkind = OPor; NextCh(); TermChar('|'); + break; + case '=' : + sym = opsym; opkind = OPequal; NextCh(); TermChar('='); + break; + case '!' : + sym = opsym; NextCh(); - } - else - { - opkind = OPnot; - } - break; - case '>': - sym = opsym; - NextCh(); - if (ch == '=') - { - opkind = OPgreaterequal; + if (ch == '=') + { + opkind = OPunequal; + NextCh(); + } + else + { + opkind = OPnot; + } + break; + case '>': + sym = opsym; NextCh(); - } - else - { - opkind = OPgreater; - } - break; - case '<': - sym = opsym; - NextCh(); - if (ch == '=') { - opkind = OPlessequal; + if (ch == '=') + { + opkind = OPgreaterequal; + NextCh(); + } + else + { + opkind = OPgreater; + } + break; + case '<': + sym = opsym; NextCh(); - } else { - opkind = OPless; - } - break; - case '\"' : { - int start; - sym = constsym; - constkind = stringtype; - NextCh(); - start = chcount; - while ((ch != '\"') && (ch != 0x0)) + if (ch == '=') { + opkind = OPlessequal; + NextCh(); + } else { + opkind = OPless; + } + break; + case '\"' : { + int start; + sym = constsym; + constkind = stringtype; NextCh(); - GrabRealString(start); - TermChar('\"'); // check for eol before '\"' - break; - } - case 0x0: sym = eolsym; break; - default: + start = chcount; + while ((ch != '\"') && (ch != 0x0)) + NextCh(); + GrabRealString(start); + TermChar('\"'); // check for eol before '\"' + break; + } + case 0x0: sym = eolsym; break; + default: { int start; start = chcount; @@ -301,7 +301,7 @@ void CParser::NextSym() } GrabString(start); } else if (((ch >= 'a') && (ch <= 'z')) - || ((ch >= 'A') && (ch <= 'Z'))) + || ((ch >= 'A') && (ch <= 'Z'))) { // reserved word? start = chcount; @@ -358,18 +358,18 @@ STR_String CParser::Symbol2Str(int s) { // returns a string representation of of symbol s, // for use in Term when generating an error switch(s) { - case errorsym: return "error"; - case lbracksym: return "("; - case rbracksym: return ")"; - case commasym: return ","; - case opsym: return "operator"; - case constsym: return "constant"; - case sumsym: return "SUM"; - case ifsym: return "IF"; - case whocodedsym: return "WHOMADE"; - case eolsym: return "end of line"; - case idsym: return "identifier"; - default: return "unknown"; // should not happen + case errorsym: return "error"; + case lbracksym: return "("; + case rbracksym: return ")"; + case commasym: return ","; + case opsym: return "operator"; + case constsym: return "constant"; + case sumsym: return "SUM"; + case ifsym: return "IF"; + case whocodedsym: return "WHOMADE"; + case eolsym: return "end of line"; + case idsym: return "identifier"; + default: return "unknown"; // should not happen } } @@ -391,19 +391,19 @@ int CParser::Priority(int optorkind) { // returns the priority of an operator // higher number means higher priority switch(optorkind) { - case OPor: return 1; - case OPand: return 2; - case OPgreater: - case OPless: - case OPgreaterequal: - case OPlessequal: - case OPequal: - case OPunequal: return 3; - case OPplus: - case OPminus: return 4; - case OPmodulus: - case OPtimes: - case OPdivide: return 5; + case OPor: return 1; + case OPand: return 2; + case OPgreater: + case OPless: + case OPgreaterequal: + case OPlessequal: + case OPequal: + case OPunequal: return 3; + case OPplus: + case OPminus: return 4; + case OPmodulus: + case OPtimes: + case OPdivide: return 5; } MT_assert(false); return 0; // should not happen |