Beispiel #1
0
 static void SearchFunctionCall(ParseNode obj)
 {
     var indexInParent = obj.PositionInParent();
     var blockStates = obj.Parent.States;
     if (blockStates[indexInParent + 1].Token != TokenKind.OpenParen)
         return;
     var functionData = FunctionTypeData.GetFunctionData(blockStates[indexInParent].Content);
     if (functionData == null)
         return;
     if (functionData.ParamTypes.Length == 0)
         return;
     var closeParen = blockStates.GeNextTokenKind(TokenKind.CloseParen, indexInParent);
     var commas = blockStates.GetAllOfToken(TokenKind.Comma, indexInParent + 1, closeParen);
     if (commas.Count != functionData.ParamTypes.Length - 1)
         return;
     commas.Add(closeParen);
     var startRange = indexInParent + 2;
     for (var i = 0; i < commas.Count; i++)
     {
         var commaPos = commas[i];
         var endRange = commaPos - 1;
         if (startRange == endRange && blockStates[startRange].Token != TokenKind.Identifier)
         {
             TryHandleParameter(functionData.ParamTypes, i, blockStates, startRange);
         }
         if (startRange == endRange && blockStates[startRange].Content == "null")
         {
             TryHandleParameterNull(functionData.ParamTypes, i, blockStates, startRange);
         }
         startRange = endRange + 2;
     }
 }
Beispiel #2
0
 protected override void FixLogic(ParseNode node)
 {
     var advancePosition = node.PositionInParent();
     var states = node.Parent.Children.GetCleanStates();
     var replaceNode = states.ShiftSharpDefineProperty(advancePosition);
     var propertyData = replaceNode.States;
     var propName = propertyData[1].Content;
     var propType = propertyData[0].Content;
     var propValue = propertyData[3].Content;
     PropertyDictionary.SetProperty(propName, propType, propValue);
     if (replaceNode.Children != null)
         replaceNode.Children.Clear();
 }
Beispiel #3
0
 protected override void FixLogic(ParseNode node)
 {
     var advancePosition = node.PositionInParent();
     var cleanStates = node.Parent.Children.GetCleanStates();
     cleanStates.ShiftSharpDefineDeclaration(advancePosition);
 }