diff --git a/ast.model.boo b/ast.model.boo
index e54186723..6f7dbe859 100644
--- a/ast.model.boo
+++ b/ast.model.boo
@@ -551,6 +551,12 @@ class CastExpression(Expression):
class TypeofExpression(Expression):
Type as TypeReference
+class AsyncBlockExpression(BlockExpression):
+ Block as BlockExpression
+
+class AwaitExpression(Expression):
+ BaseExpression as Expression
+
class CustomStatement(Statement):
pass
diff --git a/src/Boo.Lang.Compiler/Ast/AsyncBlockExpression.cs b/src/Boo.Lang.Compiler/Ast/AsyncBlockExpression.cs
new file mode 100644
index 000000000..5b0d0ed5f
--- /dev/null
+++ b/src/Boo.Lang.Compiler/Ast/AsyncBlockExpression.cs
@@ -0,0 +1,52 @@
+#region license
+// Copyright (c) 2009 Rodrigo B. de Oliveira (rbo@acm.org)
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without modification,
+// are permitted provided that the following conditions are met:
+//
+// * Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+// * Neither the name of Rodrigo B. de Oliveira nor the names of its
+// contributors may be used to endorse or promote products derived from this
+// software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#endregion
+
+namespace Boo.Lang.Compiler.Ast
+{
+ using System;
+
+ public partial class AsyncBlockExpression
+ {
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ public AsyncBlockExpression()
+ {
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ public AsyncBlockExpression(LexicalInfo lexicalInfo) : base(lexicalInfo)
+ {
+ }
+
+ public AsyncBlockExpression(BlockExpression value) : base(value.LexicalInfo)
+ {
+ _block = value;
+ _block.InitializeParent(this);
+ }
+ }
+}
+
diff --git a/src/Boo.Lang.Compiler/Ast/AwaitExpression.cs b/src/Boo.Lang.Compiler/Ast/AwaitExpression.cs
new file mode 100644
index 000000000..a1a34f6e1
--- /dev/null
+++ b/src/Boo.Lang.Compiler/Ast/AwaitExpression.cs
@@ -0,0 +1,25 @@
+using Boo.Lang.Compiler.TypeSystem;
+
+namespace Boo.Lang.Compiler.Ast
+{
+ public partial class AwaitExpression
+ {
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ public AwaitExpression()
+ {
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ public AwaitExpression(LexicalInfo lexicalInfo)
+ : base(lexicalInfo)
+ {
+ }
+
+ public AwaitExpression(Expression baseExpression)
+ : base(baseExpression.LexicalInfo)
+ {
+ _baseExpression = baseExpression;
+ _baseExpression.InitializeParent(this);
+ }
+ }
+}
diff --git a/src/Boo.Lang.Compiler/Ast/IAstVisitor.Generated.cs b/src/Boo.Lang.Compiler/Ast/IAstVisitor.Generated.cs
index de3e847b9..caa607c75 100644
--- a/src/Boo.Lang.Compiler/Ast/IAstVisitor.Generated.cs
+++ b/src/Boo.Lang.Compiler/Ast/IAstVisitor.Generated.cs
@@ -124,6 +124,8 @@ public interface IAstVisitor
void OnTryCastExpression(TryCastExpression node);
void OnCastExpression(CastExpression node);
void OnTypeofExpression(TypeofExpression node);
+ void OnAsyncBlockExpression(AsyncBlockExpression node);
+ void OnAwaitExpression(AwaitExpression node);
void OnCustomStatement(CustomStatement node);
void OnCustomExpression(CustomExpression node);
void OnStatementTypeMember(StatementTypeMember node);
diff --git a/src/Boo.Lang.Compiler/Ast/Impl/AsyncBlockExpressionImpl.cs b/src/Boo.Lang.Compiler/Ast/Impl/AsyncBlockExpressionImpl.cs
new file mode 100644
index 000000000..f050f81ed
--- /dev/null
+++ b/src/Boo.Lang.Compiler/Ast/Impl/AsyncBlockExpressionImpl.cs
@@ -0,0 +1,208 @@
+#region license
+// Copyright (c) 2009 Rodrigo B. de Oliveira (rbo@acm.org)
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without modification,
+// are permitted provided that the following conditions are met:
+//
+// * Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+// * Neither the name of Rodrigo B. de Oliveira nor the names of its
+// contributors may be used to endorse or promote products derived from this
+// software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#endregion
+
+//
+// DO NOT EDIT THIS FILE!
+//
+// This file was generated automatically by astgen.boo.
+//
+namespace Boo.Lang.Compiler.Ast
+{
+ using System.Collections;
+ using System.Runtime.Serialization;
+
+ [System.Serializable]
+ public partial class AsyncBlockExpression : BlockExpression
+ {
+ protected BlockExpression _block;
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ new public AsyncBlockExpression CloneNode()
+ {
+ return (AsyncBlockExpression)Clone();
+ }
+
+ ///
+ ///
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ new public AsyncBlockExpression CleanClone()
+ {
+ return (AsyncBlockExpression)base.CleanClone();
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ override public NodeType NodeType
+ {
+ get { return NodeType.AsyncBlockExpression; }
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ override public void Accept(IAstVisitor visitor)
+ {
+ visitor.OnAsyncBlockExpression(this);
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ override public bool Matches(Node node)
+ {
+ if (node == null) return false;
+ if (NodeType != node.NodeType) return false;
+ var other = ( AsyncBlockExpression)node;
+ if (!Node.AllMatch(_parameters, other._parameters)) return NoMatch("AsyncBlockExpression._parameters");
+ if (!Node.Matches(_returnType, other._returnType)) return NoMatch("AsyncBlockExpression._returnType");
+ if (!Node.Matches(_body, other._body)) return NoMatch("AsyncBlockExpression._body");
+ if (!Node.Matches(_block, other._block)) return NoMatch("AsyncBlockExpression._block");
+ return true;
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ override public bool Replace(Node existing, Node newNode)
+ {
+ if (base.Replace(existing, newNode))
+ {
+ return true;
+ }
+ if (_parameters != null)
+ {
+ ParameterDeclaration item = existing as ParameterDeclaration;
+ if (null != item)
+ {
+ ParameterDeclaration newItem = (ParameterDeclaration)newNode;
+ if (_parameters.Replace(item, newItem))
+ {
+ return true;
+ }
+ }
+ }
+ if (_returnType == existing)
+ {
+ this.ReturnType = (TypeReference)newNode;
+ return true;
+ }
+ if (_body == existing)
+ {
+ this.Body = (Block)newNode;
+ return true;
+ }
+ if (_block == existing)
+ {
+ this.Block = (BlockExpression)newNode;
+ return true;
+ }
+ return false;
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ override public object Clone()
+ {
+
+ AsyncBlockExpression clone = new AsyncBlockExpression();
+ clone._lexicalInfo = _lexicalInfo;
+ clone._endSourceLocation = _endSourceLocation;
+ clone._documentation = _documentation;
+ clone._isSynthetic = _isSynthetic;
+ clone._entity = _entity;
+ if (_annotations != null) clone._annotations = (Hashtable)_annotations.Clone();
+ clone._expressionType = _expressionType;
+ if (null != _parameters)
+ {
+ clone._parameters = _parameters.Clone() as ParameterDeclarationCollection;
+ clone._parameters.InitializeParent(clone);
+ }
+ if (null != _returnType)
+ {
+ clone._returnType = _returnType.Clone() as TypeReference;
+ clone._returnType.InitializeParent(clone);
+ }
+ if (null != _body)
+ {
+ clone._body = _body.Clone() as Block;
+ clone._body.InitializeParent(clone);
+ }
+ if (null != _block)
+ {
+ clone._block = _block.Clone() as BlockExpression;
+ clone._block.InitializeParent(clone);
+ }
+ return clone;
+
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ override internal void ClearTypeSystemBindings()
+ {
+ _annotations = null;
+ _entity = null;
+ _expressionType = null;
+ if (null != _parameters)
+ {
+ _parameters.ClearTypeSystemBindings();
+ }
+ if (null != _returnType)
+ {
+ _returnType.ClearTypeSystemBindings();
+ }
+ if (null != _body)
+ {
+ _body.ClearTypeSystemBindings();
+ }
+ if (null != _block)
+ {
+ _block.ClearTypeSystemBindings();
+ }
+
+ }
+
+
+ [System.Xml.Serialization.XmlElement]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ public BlockExpression Block
+ {
+
+ get { return _block; }
+ set
+ {
+ if (_block != value)
+ {
+ _block = value;
+ if (null != _block)
+ {
+ _block.InitializeParent(this);
+ }
+ }
+ }
+
+ }
+
+
+ }
+}
+
diff --git a/src/Boo.Lang.Compiler/Ast/Impl/AwaitExpressionImpl.cs b/src/Boo.Lang.Compiler/Ast/Impl/AwaitExpressionImpl.cs
new file mode 100644
index 000000000..a960d8971
--- /dev/null
+++ b/src/Boo.Lang.Compiler/Ast/Impl/AwaitExpressionImpl.cs
@@ -0,0 +1,156 @@
+#region license
+// Copyright (c) 2009 Rodrigo B. de Oliveira (rbo@acm.org)
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without modification,
+// are permitted provided that the following conditions are met:
+//
+// * Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+// * Neither the name of Rodrigo B. de Oliveira nor the names of its
+// contributors may be used to endorse or promote products derived from this
+// software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#endregion
+
+//
+// DO NOT EDIT THIS FILE!
+//
+// This file was generated automatically by astgen.boo.
+//
+namespace Boo.Lang.Compiler.Ast
+{
+ using System.Collections;
+ using System.Runtime.Serialization;
+
+ [System.Serializable]
+ public partial class AwaitExpression : Expression
+ {
+ protected Expression _baseExpression;
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ new public AwaitExpression CloneNode()
+ {
+ return (AwaitExpression)Clone();
+ }
+
+ ///
+ ///
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ new public AwaitExpression CleanClone()
+ {
+ return (AwaitExpression)base.CleanClone();
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ override public NodeType NodeType
+ {
+ get { return NodeType.AwaitExpression; }
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ override public void Accept(IAstVisitor visitor)
+ {
+ visitor.OnAwaitExpression(this);
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ override public bool Matches(Node node)
+ {
+ if (node == null) return false;
+ if (NodeType != node.NodeType) return false;
+ var other = ( AwaitExpression)node;
+ if (!Node.Matches(_baseExpression, other._baseExpression)) return NoMatch("AwaitExpression._baseExpression");
+ return true;
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ override public bool Replace(Node existing, Node newNode)
+ {
+ if (base.Replace(existing, newNode))
+ {
+ return true;
+ }
+ if (_baseExpression == existing)
+ {
+ this.BaseExpression = (Expression)newNode;
+ return true;
+ }
+ return false;
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ override public object Clone()
+ {
+
+ AwaitExpression clone = new AwaitExpression();
+ clone._lexicalInfo = _lexicalInfo;
+ clone._endSourceLocation = _endSourceLocation;
+ clone._documentation = _documentation;
+ clone._isSynthetic = _isSynthetic;
+ clone._entity = _entity;
+ if (_annotations != null) clone._annotations = (Hashtable)_annotations.Clone();
+ clone._expressionType = _expressionType;
+ if (null != _baseExpression)
+ {
+ clone._baseExpression = _baseExpression.Clone() as Expression;
+ clone._baseExpression.InitializeParent(clone);
+ }
+ return clone;
+
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ override internal void ClearTypeSystemBindings()
+ {
+ _annotations = null;
+ _entity = null;
+ _expressionType = null;
+ if (null != _baseExpression)
+ {
+ _baseExpression.ClearTypeSystemBindings();
+ }
+
+ }
+
+
+ [System.Xml.Serialization.XmlElement]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ public Expression BaseExpression
+ {
+
+ get { return _baseExpression; }
+ set
+ {
+ if (_baseExpression != value)
+ {
+ _baseExpression = value;
+ if (null != _baseExpression)
+ {
+ _baseExpression.InitializeParent(this);
+ }
+ }
+ }
+
+ }
+
+
+ }
+}
+
diff --git a/src/Boo.Lang.Compiler/Ast/Impl/CodeSerializer.cs b/src/Boo.Lang.Compiler/Ast/Impl/CodeSerializer.cs
index a6aec1441..fb5a444e0 100755
--- a/src/Boo.Lang.Compiler/Ast/Impl/CodeSerializer.cs
+++ b/src/Boo.Lang.Compiler/Ast/Impl/CodeSerializer.cs
@@ -2787,6 +2787,61 @@ override public void OnTypeofExpression(Boo.Lang.Compiler.Ast.TypeofExpression n
Push(mie);
}
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ override public void OnAsyncBlockExpression(Boo.Lang.Compiler.Ast.AsyncBlockExpression node)
+ {
+ MethodInvocationExpression mie = new MethodInvocationExpression(
+ node.LexicalInfo,
+ CreateReference(node, "Boo.Lang.Compiler.Ast.AsyncBlockExpression"));
+ mie.Arguments.Add(Serialize(node.LexicalInfo));
+ if (ShouldSerialize(node.Parameters))
+ {
+ mie.NamedArguments.Add(
+ new ExpressionPair(
+ CreateReference(node, "Parameters"),
+ SerializeCollection(node, "Boo.Lang.Compiler.Ast.ParameterDeclarationCollection", node.Parameters)));
+ }
+ if (ShouldSerialize(node.ReturnType))
+ {
+ mie.NamedArguments.Add(
+ new ExpressionPair(
+ CreateReference(node, "ReturnType"),
+ Serialize(node.ReturnType)));
+ }
+ if (ShouldSerialize(node.Body))
+ {
+ mie.NamedArguments.Add(
+ new ExpressionPair(
+ CreateReference(node, "Body"),
+ Serialize(node.Body)));
+ }
+ if (ShouldSerialize(node.Block))
+ {
+ mie.NamedArguments.Add(
+ new ExpressionPair(
+ CreateReference(node, "Block"),
+ Serialize(node.Block)));
+ }
+ Push(mie);
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ override public void OnAwaitExpression(Boo.Lang.Compiler.Ast.AwaitExpression node)
+ {
+ MethodInvocationExpression mie = new MethodInvocationExpression(
+ node.LexicalInfo,
+ CreateReference(node, "Boo.Lang.Compiler.Ast.AwaitExpression"));
+ mie.Arguments.Add(Serialize(node.LexicalInfo));
+ if (ShouldSerialize(node.BaseExpression))
+ {
+ mie.NamedArguments.Add(
+ new ExpressionPair(
+ CreateReference(node, "BaseExpression"),
+ Serialize(node.BaseExpression)));
+ }
+ Push(mie);
+ }
+
[System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
override public void OnCustomStatement(Boo.Lang.Compiler.Ast.CustomStatement node)
{
diff --git a/src/Boo.Lang.Compiler/Ast/Impl/DepthFirstGuide.cs b/src/Boo.Lang.Compiler/Ast/Impl/DepthFirstGuide.cs
index 5e6eae5ed..18df61b2f 100755
--- a/src/Boo.Lang.Compiler/Ast/Impl/DepthFirstGuide.cs
+++ b/src/Boo.Lang.Compiler/Ast/Impl/DepthFirstGuide.cs
@@ -2141,6 +2141,54 @@ void IAstVisitor.OnTypeofExpression(Boo.Lang.Compiler.Ast.TypeofExpression node)
if (handler != null)
handler(node);
}
+ public event NodeEvent OnAsyncBlockExpression;
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ void IAstVisitor.OnAsyncBlockExpression(Boo.Lang.Compiler.Ast.AsyncBlockExpression node)
+ {
+ {
+ var parameters = node.Parameters;
+ if (parameters != null)
+ {
+ var innerList = parameters.InnerList;
+ var count = innerList.Count;
+ for (var i=0; i OnAwaitExpression;
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ void IAstVisitor.OnAwaitExpression(Boo.Lang.Compiler.Ast.AwaitExpression node)
+ {
+ {
+ var baseExpression = node.BaseExpression;
+ if (baseExpression != null)
+ baseExpression.Accept(this);
+ }
+ var handler = OnAwaitExpression;
+ if (handler != null)
+ handler(node);
+ }
public event NodeEvent OnCustomStatement;
[System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
diff --git a/src/Boo.Lang.Compiler/Ast/Impl/DepthFirstTransformer.cs b/src/Boo.Lang.Compiler/Ast/Impl/DepthFirstTransformer.cs
index df1f6296b..019033db0 100755
--- a/src/Boo.Lang.Compiler/Ast/Impl/DepthFirstTransformer.cs
+++ b/src/Boo.Lang.Compiler/Ast/Impl/DepthFirstTransformer.cs
@@ -2707,6 +2707,85 @@ public virtual void LeaveTypeofExpression(Boo.Lang.Compiler.Ast.TypeofExpression
{
}
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ public virtual void OnAsyncBlockExpression(Boo.Lang.Compiler.Ast.AsyncBlockExpression node)
+ {
+ if (EnterAsyncBlockExpression(node))
+ {
+ Visit(node.Parameters);
+ TypeReference currentReturnTypeValue = node.ReturnType;
+ if (null != currentReturnTypeValue)
+ {
+ TypeReference newValue = (TypeReference)VisitNode(currentReturnTypeValue);
+ if (!object.ReferenceEquals(newValue, currentReturnTypeValue))
+ {
+ node.ReturnType = newValue;
+ }
+ }
+ Block currentBodyValue = node.Body;
+ if (null != currentBodyValue)
+ {
+ Block newValue = (Block)VisitNode(currentBodyValue);
+ if (!object.ReferenceEquals(newValue, currentBodyValue))
+ {
+ node.Body = newValue;
+ }
+ }
+ BlockExpression currentBlockValue = node.Block;
+ if (null != currentBlockValue)
+ {
+ BlockExpression newValue = (BlockExpression)VisitNode(currentBlockValue);
+ if (!object.ReferenceEquals(newValue, currentBlockValue))
+ {
+ node.Block = newValue;
+ }
+ }
+
+ LeaveAsyncBlockExpression(node);
+ }
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ public virtual bool EnterAsyncBlockExpression(Boo.Lang.Compiler.Ast.AsyncBlockExpression node)
+ {
+ return true;
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ public virtual void LeaveAsyncBlockExpression(Boo.Lang.Compiler.Ast.AsyncBlockExpression node)
+ {
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ public virtual void OnAwaitExpression(Boo.Lang.Compiler.Ast.AwaitExpression node)
+ {
+ if (EnterAwaitExpression(node))
+ {
+ Expression currentBaseExpressionValue = node.BaseExpression;
+ if (null != currentBaseExpressionValue)
+ {
+ Expression newValue = (Expression)VisitNode(currentBaseExpressionValue);
+ if (!object.ReferenceEquals(newValue, currentBaseExpressionValue))
+ {
+ node.BaseExpression = newValue;
+ }
+ }
+
+ LeaveAwaitExpression(node);
+ }
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ public virtual bool EnterAwaitExpression(Boo.Lang.Compiler.Ast.AwaitExpression node)
+ {
+ return true;
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ public virtual void LeaveAwaitExpression(Boo.Lang.Compiler.Ast.AwaitExpression node)
+ {
+ }
+
[System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
public virtual void OnCustomStatement(Boo.Lang.Compiler.Ast.CustomStatement node)
{
diff --git a/src/Boo.Lang.Compiler/Ast/Impl/DepthFirstVisitor.cs b/src/Boo.Lang.Compiler/Ast/Impl/DepthFirstVisitor.cs
index 08ccf00a3..54f9006c3 100755
--- a/src/Boo.Lang.Compiler/Ast/Impl/DepthFirstVisitor.cs
+++ b/src/Boo.Lang.Compiler/Ast/Impl/DepthFirstVisitor.cs
@@ -1694,6 +1694,51 @@ public virtual void LeaveTypeofExpression(Boo.Lang.Compiler.Ast.TypeofExpression
{
}
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ public virtual void OnAsyncBlockExpression(Boo.Lang.Compiler.Ast.AsyncBlockExpression node)
+ {
+ if (EnterAsyncBlockExpression(node))
+ {
+ Visit(node.Parameters);
+ Visit(node.ReturnType);
+ Visit(node.Body);
+ Visit(node.Block);
+ LeaveAsyncBlockExpression(node);
+ }
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ public virtual bool EnterAsyncBlockExpression(Boo.Lang.Compiler.Ast.AsyncBlockExpression node)
+ {
+ return true;
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ public virtual void LeaveAsyncBlockExpression(Boo.Lang.Compiler.Ast.AsyncBlockExpression node)
+ {
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ public virtual void OnAwaitExpression(Boo.Lang.Compiler.Ast.AwaitExpression node)
+ {
+ if (EnterAwaitExpression(node))
+ {
+ Visit(node.BaseExpression);
+ LeaveAwaitExpression(node);
+ }
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ public virtual bool EnterAwaitExpression(Boo.Lang.Compiler.Ast.AwaitExpression node)
+ {
+ return true;
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ public virtual void LeaveAwaitExpression(Boo.Lang.Compiler.Ast.AwaitExpression node)
+ {
+ }
+
[System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
public virtual void OnCustomStatement(Boo.Lang.Compiler.Ast.CustomStatement node)
{
diff --git a/src/Boo.Lang.Compiler/Ast/Impl/FastDepthFirstVisitor.cs b/src/Boo.Lang.Compiler/Ast/Impl/FastDepthFirstVisitor.cs
index c443c7e9a..c9684317e 100755
--- a/src/Boo.Lang.Compiler/Ast/Impl/FastDepthFirstVisitor.cs
+++ b/src/Boo.Lang.Compiler/Ast/Impl/FastDepthFirstVisitor.cs
@@ -1785,6 +1785,46 @@ public virtual void OnTypeofExpression(Boo.Lang.Compiler.Ast.TypeofExpression no
}
}
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
+ public virtual void OnAsyncBlockExpression(Boo.Lang.Compiler.Ast.AsyncBlockExpression node)
+ {
+ {
+ var parameters = node.Parameters;
+ if (parameters != null)
+ {
+ var innerList = parameters.InnerList;
+ var count = innerList.Count;
+ for (var i=0; iFalse
False
false
- v3.5
+ v4.5
@@ -32,6 +32,7 @@
prompt
4
+ false
pdbonly
@@ -40,6 +41,7 @@
TRACE;$(DefineConstants)
prompt
4
+ false
true
@@ -49,6 +51,7 @@
TRACE;DEBUG;IGNOREKEYFILE
prompt
4
+ false
False
@@ -71,6 +74,7 @@
full
AnyCPU
prompt
+ false
bin\Micro-Release\
@@ -80,6 +84,7 @@
pdbonly
AnyCPU
prompt
+ false
@@ -100,8 +105,10 @@
+
+
@@ -161,8 +168,10 @@
+
+
@@ -418,6 +427,13 @@
+
+
+
+
+
+
+
@@ -426,6 +442,7 @@
+
@@ -456,6 +473,8 @@
+
+
@@ -490,6 +509,7 @@
+
@@ -503,8 +523,11 @@
+
+
+
@@ -539,6 +562,7 @@
+
@@ -632,6 +656,7 @@
+
diff --git a/src/Boo.Lang.Compiler/CompilerErrorFactory.cs b/src/Boo.Lang.Compiler/CompilerErrorFactory.cs
index 854145027..dc3f59f78 100644
--- a/src/Boo.Lang.Compiler/CompilerErrorFactory.cs
+++ b/src/Boo.Lang.Compiler/CompilerErrorFactory.cs
@@ -967,7 +967,32 @@ public static CompilerError TypeExpected(Node node)
return Instantiate("BCE0177", node);
}
- public static CompilerError Instantiate(string code, Exception error, params object[] args)
+ public static CompilerError InvalidAsyncType(TypeReference tr)
+ {
+ return Instantiate("BCE0178", tr);
+ }
+
+ public static CompilerError InvalidAwaitType(Expression e)
+ {
+ return Instantiate("BCE0179", e);
+ }
+
+ public static CompilerError RestrictedAwaitType(Node n, IType t)
+ {
+ return Instantiate("BCE0180", n, t);
+ }
+
+ public static CompilerError UnsafeReturnInAsync(Expression e)
+ {
+ return Instantiate("BCE0181", e);
+ }
+
+ public static CompilerError MissingGetAwaiter(Expression e)
+ {
+ return Instantiate("BCE0182", e.LexicalInfo, e.ExpressionType);
+ }
+
+ public static CompilerError Instantiate(string code, Exception error, params object[] args)
{
return new CompilerError(code, error, args);
}
diff --git a/src/Boo.Lang.Compiler/CompilerWarningFactory.cs b/src/Boo.Lang.Compiler/CompilerWarningFactory.cs
index 7c6e8f3c8..27d155d3e 100644
--- a/src/Boo.Lang.Compiler/CompilerWarningFactory.cs
+++ b/src/Boo.Lang.Compiler/CompilerWarningFactory.cs
@@ -222,6 +222,11 @@ public static CompilerWarning MethodHidesInheritedNonVirtual(Node anchor, IMetho
return Instantiate("BCW0029", AstUtil.SafeLexicalInfo(anchor), hidingMethod, hiddenMethod);
}
+ public static CompilerWarning AsyncNoAwait(Method anchor)
+ {
+ return Instantiate("BCW0030", AstUtil.SafeLexicalInfo(anchor));
+ }
+
private static CompilerWarning Instantiate(string code, LexicalInfo location, params object[] args)
{
return new CompilerWarning(code, location, Array.ConvertAll