| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 580b214 commit a8bb94a
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -277,15 +277,28 @@ module AssignableInternal { | |||
| 277 | 277 | def = TParameterDefaultDefinition(_, result) | |
| 278 | 278 | } | |
| 279 | 279 | ||
| 280 | - /** A local variable declaration at the top-level of a pattern. */ | ||
| 281 | - class TopLevelPatternDecl extends LocalVariableDeclExpr { | ||
| 280 | + /** A pattern containing a local variable declaration. */ | ||
| 281 | + class LocalVariablePatternDecl extends LocalVariableDeclExpr { | ||
| 282 | 282 | private PatternMatch pm; | |
| 283 | 283 | ||
| 284 | - TopLevelPatternDecl() { this = pm.getPattern().(BindingPatternExpr).getVariableDeclExpr() } | ||
| 284 | + LocalVariablePatternDecl() { | ||
| 285 | + exists(BindingPatternExpr bpe | | ||
| 286 | + this = bpe.getVariableDeclExpr() and pm = bpe.getPatternMatch() | ||
| 287 | + ) | ||
| 288 | + } | ||
| 289 | + | ||
| 290 | + /** Holds if the local variable definition is at the top level of the pattern. */ | ||
| 291 | + predicate isTopLevel() { this = pm.getPattern().(BindingPatternExpr).getVariableDeclExpr() } | ||
| 285 | 292 | ||
| 293 | + /** Gets the pattern match that this local variable declaration (pattern) belongs to. */ | ||
| 286 | 294 | PatternMatch getMatch() { result = pm } | |
| 287 | 295 | } | |
| 288 | 296 | ||
| 297 | + /** A local variable declaration at the top-level of a pattern. */ | ||
| 298 | + class TopLevelPatternDecl extends LocalVariablePatternDecl { | ||
| 299 | + TopLevelPatternDecl() { this.isTopLevel() } | ||
| 300 | + } | ||
| 301 | + | ||
| 289 | 302 | cached | |
| 290 | 303 | private module Cached { | |
| 291 | 304 | cached | |
| Back | FazBrowse Home | New Git URL |
0 commit comments