MCPcopy Index your code
hub / github.com/IBM/Project_CodeNet / process_ws

Function process_ws

tools/tokenizer/pytokenize.c:125–140  ·  view source on GitHub ↗

cc in [ \t\f]

Source from the content-addressed store, hash-verified

123
124// cc in [ \t\f]
125static 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.

Callers 1

tokenizeFunction · 0.85

Calls 2

process_newlineFunction · 0.85
getFunction · 0.70

Tested by

no test coverage detected