summaryrefslogtreecommitdiff
path: root/parse/tok.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-12-19 00:48:21 -0800
committerOri Bernstein <ori@eigenstate.org>2015-12-19 00:48:21 -0800
commit3e9702e68d03ea23f007e5786bc2f8229a6ada7a (patch)
treebb46f314c249872a298ec2822d38295396d2738e /parse/tok.c
parent4121d26d2915e65e517a4bfb0b401b41349fdaa5 (diff)
downloadmc-3e9702e68d03ea23f007e5786bc2f8229a6ada7a.tar.gz
Add // comments.
Diffstat (limited to 'parse/tok.c')
-rw-r--r--parse/tok.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/parse/tok.c b/parse/tok.c
index fd3597c..51f632f 100644
--- a/parse/tok.c
+++ b/parse/tok.c
@@ -129,23 +129,21 @@ static void eatspace(void)
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;
}
}