@@ -726,6 +726,14 @@ void simplecpp::TokenList::lineDirective(unsigned int fileIndex_, unsigned int l
726726
727727static const std::string COMMENT_END (" */" );
728728
729+ /* *
730+ * Read a name or a number.
731+ * In a number, a ' digit separator is removed, so 1'000 gives "1000".
732+ * The stream is left after the last character of the token.
733+ * @param stream the stream to read from
734+ * @param ch the first character, already read from the stream
735+ * @return the name or number
736+ */
729737static simplecpp::TokenString readNameOrNumber (simplecpp::TokenList::Stream &stream, unsigned char ch)
730738{
731739 simplecpp::TokenString currentToken;
@@ -740,6 +748,19 @@ static simplecpp::TokenString readNameOrNumber(simplecpp::TokenList::Stream &str
740748 return currentToken;
741749}
742750
751+ /* *
752+ * Read a // comment, up to but not including the newline.
753+ * A backslash followed by a newline continues the comment on the next line.
754+ * The backslash, and any spaces or tabs after it, are then replaced by a
755+ * newline in the comment text.
756+ * @param stream the stream to read from
757+ * @param ch the first '/', already read from the stream
758+ * @param location the location of the comment, used for warnings
759+ * @param multiline incremented for each continued line
760+ * @param outputList if not null, a portability warning is added when there is
761+ * whitespace between the backslash and the newline
762+ * @return the comment text, including the leading //
763+ */
743764static simplecpp::TokenString readLineComment (simplecpp::TokenList::Stream &stream, unsigned char ch, const simplecpp::Location &location, unsigned int &multiline, simplecpp::OutputList *outputList)
744765{
745766 simplecpp::TokenString currentToken;
0 commit comments