Commit Graph

15 Commits

Author SHA1 Message Date
Paolo Tranquilli
a82d37e05c Swift: fix gracefully accepting missing ForEachStmt.iteratorVar 2024-12-06 14:45:24 +01:00
Paolo Tranquilli
814218c7a8 Swift: extract variables as children of ForEachStmt 2024-11-28 11:03:46 +01:00
Paolo Tranquilli
b8e38288e3 Swift: add extraction of ThenStmt
These are currently added implicitly by the compiler in the context of
`if`/`switch` expressions. In the future, there might be explicit
`then <expr>` statement useful for cases where one would like to add
more than one statement in the branch, to mark what value to actually
use.

See https://forums.swift.org/t/pitch-multi-statement-if-switch-do-expressions/68443
2024-03-27 13:26:04 +01:00
Alex Denisov
6a673e700b Swift: extract DiscardStmt 2023-11-24 09:46:01 +01:00
Paolo Tranquilli
fb470e4140 Swift: remove useless commented-out line 2023-10-25 12:15:25 +02:00
Paolo Tranquilli
a245d0019e Swift: tiny cosmetic tweak 2023-10-25 10:56:21 +02:00
Paolo Tranquilli
9196939384 Swift: canonicalize all VarDecls 2023-10-25 10:38:17 +02:00
Paolo Tranquilli
f22d60f011 Swift: clean up VarDecl, NamedPattern and SwitchStmt interactions
* `variables` under `CaseStmt` are now AST children, which solves
  orphan `VarDecl`s in that case
* reordered `CaseStmt` AST children to be `labels > variables > body`
  (was `body > labels`)
* made `NamedPattern::getVarDecl` an extracted property instead of
  `getName`
* The above led to duplicate DB entities because of a quirk in the
  Swift compiler code. This is solved by tweaking the extraction of
  `variables` under `CaseStmt` to not use `getCaseBodyVariables`.
2023-10-23 17:36:42 +02:00
Robert Marsh
a3e250aef5 Swift: extract iterator variable for for-in loops 2023-09-08 19:08:57 +00:00
Alex Denisov
e9fdbfabea Swift: extract nextCall from ForEachStmt 2023-08-22 17:36:40 +02:00
Alex Denisov
cebaca328e Swift: 'ParsedSequence' lacks proper types and yields 'Unresolved' AST nodes 2023-08-08 14:41:15 +02:00
Alex Denisov
712c25e6f4 Swift: extract availability info 2023-02-07 14:26:39 +01:00
Paolo Tranquilli
9ee4f8b388 Swift: extract remaining Stmts
`FailStmt` are `return nil` in fallible initializers.

`PoundAssertStmt` are an experimental feature for compile time
assertions.
2022-11-08 17:38:17 +01:00
Paolo Tranquilli
cc9dafffde Swift: encapsulate swift::ASTVisitor functionality 2022-11-03 18:16:53 +01:00
Paolo Tranquilli
7c9fffc201 Swift: rename all visitors to translators 2022-11-03 18:16:53 +01:00