MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / get_indent

Function get_indent

utils/dasFormatter/helpers.cpp:152–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150 }
151
152 size_t get_indent(Pos loc, size_t tab_size) {
153 auto start = loc;
154 start.column = 0;
155 auto substr = get_substring(start, loc);
156 size_t result = 0;
157 for (auto c: substr) {
158 if (c == ' ') {
159 result += 1;
160 } else if (c == '\t') {
161 result += tab_size;
162 } else {
163 break;
164 }
165 }
166 return result;
167 }
168
169 void handle_brace(Pos prev_loc, uint32_t value, const string &internal, size_t tab_size, Pos end_loc) {
170 const auto &line = format::get_line(prev_loc.line);

Callers 1

skip_spaces_or_printFunction · 0.85

Calls 1

get_substringFunction · 0.85

Tested by

no test coverage detected