MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / submitLine

Method submitLine

src/attributes.cpp:1817–1839  ·  view source on GitHub ↗

Track /* */ comment state

Source from the content-addressed store, hash-verified

1815
1816 // Track /* */ comment state
1817 void CommentState::submitLine(const std::string& line) {
1818 std::size_t pos = 0;
1819 while (pos != std::string::npos) {
1820
1821 // check for a // which would invalidate any other token found
1822 std::size_t lineCommentPos = line.find("//", pos);
1823
1824 // look for the next token
1825 std::string token = inComment() ? "*/" : "/*";
1826 pos = line.find(token, pos);
1827
1828 // process the comment token if found
1829 if (pos != std::string::npos) {
1830
1831 // break if the line comment precedes the comment token
1832 if (lineCommentPos != std::string::npos && lineCommentPos < pos)
1833 break; // #nocov
1834
1835 inComment_ = !inComment_;
1836 pos += token.size();
1837 }
1838 }
1839 }
1840
1841} // namespace attributes
1842} // namespace Rcpp

Callers 3

parseSourceDependenciesFunction · 0.80
parseEmbeddedRFunction · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected