aboutsummaryrefslogtreecommitdiff
path: root/src/tokenize.c
diff options
context:
space:
mode:
authorkoekeishiya <aasvi93@hotmail.com>2019-03-03 18:39:34 +0100
committerkoekeishiya <aasvi93@hotmail.com>2019-03-03 18:39:34 +0100
commit56b94a6eed9fe4642382f533666dc19901fad3fc (patch)
tree6e026d8a145fad2143fe4cac1603f22a48195be9 /src/tokenize.c
parente23811d884b9dae356c84e4515ef52184aa3432c (diff)
downloadskhd-56b94a6eed9fe4642382f533666dc19901fad3fc.tar.gz
skhd-56b94a6eed9fe4642382f533666dc19901fad3fc.zip
#53 allow opt-out for applications
Diffstat (limited to 'src/tokenize.c')
-rw-r--r--src/tokenize.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tokenize.c b/src/tokenize.c
index a0fd93d..eaf0e3a 100644
--- a/src/tokenize.c
+++ b/src/tokenize.c
@@ -79,6 +79,14 @@ eat_string(struct tokenizer *tokenizer)
}
}
+internal void
+eat_option(struct tokenizer *tokenizer)
+{
+ while (*tokenizer->at && !isspace(*tokenizer->at)) {
+ advance(tokenizer);
+ }
+}
+
internal inline bool
isidentifier(char c)
{
@@ -150,6 +158,15 @@ get_token(struct tokenizer *tokenizer)
case '*': { token.type = Token_Wildcard; } break;
case '[': { token.type = Token_BeginList; } break;
case ']': { token.type = Token_EndList; } break;
+ case '.': {
+ token.text = tokenizer->at;
+ token.line = tokenizer->line;
+ token.cursor = tokenizer->cursor;
+
+ eat_option(tokenizer);
+ token.length = tokenizer->at - token.text;
+ token.type = Token_Option;
+ } break;
case '"': {
token.text = tokenizer->at;
token.line = tokenizer->line;