[Syntax] Add test case for unresolved matching patterns

Patterns those are parsed as ExpressionPattern at first, then resolved
to actual patterns:

* OptionalPattern -> pattern '?'
* AsTypePattern -> pattern 'as' type
* EnumCasePattern -> type? '.' identifier tuple-pattern
This commit is contained in:
Rintaro Ishizaki
2017-12-20 20:14:08 +09:00
parent 93a74fea44
commit 87ea7bd9d3
3 changed files with 10 additions and 2 deletions

View File

@@ -28,10 +28,10 @@ PATTERN_NODES = [
Child('Type', kind='Type'),
]),
# optional-pattern -> identifier '?'
# optional-pattern -> pattern '?'
Node('OptionalPattern', kind='Pattern',
children=[
Child('Identifier', kind='IdentifierToken'),
Child('SubPattern', kind='Pattern'),
Child('QuestionMark', kind='PostfixQuestionMarkToken'),
]),