cc in [ \t\f]
| 123 | |
| 124 | // cc in [ \t\f] |
| 125 | static int process_ws(int cc) |
| 126 | { |
| 127 | // Collect white-space and compute possible indentation: |
| 128 | unsigned indent = 0; |
| 129 | do { |
| 130 | if (cc != '\f') // \f not considered part of indentation |
| 131 | indent += cc == '\t' ? 8 - (indent & 0x07) : 1; |
| 132 | cc = get(); |
| 133 | } while (strchr(" \t\f", cc)); |
| 134 | |
| 135 | // Test whether indentation is significant: |
| 136 | if (prev_was_newline && !brackets_opened && !strchr("\n#\r", cc)) |
| 137 | process_newline(indent); |
| 138 | |
| 139 | return cc; |
| 140 | } |
| 141 | |
| 142 | /* Assume input is UTF-8 encoded Unicode code points. |
| 143 | Will read 1 code point and return that as int. |
no test coverage detected