Skip to content
This repository was archived by the owner on Jan 3, 2025. It is now read-only.

Update unity-trunk to match unity3.5 #4

Merged
merged 24 commits into from
Jan 10, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
79dda18
pattern matching for list literals
bamboo Oct 25, 2011
5f4db52
update doc: 'and' patterns are supported
bamboo Oct 25, 2011
8e95d62
remove duplication and simplify extension recognition by removing the…
bamboo Oct 26, 2011
406be68
remove unused method
bamboo Oct 26, 2011
4500a7a
remove unused constants
bamboo Oct 26, 2011
f71500b
unused imports
bamboo Oct 26, 2011
33bff8c
inline TypeSystemServices.AstNode
bamboo Oct 27, 2011
81da6bd
unused method removed
bamboo Oct 27, 2011
786ef47
prefer generic containers
bamboo Oct 27, 2011
9357637
minor refactorings
bamboo Oct 27, 2011
d26dd8c
unused variable
bamboo Oct 27, 2011
1a66cc9
update precompiled binaries and bump build number
bamboo Nov 1, 2011
60d2126
prefer embedded statements over single statement blocks
bamboo Nov 2, 2011
4727a92
don't emit conditional branching instructions when the condition is a…
bamboo Nov 2, 2011
0994dee
Merge branch 'master' of github.com:bamboo/boo
bamboo Nov 2, 2011
b38861c
minor code cleanup
bamboo Nov 8, 2011
eb49598
don't emit unreacheable code warnings for compiler generated code
bamboo Nov 8, 2011
9ccdc67
minor code cleanup
bamboo Nov 8, 2011
8322d7f
ensure 'unreachable code' warnings are emitted for expanded expressio…
bamboo Nov 8, 2011
ab1bc21
Merge branch 'master' of github.com:bamboo/boo
bamboo Nov 8, 2011
e1e4e5b
reserved member name prefixes are no more!
bamboo Nov 10, 2011
fe88236
code cleanup
bamboo Nov 12, 2011
134731d
enable support for the 4.0.30319 runtime
bamboo Dec 8, 2011
7d92c92
Merge pull request #3 from Unity-Technologies/master
Tak Dec 8, 2011
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified bin/Boo.Lang.CodeDom.dll
Binary file not shown.
Binary file modified bin/Boo.Lang.Compiler.dll
Binary file not shown.
Binary file modified bin/Boo.Lang.Extensions.dll
Binary file not shown.
Binary file modified bin/Boo.Lang.Interpreter.dll
Binary file not shown.
Binary file modified bin/Boo.Lang.Parser.dll
Binary file not shown.
Binary file modified bin/Boo.Lang.PatternMatching.dll
Binary file not shown.
Binary file modified bin/Boo.Lang.Useful.dll
Binary file not shown.
Binary file modified bin/Boo.Lang.dll
Binary file not shown.
Empty file modified bin/Boo.Microsoft.Build.targets
100755 → 100644
Empty file.
Binary file modified bin/Boo.NAnt.Tasks.dll
100755 → 100644
Binary file not shown.
Binary file modified bin/booc.exe
100755 → 100644
Binary file not shown.
Binary file modified bin/booi.exe
100755 → 100644
Binary file not shown.
5 changes: 3 additions & 2 deletions bin/booi.exe.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<NetFx40_LegacySecurityPolicy enabled="true" />
</runtime>
<startup>
<supportedRuntime version="v2.0.50727"/>
<supportedRuntime version="v1.1.4322"/>
<supportedRuntime version="v4.0.30319" />
<supportedRuntime version="v2.0.50727" />
<supportedRuntime version="v1.1.4322" />
</startup>
</configuration>
Binary file modified bin/booish.exe
100755 → 100644
Binary file not shown.
5 changes: 3 additions & 2 deletions bin/booish.exe.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<NetFx40_LegacySecurityPolicy enabled="true" />
</runtime>
<startup>
<supportedRuntime version="v2.0.50727"/>
<supportedRuntime version="v1.1.4322"/>
<supportedRuntime version="v4.0.30319" />
<supportedRuntime version="v2.0.50727" />
<supportedRuntime version="v1.1.4322" />
</startup>
</configuration>
2 changes: 1 addition & 1 deletion default.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project name="boo" default="all">

<property name="boo.major.minor.release.version" value="0.9.5" />
<property name="boo.build.number" value="4" />
<property name="boo.build.number" value="5" />
<property name="boo.version" value="${boo.major.minor.release.version}.${boo.build.number}" dynamic="True" />
<property name="boo.assembly.version" value="2.${boo.major.minor.release.version}" />

Expand Down
30 changes: 17 additions & 13 deletions src/Boo.Lang.Compiler/Ast/Block.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ public Block(params Statement[] statements)

public void Clear()
{
if (null != _statements) _statements = null;
_statements = null;
}

public bool IsEmpty
{
get { return (null == _statements || Statements.IsEmpty); }
get { return (_statements == null || Statements.IsEmpty); }
}

[Obsolete("HasStatements is Obsolete, use IsEmpty instead")]
Expand Down Expand Up @@ -82,7 +82,6 @@ public Statement LastStatement
{
get { return IsEmpty ? null : Statements.Last; }
}


public override Block ToBlock()
{
Expand All @@ -91,36 +90,41 @@ public override Block ToBlock()

public void Add(Statement stmt)
{
Block block = stmt as Block;
if (null != block)
var block = stmt as Block;
if (block != null)
Add(block);
else
this.Statements.Add(stmt);
Statements.Add(stmt);
}

public void Add(Block block)
{
if (block.HasAnnotations)
{
this.Statements.Add(block);
Statements.Add(block);
return;
}
this.Statements.Extend(block.Statements);
Statements.Extend(block.Statements);
}

public void Add(Expression expression)
{
this.Statements.Add(new ExpressionStatement(expression));
Statements.Add(StatementFor(expression));
}

public void Insert(int index, Expression expression)
{
this.Statements.Insert(index, new ExpressionStatement(expression));
Statements.Insert(index, StatementFor(expression));
}

public void Insert(int index, Statement stmt)
{
this.Statements.Insert(index, stmt);
Statements.Insert(index, stmt);
}

private static Statement StatementFor(Expression expression)
{
return Statement.Lift(expression);
}

public Statement Simplify()
Expand Down
2 changes: 1 addition & 1 deletion src/Boo.Lang.Compiler/Ast/Statement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static Statement Lift(Statement node)

public static Statement Lift(Expression node)
{
return new ExpressionStatement(node);
return new ExpressionStatement(node) { IsSynthetic = node.IsSynthetic };
}

public Statement()
Expand Down
5 changes: 0 additions & 5 deletions src/Boo.Lang.Compiler/CompilerErrorFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -519,11 +519,6 @@ public static CompilerError CantCreateInstanceOfEnum(Node node, IType typeName)
return Instantiate("BCE0087", node, typeName);
}

public static CompilerError ReservedPrefix(Node node, string prefix)
{
return Instantiate("BCE0088", node, prefix);
}

public static CompilerError MemberNameConflict(Node node, IType declaringType, string memberName)
{
return Instantiate("BCE0089", node, declaringType, memberName);
Expand Down
42 changes: 11 additions & 31 deletions src/Boo.Lang.Compiler/Steps/CheckMemberNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@

namespace Boo.Lang.Compiler.Steps
{
public class CheckMemberNames : AbstractVisitorCompilerStep
public sealed class CheckMemberNames : AbstractVisitorCompilerStep
{
protected Dictionary<string, List<TypeMember>> _members = new Dictionary<string, List<TypeMember>>(StringComparer.Ordinal);
private Dictionary<string, List<TypeMember>> _members = new Dictionary<string, List<TypeMember>>(StringComparer.Ordinal);

override public void Dispose()
{
Expand Down Expand Up @@ -74,15 +74,13 @@ override public void LeaveEnumDefinition(EnumDefinition node)
{
_members.Clear();
foreach (TypeMember member in node.Members)
{
if (_members.ContainsKey(member.Name))
MemberNameConflict(member);
else
_members[member.Name] = new List<TypeMember>() { member };
}
}

protected void CheckMember(List<TypeMember> list, TypeMember member)
private void CheckMember(List<TypeMember> list, TypeMember member)
{
switch (member.NodeType)
{
Expand Down Expand Up @@ -111,15 +109,13 @@ protected void CheckMember(List<TypeMember> list, TypeMember member)
}


protected void CheckNonOverloadableMember(List<TypeMember> existing, TypeMember member)
private void CheckNonOverloadableMember(List<TypeMember> existing, TypeMember member)
{
if (existing.Count > 0)
{
MemberNameConflict(member);
}
}

protected void CheckOverloadableMember(List<TypeMember> existing, TypeMember member)
private void CheckOverloadableMember(List<TypeMember> existing, TypeMember member)
{
var expectedNodeType = member.NodeType;
foreach (TypeMember existingMember in existing)
Expand Down Expand Up @@ -167,40 +163,24 @@ bool IsGenericityTheSame(TypeMember lhs, TypeMember rhs)
bool AreDifferentInterfaceMembers(IExplicitMember lhs, IExplicitMember rhs)
{
if (lhs.ExplicitInfo == null && rhs.ExplicitInfo == null)
{
return false;
}

if (
lhs.ExplicitInfo != null &&
rhs.ExplicitInfo != null &&
lhs.ExplicitInfo.InterfaceType.Entity == rhs.ExplicitInfo.InterfaceType.Entity
)
{
return false;
}

return true;
return lhs.ExplicitInfo == null || rhs.ExplicitInfo == null || lhs.ExplicitInfo.InterfaceType.Entity != rhs.ExplicitInfo.InterfaceType.Entity;
}

bool AreDifferentConversionOperators(TypeMember existing, TypeMember actual)
{
if ((existing.Name == "op_Implicit" || existing.Name == "op_Explicit")
&& existing.Name == actual.Name
&& existing.NodeType == NodeType.Method
&& existing.IsStatic && actual.IsStatic)
&& existing.NodeType == NodeType.Method && existing.IsStatic && actual.IsStatic)
{
IMethod one = existing.Entity as IMethod;
IMethod two = actual.Entity as IMethod;
if (one != null && two != null && one.ReturnType != two.ReturnType)
{
return true;
}
return one != null && two != null && one.ReturnType != two.ReturnType;
}
return false;
}

protected void MemberNameConflict(TypeMember member)
private void MemberNameConflict(TypeMember member)
{
MemberConflict(member, member.Name);
}
Expand All @@ -220,7 +200,7 @@ List<TypeMember> GetMemberList(string name)
return list;
}

protected void CheckLikelyTypoInTypeMemberName(TypeMember member)
private void CheckLikelyTypoInTypeMemberName(TypeMember member)
{
foreach (string name in GetLikelyTypoNames(member))
{
Expand All @@ -237,7 +217,7 @@ protected void CheckLikelyTypoInTypeMemberName(TypeMember member)
}
}

protected virtual IEnumerable<string> GetLikelyTypoNames(TypeMember member)
private IEnumerable<string> GetLikelyTypoNames(TypeMember member)
{
char first = member.Name[0];
if (first == 'c' || first == 'C')
Expand Down
Loading