本文整理汇总了C#中AstNode.GetProp方法的典型用法代码示例。如果您正苦于以下问题:C# AstNode.GetProp方法的具体用法?C# AstNode.GetProp怎么用?C# AstNode.GetProp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AstNode
的用法示例。
在下文中一共展示了AstNode.GetProp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetBody
/// <summary>Sets function body, and sets its parent to this node.</summary>
/// <remarks>
/// Sets function body, and sets its parent to this node.
/// Also sets the encoded source bounds based on the body bounds.
/// Assumes the function node absolute position has already been set,
/// and the body node's absolute position and length are set.<p>
/// </remarks>
/// <param name="body">
/// function body. Its parent is set to this node, and its
/// position is updated to be relative to this node.
/// </param>
/// <exception cref="System.ArgumentException">
/// if body is
/// <code>null</code>
/// </exception>
public virtual void SetBody(AstNode body)
{
AssertNotNull(body);
this.body = body;
if (true.Equals(body.GetProp(Node.EXPRESSION_CLOSURE_PROP)))
{
SetIsExpressionClosure(true);
}
int absEnd = body.GetPosition() + body.GetLength();
body.SetParent(this);
this.SetLength(absEnd - this.position);
SetEncodedSourceBounds(this.position, absEnd);
}