public override bool Walk(CallNode node) { if (node != null) { if (node.Function != null) { node.Function.Walk(this); } if (node.Arguments != null) { foreach (var arg in node.Arguments) { if (arg != null) { arg.Walk(this); } } } } return(false); }
private static bool IsSpecialRequire(AnalysisUnit unit, CallNode n, ref IAnalysisSet res) { bool hitLiteral = false; if (n.Arguments.Length == 1) { var ee = new ExpressionEvaluator(unit); foreach (var name in ee.MergeStringLiterals(n.Arguments[0])) { hitLiteral = true; res = res.Union( unit.Analyzer.Modules.RequireModule( n, unit, name, unit.DeclaringModuleEnvironment.Name ) ); } } return hitLiteral; }
public override bool Walk(CallNode node) { AddNode(node); return true; }
public override bool Walk(CallNode node) { if (node != null) { if (node.Function != null) { node.Function.Walk(this); } if (node.Arguments != null) { foreach (var arg in node.Arguments) { if (arg != null) { arg.Walk(this); } } } } return false; }
public override void PostWalk(CallNode node) { base.PostWalk(node); if (!node.InBrackets) { HasSideEffects = true; } }
public override bool Walk(CallNode node) { node.Function.Walk(this); if (node.IsConstructor) { ReplaceFollowingWhiteSpace(node.GetStartIndex(_tree.LocationResolver) + "new".Length, " "); } if (!node.InBrackets) { ReplaceFollowingWhiteSpace( node.Function.GetEndIndex(_tree.LocationResolver), "" ); } if (node.Arguments != null && node.Arguments.Length > 0) { bool isMultiLine = ContainsLineFeed(node.Function.GetEndIndex(_tree.LocationResolver), node.Arguments[0].GetStartIndex(_tree.LocationResolver)); Debug.Assert(node.Arguments[0] != null); if (node.Arguments[0] != null) { if (isMultiLine && ShouldIndentForChild(node, node.Arguments[0])) { Indent(); } ReplacePreceedingWhiteSpaceMaybeMultiline( node.Arguments[0].GetStartIndex(_tree.LocationResolver), '(', !_options.SpaceAfterOpeningAndBeforeClosingNonEmptyParenthesis ); node.Arguments[0].Walk(this); if (isMultiLine && ShouldIndentForChild(node, node.Arguments[0])) { Dedent(); } for (int i = 1; i < node.Arguments.Length; i++) { Debug.Assert(node.Arguments[i] != null); if (node.Arguments[i] != null) { if (isMultiLine && ShouldIndentForChild(node, node.Arguments[i])) { Indent(); } ReplacePreceedingWhiteSpace( node.Arguments[i].GetStartIndex(_tree.LocationResolver), _options.SpaceAfterComma ? " " : string.Empty, _comma); node.Arguments[i].Walk(this); if (isMultiLine && ShouldIndentForChild(node, node.Arguments[i])) { Dedent(); } } } } } if (!node.InBrackets) { ReplacePreceedingWhiteSpaceMaybeMultiline( node.GetEndIndex(_tree.LocationResolver) - 1, empty: !_options.SpaceAfterOpeningAndBeforeClosingNonEmptyParenthesis ); } return false; }