summaryrefslogtreecommitdiff
path: root/src/lib/syntax.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/syntax.c')
-rw-r--r--src/lib/syntax.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/syntax.c b/src/lib/syntax.c
index d20c058..6e08d1b 100644
--- a/src/lib/syntax.c
+++ b/src/lib/syntax.c
@@ -190,6 +190,23 @@ text(struct scan_state *state, struct token *token)
return 1;
}
+static int
+comment(struct scan_state *state, struct token *token)
+{
+ uint32_t c;
+
+ c = peek(state);
+ if(c != 0x235D)
+ return 0;
+
+ do
+ c = advance(state);
+ while(c != '\n');
+
+ token->tag = TOKEN_TAG_COMMENT;
+ return 1;
+}
+
static enum aplwc_rc
next_token(struct scan_state *state, struct token *token)
{
@@ -199,6 +216,7 @@ next_token(struct scan_state *state, struct token *token)
keyword,
number,
text,
+ comment,
single_sym /* Must be last */
};