MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / skipComment

Method skipComment

src/ifcparse/IfcParse.cpp:128–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128size_t IfcSpfLexer::skipComment() const {
129 if (stream->eof()) {
130 return 0;
131 }
132 char character = stream->peek();
133 if (character != '/') {
134 return 0;
135 }
136 stream->increment();
137 character = stream->peek();
138 if (character != '*') {
139 stream->seek(stream->tell() - 1);
140 return 0;
141 }
142 size_t index = 2;
143 char intermediate = 0;
144 while (!stream->eof()) {
145 character = stream->peek();
146 stream->increment();
147 ++index;
148 if (character == '/' && intermediate == '*') {
149 break;
150 }
151 intermediate = character;
152 }
153 return index;
154}
155
156//
157// Returns the offset of the current Token and moves cursor to next

Callers

nothing calls this directly

Calls 5

eofMethod · 0.80
peekMethod · 0.80
incrementMethod · 0.80
seekMethod · 0.80
tellMethod · 0.80

Tested by

no test coverage detected