-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is because TOML does not support `None` in lists. We need to be able to tell the difference between `Some` and `None` in list items in order to support `Match<'_, Option<_>>`. SEE toml-lang/toml#30
- Loading branch information
Showing
24 changed files
with
300 additions
and
178 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
YamlFieldPrefix = 'literal_tab' YamlFieldNamePrefix | ||
YamlFieldNamePrefix = 'literal_tab'* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
//#include fields | ||
|
||
/// A `Match` for anything. | ||
MatchAny = MatchCondition 'Any' | ||
|
||
/// A condition for a `Match` | ||
MatchCondition = YamlFieldPrefix 'condition: ' | ||
|
||
/// A value for a `MatchCondition`. Not needed for `MatchAny`. | ||
MatchValue = YamlFieldPrefix 'value: ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
//#include location | ||
//#include ../match | ||
//#include ../types | ||
|
||
/// A query for a `Contact`. | ||
YamlContactQuery = | ||
YamlFieldNamePrefix 'address:literal_newline' | ||
YamlLocationQuery 'literal_newline' | ||
YamlFieldNamePrefix 'email:literal_newline' | ||
YamlContactQueryEmail | ||
YamlFieldNamePrefix 'phone:literal_newline' | ||
YamlContactQueryPhone | ||
|
||
/// A query for the `email` field of a `Contact`. | ||
YamlContactQueryEmail = | ||
MatchAny | ||
| MatchCondition 'EqualTo' 'literal_newline' | ||
MatchValue Email | ||
| MatchCondition 'HasAll' 'literal_newline' | ||
MatchValue | ||
('literal_newline' YamlEmailListItem ('literal_newline' YamlEmailListItem)* | '[]') | ||
| MatchCondition 'HasAny' 'literal_newline' | ||
MatchValue | ||
('literal_newline' YamlEmailListItem ('literal_newline' YamlEmailListItem)* | '[]') | ||
| MatchCondition 'HasNone' 'literal_newline' | ||
MatchValue | ||
('literal_newline' YamlEmailListItem ('literal_newline' YamlEmailListItem)* | '[]') | ||
| MatchCondition 'InRange' 'literal_newline' | ||
MatchValue 'literal_newline' | ||
min:YamlEmailListItem 'literal_newline' | ||
max:YamlEmailListItem | ||
|
||
YamlEmailListItem = YamlFieldPrefix '- ' Email | ||
|
||
/// A valid email address NOTE: definition may not comprise all valid email addresses, only most. | ||
/// | ||
/// Example: [email protected] | ||
Email = '"' EmailPrefix '@' EmailDomain '.top_level_domain' '"' | ||
|
||
/// The part of an email before the '@'. | ||
EmailPrefix = | ||
AlphabetLowercase EmailPrefix* | ||
| Integer EmailPrefix* | ||
| (AlphabetLowercase|Integer) ('-'|'_'|'.') (AlphabetLowercase|Integer) EmailPrefix* | ||
|
||
/// The part of an email after the '@'. | ||
EmailDomain = (AlphabetLowercase|Integer) (AlphabetLowercase|Integer|'-')* (AlphabetLowercase|Integer) | ||
|
||
/// A query for the `phone` field of a `Contact`. | ||
YamlContactQueryPhone = | ||
MatchAny | ||
| MatchCondition 'EqualTo' 'literal_newline' | ||
MatchValue Phone | ||
| MatchCondition 'HasAll' 'literal_newline' | ||
MatchValue | ||
('literal_newline' YamlPhoneListItem ('literal_newline' YamlPhoneListItem)* | '[]') | ||
| MatchCondition 'HasAny' 'literal_newline' | ||
MatchValue | ||
('literal_newline' YamlPhoneListItem ('literal_newline' YamlPhoneListItem)* | '[]') | ||
| MatchCondition 'HasNone' 'literal_newline' | ||
MatchValue | ||
('literal_newline' YamlPhoneListItem ('literal_newline' YamlPhoneListItem)* | '[]') | ||
| MatchCondition 'InRange' 'literal_newline' | ||
MatchValue 'literal_newline' | ||
min:YamlPhoneListItem 'literal_newline' | ||
max:YamlPhoneListItem | ||
|
||
YamlPhoneListItem = YamlFieldPrefix '- ' Phone | ||
|
||
/// A standard phone number. Contains an optional country code (e.g. 1-555-627-5309 or 555-627-5309). | ||
Phone = '"' (Integer Integer* '-')? Integer Integer Integer '-' Integer Integer Integer '-' Integer Integer Integer Integer '"' |
Oops, something went wrong.