summaryrefslogtreecommitdiff
path: root/tests/063-comments.c
AgeCommit message (Collapse)Author
2010-06-02Fix multi-line comment regular expression to handle (non) nested comments.Carl Worth
Ken reminded me of a couple cases that I should be testing. These are the non-nestedness of things that look like nested comments as well as potentially tricky things like "/*/" and "/*/*/". The (non) nested comment case was not working in the case of the comment terminator with multiple '*' characters. We fix this by not considering a '*' as the "non-slash" to terminate a sequence of '*' characters within the comment. We also fix the final match of the terminator to use '+' rather than '*' to require the presence of a final '*' character in the comment terminator.
2010-06-01Implement comment handling in the lexer (with test).Carl Worth
We support both single-line (//) and multi-line (/* ... */) comments and add a test for this, (trying to stress the rules just a bit by embedding one comment delimiter into a comment delimited with the other style, etc.). To keep the test suite passing we do now discard any output lines from glcpp that consist only of spacing, (in addition to blank lines as previously). We also discard any initial whitespace from gcc output. In neither case should the absence or presence of this whitespace affect correctness.