Skip to content

Commit

Permalink
parse file ignore comments
Browse files Browse the repository at this point in the history
  • Loading branch information
drblallo committed Dec 8, 2024
1 parent abf3ee5 commit de349ca
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion stdlib/action.rl
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,22 @@ fun<AllActionsVariant> parse_actions(AllActionsVariant variant, Vector<Byte> inp
to_return.append(variant)
return to_return

fun _consume_comment(String input, Int current):
while is_space(input[current]) and current < input.size():
current = current + 1
if input[current] != '#':
return

while input[current] != '\n' and current < input.size():
current = current + 1


fun<AllActionsVariant> parse_actions(AllActionsVariant variant, String input) -> Vector<AllActionsVariant>:
let to_return : Vector<AllActionsVariant>
let counter = 0
_consume_comment(input, counter)
while from_string(variant, input, counter):
print(variant)
_consume_comment(input, counter)
to_return.append(variant)
return to_return

Expand Down

0 comments on commit de349ca

Please sign in to comment.