Changeset View
Changeset View
Standalone View
Standalone View
duchain/declarationbuilder.h
Context not available. | |||||
169 | /** | 169 | /** | ||
---|---|---|---|---|---|
170 | * @brief Attempts to determine the unpacked type(s) of the right-hand side of an assignment. | 170 | * @brief Attempts to determine the unpacked type(s) of the right-hand side of an assignment. | ||
171 | * | 171 | * | ||
172 | * @param items The expression on the right-hand side of the assignment | 172 | * @param source The source type on the right-hand side of the assignment | ||
173 | * @param fillWhenLengthMissing If non-zero and the object in @p items has an indefinite length but | 173 | * @param fillWhenLengthMissing If non-zero and the object in @p items has an indefinite length but | ||
174 | * a definite content type, return this many copies of that type | 174 | * a definite content type, return this many copies of that type | ||
175 | * | 175 | * | ||
Context not available. | |||||
177 | * a, b = "Foo", 3.5 (@p fillWhenLengthMissing ignored here because the right-hand side | 177 | * a, b = "Foo", 3.5 (@p fillWhenLengthMissing ignored here because the right-hand side | ||
178 | * has a definite amount of items) -> returns str, float | 178 | * has a definite amount of items) -> returns str, float | ||
179 | */ | 179 | */ | ||
180 | QList<SourceType> sourcesOfAssignment(ExpressionAst* items, int fillWhenLengthMissing=-1) const; | 180 | QVector<SourceType> unpackAssignmentSource(const SourceType& source, int fillWhenLengthMissing) const; | ||
181 | | ||||
182 | /** | | |||
183 | * @brief Given a list of targets (@see targetsOfAssignment) and sources (@see sourcesOfAssignment) and a | | |||
184 | * @p index, matches the sources with the targets and returns the type which belongs to @p index. | | |||
185 | * | | |||
186 | * @param targets Left-hand side of the assignment | | |||
187 | * @param sources Right-hand side of the assignment | | |||
188 | * @param index index of the item to return the type for | | |||
189 | * @param rhs Pass the right-hand side of the assignment again so that its compound type can be used in case | | |||
190 | * it consists of more than one element and unpacking is not possible; example: a = 1, 2 | | |||
191 | */ | | |||
192 | SourceType selectSource(const QList<ExpressionAst*>& targets, const QList<SourceType>& sources, | | |||
193 | int index, ExpressionAst* rhs) const; | | |||
194 | 181 | | |||
195 | /** | 182 | /** | ||
196 | * @brief Handle a variable assignment to @p name and give it the type @p element. | 183 | * @brief Handle a variable assignment to @p name and give it the type @p element. | ||
Context not available. | |||||
208 | void assignToAttribute(AttributeAst* attribute, const SourceType& element); | 195 | void assignToAttribute(AttributeAst* attribute, const SourceType& element); | ||
209 | 196 | | |||
210 | /** | 197 | /** | ||
198 | * @brief Handle assignment to a target @p target with rhs type @p element. | ||||
199 | */ | ||||
200 | void assignToTuple(TupleAst* tuple, const SourceType& element); | ||||
201 | | ||||
202 | /** | ||||
203 | * @brief Handle assignment to a target @p target with rhs type @p element. | ||||
204 | */ | ||||
205 | void assignToUnknown(ExpressionAst* target, const SourceType& element); | ||||
206 | | ||||
207 | /** | ||||
211 | * @brief Find all existing declarations for the identifier @p node | 208 | * @brief Find all existing declarations for the identifier @p node | ||
212 | */ | 209 | */ | ||
213 | QList<Declaration*> existingDeclarationsForNode(Identifier* node); | 210 | QList<Declaration*> existingDeclarationsForNode(Identifier* node); | ||
Context not available. |