ref: 3e9702e68d03ea23f007e5786bc2f8229a6ada7a
parent: 4121d26d2915e65e517a4bfb0b401b41349fdaa5
author: Ori Bernstein <ori@eigenstate.org>
date: Fri Dec 18 19:48:21 EST 2015
Add // comments.
--- a/parse/tok.c
+++ b/parse/tok.c
@@ -129,23 +129,21 @@
c = peek();
if (!ignorenl && c == '\n') {
break;
- }
- else if (c == '\\') {
+ } else if (c == '\\') {
ignorenl = 1;
next();
- }
- else if (ignorenl && c == '\n') {
+ } else if (ignorenl && c == '\n') {
next();
curloc.line++;
ignorenl = 0;
- }
- else if (isspace(c)) {
+ } else if (isspace(c)) {
next();
- }
- else if (c == '/' && peekn(1) == '*') {
+ } else if (c == '/' && peekn(1) == '*') {
eatcomment();
- }
- else {
+ } else if (c == '/' && peekn(1) == '/') {
+ while (peek() != End && peek() != '\n')
+ next();
+ } else {
break;
}
}