Skip to content

Commit

Permalink
literal: None literals
Browse files Browse the repository at this point in the history
  • Loading branch information
obiwac committed Sep 2, 2024
1 parent 581c50a commit 6623662
Show file tree
Hide file tree
Showing 3 changed files with 6,649 additions and 7,423 deletions.
5 changes: 5 additions & 0 deletions flamingo/grammar/literal.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ static int parse_literal(flamingo_t* flamingo, TSNode node, flamingo_val_t** val
TSNode const child = ts_node_child(node, 0);
char const* const type = ts_node_type(child);

if (strcmp(type, "none") == 0) {
// 'val_alloc' creates a none value for us by default.
return 0;
}

if (strcmp(type, "string") == 0) {
(*val)->kind = FLAMINGO_VAL_KIND_STR;

Expand Down
Loading

0 comments on commit 6623662

Please sign in to comment.