Skip to content
Snippets Groups Projects
Commit 026177e5 authored by Hunter Goldstein's avatar Hunter Goldstein Committed by Michael Aaron Murphy
Browse files

Introduce a match-case construct to Ion's grammar (#351)

* [WIP] Add a rudimentary match statement to the language

* Parsing a match construct now correctly resumes on new line

Before, parsing a match construct would depend on all parts of the match
statement being in one piece, it can now accept it over multiple
invocations of `on_command`

* Match statement now forwards all conditions

* Most errors are copy / paste errors

* Finish comment, remove useless continue

* case values are now unquoted string literals

* Added example for match

* case expressions are now arbitrary commands

The values in case branches can now be arbitrary commands that work off
set intersection (for now). For example, the case:
```
case @(seq 0 10)
```
would match any number from 0 to 10. Additionally, alternation can be
done through an array, like so:
```
match $filetype
  case ["image/jpeg" "image/png"]
  ...
  end
end
```

* Remove XXX referencing shorthand
parent b483756d
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment