Skip to content
This repository was archived by the owner on Oct 23, 2019. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/tfs/default'
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge branch 'master' of github.com:DEVSENSE/Phalanger

Conflicts:
	Source/Core/Compiler/AST/ArrayEx.cs
	Source/Core/Compiler/AST/Expression.cs
	Source/Core/Compiler/AST/ListEx.cs

Merge remote-tracking branch 'refs/remotes/tfs/default'

Conflicts:
	Source/Core/Compiler/AST/AssignEx.cs
	Source/Core/Compiler/AST/ConstantUse.cs
	Source/Core/Compiler/AST/DirectVariableUse.cs
	Source/Core/Compiler/AST/FieldUse.cs
	Source/Core/Compiler/AST/FunctionCall.cs
	Source/Core/Compiler/AST/FunctionDecl.cs
	Source/Core/Compiler/AST/ItemUse.cs
	Source/Core/Compiler/AST/LambdaFunctionExpr.cs
	Source/Core/Compiler/AST/NewAndInstanceof.cs
	Source/Core/Compiler/AST/TryStmt.cs
	Source/Core/Compiler/AST/TypeDecl.cs

Merge remote-tracking branch 'refs/remotes/tfs/default'

Conflicts:
	Source/Core/Compiler/AST/AssignEx.cs
	Source/Core/Compiler/AST/ConstantUse.cs
	Source/Core/Compiler/AST/DirectVariableUse.cs
	Source/Core/Compiler/AST/FieldUse.cs
	Source/Core/Compiler/AST/FunctionCall.cs
	Source/Core/Compiler/AST/FunctionDecl.cs
	Source/Core/Compiler/AST/ItemUse.cs
	Source/Core/Compiler/AST/LambdaFunctionExpr.cs
	Source/Core/Compiler/AST/NewAndInstanceof.cs
	Source/Core/Compiler/AST/TryStmt.cs
	Source/Core/Compiler/AST/TypeDecl.cs

merge from TFS

Merge remote-tracking branch 'refs/remotes/tfs/default'

missing files from git-tfs merge

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge remote-tracking branch 'refs/remotes/tfs/default'

Merge branch 'master' of github.com:DEVSENSE/Phalanger

PHP 5.5 string literal dereferencing

PHP 5.5 array dereferencing

PHP 5.5 class name resolution via ::class

Originally checked in by DEVSENSE\Administrator on 2014-02-08 11:15:55.89 as Changeset 4946

git-tfs-id: [https://devsense.visualstudio.com/DefaultCollection]$/Phalanger/Main;C7154
  • Loading branch information
Anonymous authored and Anonymous committed Feb 7, 2015
1 parent 839c3af commit f958e34
Show file tree
Hide file tree
Showing 17 changed files with 2,243 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*.suo
*.user
*.sln.docstates
*.vspscc

# Build results
*_i.c
Expand Down
23 changes: 23 additions & 0 deletions Source/Core/Compiler/AST/AssignEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,24 @@ public override Evaluation Analyze(AssignEx node, Analyzer analyzer, ExInfoFromP

// x[] .= y -> x[] = null . y
if (oldop == Operations.AssignAppend)
<<<<<<< HEAD
valueassignex.rvalue = new BinaryEx(node.Position, Operations.Concat, new NullLiteral(node.Position), valueassignex.rvalue);
// x[] += y -> x[] = 0 + y
else if (oldop == Operations.AssignAdd)
valueassignex.rvalue = new BinaryEx(node.Position, Operations.Add, new NullLiteral(node.Position), valueassignex.rvalue);
// x[] -= y -> x[] = 0 - y
else if (oldop == Operations.AssignSub)
valueassignex.rvalue = new BinaryEx(node.Position, Operations.Sub, new NullLiteral(node.Position), valueassignex.rvalue);
// x[] *= y -> x[] = 0 * y
else if (oldop == Operations.AssignMul)
valueassignex.rvalue = new BinaryEx(node.Position, Operations.Mul, new NullLiteral(node.Position), valueassignex.rvalue);
// x[] /= y -> x[] = 0 / y
else if (oldop == Operations.AssignDiv)
valueassignex.rvalue = new BinaryEx(node.Position, Operations.Div, new NullLiteral(node.Position), valueassignex.rvalue);
// x[] &= y -> x[] = 0 & y
else if (oldop == Operations.AssignAnd)
valueassignex.rvalue = new BinaryEx(node.Position, Operations.BitAnd, new NullLiteral(node.Position), valueassignex.rvalue);
=======
valueassignex.rvalue = new BinaryEx(node.Span, Operations.Concat, new NullLiteral(node.Span), valueassignex.rvalue);
// x[] += y -> x[] = 0 + y
else if (oldop == Operations.AssignAdd)
Expand All @@ -82,6 +100,7 @@ public override Evaluation Analyze(AssignEx node, Analyzer analyzer, ExInfoFromP
// x[] &= y -> x[] = 0 & y
else if (oldop == Operations.AssignAnd)
valueassignex.rvalue = new BinaryEx(node.Span, Operations.BitAnd, new NullLiteral(node.Span), valueassignex.rvalue);
>>>>>>> refs/remotes/tfs/default
else
{
Debug.Fail("Unhandled operation " + oldop.ToString() + " must be reduced!");
Expand Down Expand Up @@ -533,7 +552,11 @@ public override Evaluation Analyze(AssignEx node, Analyzer analyzer, ExInfoFromP
if (refassignex.RValue is NewEx)
{
//PhpException.Throw(PhpError.Deprecated, CoreResources.GetString("assign_new_as_ref_is_deprecated"));
<<<<<<< HEAD
analyzer.ErrorSink.Add(Warnings.AssignNewByRefDeprecated, analyzer.SourceUnit, node.Position);
=======
analyzer.ErrorSink.Add(Warnings.AssignNewByRefDeprecated, analyzer.SourceUnit, node.Span);
>>>>>>> refs/remotes/tfs/default
}

return new Evaluation(node);
Expand Down
12 changes: 12 additions & 0 deletions Source/Core/Compiler/AST/ConstantUse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ public override Evaluation EvaluatePriorAnalysis(GlobalConstUse node, Compilatio
internal override void ResolveName(GlobalConstUse/*!*/node, Analyzer/*!*/ analyzer)
{
if (constant == null)
<<<<<<< HEAD
constant = analyzer.ResolveGlobalConstantName(node.Name, node.Position);
=======
constant = analyzer.ResolveGlobalConstantName(node.Name, node.Span);
>>>>>>> refs/remotes/tfs/default
}

/// <include file='Doc/Nodes.xml' path='doc/method[@name="Emit"]/*'/>
Expand Down Expand Up @@ -157,7 +161,11 @@ internal override void ResolveName(T node, Analyzer analyzer)
// analyze constructed type (we are in the full analysis):
analyzer.AnalyzeConstructedType(type);

<<<<<<< HEAD
constant = analyzer.ResolveClassConstantName(type, node.Name, node.Position, analyzer.CurrentType, analyzer.CurrentRoutine,
=======
constant = analyzer.ResolveClassConstantName(type, node.Name, node.Span, analyzer.CurrentType, analyzer.CurrentRoutine,
>>>>>>> refs/remotes/tfs/default
out runtimeVisibilityCheck);
}

Expand Down Expand Up @@ -311,7 +319,11 @@ private object Evaluate(PseudoConstUse node, Analyzer/*!*/ analyzer)
switch (node.Type)
{
case PseudoConstUse.Types.Line:
<<<<<<< HEAD
return (int)node.Position.FirstLine; // __LINE__ is of type Integer in PHP
=======
return (int)new Text.TextPoint(analyzer.SourceUnit, node.Span.Start).Line; // __LINE__ is of type Integer in PHP
>>>>>>> refs/remotes/tfs/default

case PseudoConstUse.Types.Class:
if (analyzer.CurrentType != null)
Expand Down
12 changes: 12 additions & 0 deletions Source/Core/Compiler/AST/DirectVariableUse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ public override Evaluation Analyze(DirectVarUse node, Analyzer analyzer, ExInfoF
// report misuse of $this if we are sure about it, that is in a static routine:
if (analyzer.CurrentRoutine != null && analyzer.CurrentRoutine.IsStatic)
{
<<<<<<< HEAD
analyzer.ErrorSink.Add(Warnings.ThisOutOfMethod, analyzer.SourceUnit, node.Position);
=======
analyzer.ErrorSink.Add(Warnings.ThisOutOfMethod, analyzer.SourceUnit, node.Span);
>>>>>>> refs/remotes/tfs/default
}

if (!(info.Parent is VarLikeConstructUse) // $this->a = 1; is ok, but $this has write AT
Expand All @@ -57,7 +61,11 @@ public override Evaluation Analyze(DirectVarUse node, Analyzer analyzer, ExInfoF
|| access == AccessType.ReadRef
|| access == AccessType.ReadUnknown))
{
<<<<<<< HEAD
analyzer.ErrorSink.Add(Warnings.ThisInWriteContext, analyzer.SourceUnit, node.Position);
=======
analyzer.ErrorSink.Add(Warnings.ThisInWriteContext, analyzer.SourceUnit, node.Span);
>>>>>>> refs/remotes/tfs/default
}
}

Expand All @@ -68,7 +76,11 @@ public override Evaluation Analyze(DirectVarUse node, Analyzer analyzer, ExInfoF
Debug.Assert(analyzer.SourceUnit.CompilationUnit.IsPure);

// variables used in global context when we do not have global variable table:
<<<<<<< HEAD
analyzer.ErrorSink.Add(Errors.GlobalCodeInPureUnit, analyzer.SourceUnit, node.Position);
=======
analyzer.ErrorSink.Add(Errors.GlobalCodeInPureUnit, analyzer.SourceUnit, node.Span);
>>>>>>> refs/remotes/tfs/default
}
else
analyzer.CurrentVarTable.Set(node.VarName, var_shall_be_ref);
Expand Down
4 changes: 4 additions & 0 deletions Source/Core/Compiler/AST/FieldUse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@ public override Evaluation Analyze(DirectStFldUse node, Analyzer analyzer, ExInf
{
base.Analyze(node, analyzer, info);

<<<<<<< HEAD
property = analyzer.ResolveProperty(type, node.PropertyName, node.Position, true, analyzer.CurrentType, analyzer.CurrentRoutine, out runtimeVisibilityCheck);
=======
property = analyzer.ResolveProperty(type, node.PropertyName, node.Span, true, analyzer.CurrentType, analyzer.CurrentRoutine, out runtimeVisibilityCheck);
>>>>>>> refs/remotes/tfs/default

return new Evaluation(node);
}
Expand Down
Loading

0 comments on commit f958e34

Please sign in to comment.