| 5116 | #endif |
| 5117 | |
| 5118 | asCString asCBuilder::GetCleanExpressionString(asCScriptNode *node, asCScriptCode *file) |
| 5119 | { |
| 5120 | asASSERT(node && node->nodeType == snExpression); |
| 5121 | |
| 5122 | asCString str; |
| 5123 | str.Assign(file->code + node->tokenPos, node->tokenLength); |
| 5124 | |
| 5125 | asCString cleanStr; |
| 5126 | for( asUINT n = 0; n < str.GetLength(); ) |
| 5127 | { |
| 5128 | asUINT len = 0; |
| 5129 | asETokenClass tok = engine->ParseToken(str.AddressOf() + n, str.GetLength() - n, &len); |
| 5130 | |
| 5131 | // Replace comments and whitespace with a single space |
| 5132 | if (tok == asTC_COMMENT || tok == asTC_WHITESPACE) |
| 5133 | { |
| 5134 | if (cleanStr.GetLength() && cleanStr[cleanStr.GetLength() - 1] != ' ') |
| 5135 | cleanStr += " "; |
| 5136 | } |
| 5137 | else |
| 5138 | cleanStr.Concatenate(str.AddressOf() + n, len); |
| 5139 | |
| 5140 | n += len; |
| 5141 | } |
| 5142 | |
| 5143 | return cleanStr; |
| 5144 | } |
| 5145 | |
| 5146 | #ifndef AS_NO_COMPILER |
| 5147 | int asCBuilder::RegisterScriptFunctionFromNode(asCScriptNode *node, asCScriptCode *file, asCObjectType *objType, bool isInterface, bool isGlobalFunction, asSNameSpace *ns, bool isExistingShared, bool isMixin, sClassDeclaration* decl) |
nothing calls this directly
no test coverage detected