| 243 | } |
| 244 | |
| 245 | bool FormatVisitor::fastTestColumnLimit(tree::ParseTree* node) { |
| 246 | int columns = cur_columns(); |
| 247 | for (int i = firstNodeIndex(node), n = lastNodeIndex(node); i <= n; i++) { |
| 248 | if (tokens_[i]->getType() == LuaLexer::COMMENT || tokens_[i]->getType() == LuaLexer::LINE_COMMENT || |
| 249 | tokens_[i]->getType() == LuaLexer::WS) { |
| 250 | continue; |
| 251 | } |
| 252 | columns += tokens_[i]->getText().size(); |
| 253 | if (columns > config_.get<int>("column_limit")) { |
| 254 | return true; |
| 255 | } |
| 256 | } |
| 257 | return false; |
| 258 | } |
| 259 | |
| 260 | SourceWriter& FormatVisitor::cur_writer() { return *writers_.back(); } |
| 261 |
nothing calls this directly
no test coverage detected