1 /* valanamedargument.vala
3 * Copyright (C) 2009-2010 Jürg Billeter
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 * Jürg Billeter <j@bitron.ch>
23 public class Vala
.NamedArgument
: Expression
{
24 public string name
{ get; set; }
26 public Expression inner
{
32 _inner
.parent_node
= this
;
36 private Expression _inner
;
38 public NamedArgument (string name
, Expression inner
, SourceReference? source_reference
= null) {
41 this
.source_reference
= source_reference
;
44 public override void accept (CodeVisitor visitor
) {
45 visitor
.visit_named_argument (this
);
47 visitor
.visit_expression (this
);
50 public override void accept_children (CodeVisitor visitor
) {
51 inner
.accept (visitor
);
54 public override void replace_expression (Expression old_node
, Expression new_node
) {
55 if (inner
== old_node
) {
60 public override bool is_pure () {
61 return inner
.is_pure ();
64 public override bool check (SemanticAnalyzer analyzer
) {
71 inner
.target_type
= target_type
;
73 if (!inner
.check (analyzer
)) {
78 inner
.target_type
= inner
.value_type
;
79 value_type
= inner
.value_type
;
84 public override void get_defined_variables (Collection
<LocalVariable
> collection
) {
85 inner
.get_defined_variables (collection
);
88 public override void get_used_variables (Collection
<LocalVariable
> collection
) {
89 inner
.get_used_variables (collection
);