mirror of
https://github.com/github/semantic.git
synced 2025-01-06 23:46:21 +03:00
New rescue productions
This commit is contained in:
parent
b13262771a
commit
bb17a32539
@ -110,11 +110,11 @@ termConstructor source sourceSpan name range children
|
|||||||
("module", identifier : body ) -> S.Module identifier body
|
("module", identifier : body ) -> S.Module identifier body
|
||||||
("module", _ ) -> S.Error children
|
("module", _ ) -> S.Error children
|
||||||
("rescue", _ ) -> case children of
|
("rescue", _ ) -> case children of
|
||||||
args : lastException : rest
|
exceptions : exceptionVar : rest
|
||||||
| RescueArgs <- category (extract args)
|
| RescueArgs <- category (extract exceptions)
|
||||||
, RescuedException <- category (extract lastException) -> S.Rescue (toList (unwrap args) <> [lastException]) rest
|
, RescuedException <- category (extract exceptionVar) -> S.Rescue (toList (unwrap exceptions) <> [exceptionVar]) rest
|
||||||
lastException : rest | RescuedException <- category (extract lastException) -> S.Rescue [lastException] rest
|
exceptionVar : rest | RescuedException <- category (extract exceptionVar) -> S.Rescue [exceptionVar] rest
|
||||||
args : body | RescueArgs <- category (extract args) -> S.Rescue (toList (unwrap args)) body
|
exceptions : body | RescueArgs <- category (extract exceptions) -> S.Rescue (toList (unwrap exceptions)) body
|
||||||
body -> S.Rescue [] body
|
body -> S.Rescue [] body
|
||||||
("rescue_modifier", [lhs, rhs] ) -> S.Rescue [lhs] [rhs]
|
("rescue_modifier", [lhs, rhs] ) -> S.Rescue [lhs] [rhs]
|
||||||
("rescue_modifier", _ ) -> S.Error children
|
("rescue_modifier", _ ) -> S.Error children
|
||||||
@ -150,6 +150,7 @@ categoryForRubyName = \case
|
|||||||
"boolean_and" -> BooleanOperator -- boolean and, e.g. &&.
|
"boolean_and" -> BooleanOperator -- boolean and, e.g. &&.
|
||||||
"boolean_or" -> BooleanOperator -- boolean or, e.g. &&.
|
"boolean_or" -> BooleanOperator -- boolean or, e.g. &&.
|
||||||
"boolean" -> Boolean
|
"boolean" -> Boolean
|
||||||
|
"call" -> MemberAccess
|
||||||
"case" -> Case
|
"case" -> Case
|
||||||
"class" -> Class
|
"class" -> Class
|
||||||
"comment" -> Comment
|
"comment" -> Comment
|
||||||
@ -161,10 +162,12 @@ categoryForRubyName = \case
|
|||||||
"elsif" -> Elsif
|
"elsif" -> Elsif
|
||||||
"ensure" -> Ensure
|
"ensure" -> Ensure
|
||||||
"ERROR" -> Error
|
"ERROR" -> Error
|
||||||
|
"exception_variable" -> RescuedException
|
||||||
|
"exceptions" -> RescueArgs
|
||||||
|
"false" -> Boolean
|
||||||
"float" -> NumberLiteral
|
"float" -> NumberLiteral
|
||||||
"for" -> For
|
"for" -> For
|
||||||
"formal_parameters" -> Params
|
"formal_parameters" -> Params
|
||||||
"method_call" -> FunctionCall
|
|
||||||
"hash_splat_parameter" -> HashSplatParameter
|
"hash_splat_parameter" -> HashSplatParameter
|
||||||
"hash" -> Object
|
"hash" -> Object
|
||||||
"identifier" -> Identifier
|
"identifier" -> Identifier
|
||||||
@ -174,7 +177,7 @@ categoryForRubyName = \case
|
|||||||
"interpolation" -> Interpolation
|
"interpolation" -> Interpolation
|
||||||
"keyword_parameter" -> KeywordParameter
|
"keyword_parameter" -> KeywordParameter
|
||||||
"math_assignment" -> MathAssignment
|
"math_assignment" -> MathAssignment
|
||||||
"call" -> MemberAccess
|
"method_call" -> FunctionCall
|
||||||
"method" -> Method
|
"method" -> Method
|
||||||
"module" -> Module
|
"module" -> Module
|
||||||
"nil" -> Identifier
|
"nil" -> Identifier
|
||||||
@ -183,16 +186,16 @@ categoryForRubyName = \case
|
|||||||
"program" -> Program
|
"program" -> Program
|
||||||
"regex" -> Regex
|
"regex" -> Regex
|
||||||
"relational" -> RelationalOperator -- relational operator, e.g. ==, !=, ===, <=>, =~, !~.
|
"relational" -> RelationalOperator -- relational operator, e.g. ==, !=, ===, <=>, =~, !~.
|
||||||
"exceptions" -> RescueArgs
|
|
||||||
"rescue" -> Rescue
|
|
||||||
"rescue_modifier" -> RescueModifier
|
"rescue_modifier" -> RescueModifier
|
||||||
"exception_variable" -> RescuedException
|
"rescue" -> Rescue
|
||||||
"return" -> Return
|
"return" -> Return
|
||||||
|
"self" -> Identifier
|
||||||
"shift" -> BitwiseOperator -- bitwise shift, e.g <<, >>.
|
"shift" -> BitwiseOperator -- bitwise shift, e.g <<, >>.
|
||||||
"splat_parameter" -> SplatParameter
|
"splat_parameter" -> SplatParameter
|
||||||
"string" -> StringLiteral
|
"string" -> StringLiteral
|
||||||
"subshell" -> Subshell
|
"subshell" -> Subshell
|
||||||
"symbol" -> SymbolLiteral
|
"symbol" -> SymbolLiteral
|
||||||
|
"true" -> Boolean
|
||||||
"unless_modifier" -> Unless
|
"unless_modifier" -> Unless
|
||||||
"unless" -> Unless
|
"unless" -> Unless
|
||||||
"until_modifier" -> Until
|
"until_modifier" -> Until
|
||||||
@ -201,7 +204,4 @@ categoryForRubyName = \case
|
|||||||
"while_modifier" -> While
|
"while_modifier" -> While
|
||||||
"while" -> While
|
"while" -> While
|
||||||
"yield" -> Yield
|
"yield" -> Yield
|
||||||
"true" -> Boolean
|
|
||||||
"false" -> Boolean
|
|
||||||
"self" -> Identifier
|
|
||||||
s -> Other s
|
s -> Other s
|
||||||
|
@ -122,7 +122,7 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"summary": "Deleted the 'bar' identifier in the 'Error, x' rescue block"
|
"summary": "Deleted the 'bar' identifier in the 'Error, identifier' rescue block"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -166,7 +166,7 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"summary": "Added the 'bar' identifier in the 'Error, x' rescue block"
|
"summary": "Added the 'bar' identifier in the 'Error, identifier' rescue block"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
@ -1 +1 @@
|
|||||||
Subproject commit a966f9b2783f127617cc42cbed16e6ec570b75ad
|
Subproject commit d4996909ad6798a66c5242d7171125ce6dbe1a50
|
Loading…
Reference in New Issue
Block a user