diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2011-07-26 15:35:34 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2011-07-26 15:41:42 -0700 |
| commit | 0a69196ef36ecff0c5faed4cbff5ab0c43f43e96 (patch) | |
| tree | 71b0c724e9099be9db9639f783b588cec8f7962c /src/comp/syntax/parse | |
| parent | 63aa869405feadc6d2a4dbdc7cd8bda5aaa3c591 (diff) | |
| download | rust-0a69196ef36ecff0c5faed4cbff5ab0c43f43e96.tar.gz rust-0a69196ef36ecff0c5faed4cbff5ab0c43f43e96.zip | |
Handle column-zero \n explicitly rather than looking for \n\n.
Diffstat (limited to 'src/comp/syntax/parse')
| -rw-r--r-- | src/comp/syntax/parse/lexer.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/comp/syntax/parse/lexer.rs b/src/comp/syntax/parse/lexer.rs index 210c782a8f5..d011fdc41b2 100644 --- a/src/comp/syntax/parse/lexer.rs +++ b/src/comp/syntax/parse/lexer.rs @@ -623,7 +623,7 @@ fn push_blank_line_comment(&reader rdr, fn consume_whitespace_counting_blank_lines(&reader rdr, &mutable cmnt[] comments) { while (is_whitespace(rdr.curr()) && !rdr.is_eof()) { - if rdr.curr() == '\n' && rdr.next() == '\n' { + if rdr.get_col() == 0u && rdr.curr() == '\n' { push_blank_line_comment(rdr, comments); } rdr.bump(); @@ -758,9 +758,6 @@ fn gather_comments_and_literals(&codemap::codemap cm, str path, auto code_to_the_left = !first_read; consume_non_eol_whitespace(rdr); if (rdr.curr() == '\n') { - if first_read { - push_blank_line_comment(rdr, comments); - } code_to_the_left = false; consume_whitespace_counting_blank_lines(rdr, comments); } |
