本文整理汇总了C#中Microsoft.Scripting.SourceSpan类的典型用法代码示例。如果您正苦于以下问题:C# SourceSpan类的具体用法?C# SourceSpan怎么用?C# SourceSpan使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SourceSpan类属于Microsoft.Scripting命名空间,在下文中一共展示了SourceSpan类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Add
public override void Add(SourceUnit sourceUnit, string message, SourceSpan span, int errorCode, Severity severity) {
if (severity == Severity.Warning && !ReportWarning(_context.Verbose, errorCode)) {
return;
}
CountError(severity);
string path;
string codeLine;
int line = span.Start.Line;
if (sourceUnit != null) {
path = sourceUnit.Path;
codeLine = (line > 0) ? sourceUnit.GetCodeLine(line) : null;
} else {
path = null;
codeLine = null;
}
if (severity == Severity.Error || severity == Severity.FatalError) {
throw new SyntaxError(message, path, line, span.Start.Column, codeLine);
} else {
if (_WriteSite == null) {
Interlocked.CompareExchange(
ref _WriteSite,
CallSite<Func<CallSite, object, object, object>>.Create(RubyCallAction.Make(_context, "write", 1)),
null
);
}
message = RubyContext.FormatErrorMessage(message, "warning", path, line, span.Start.Column, null);
_WriteSite.Target(_WriteSite, _context.StandardErrorOutput, MutableString.CreateMutable(message));
}
}
示例2: AliasStatement
public AliasStatement(bool isMethodAlias, string/*!*/ newName, string/*!*/ oldName, SourceSpan location)
: base(location) {
Assert.NotNull(newName, oldName);
_newName = newName;
_oldName = oldName;
_isMethodAlias = isMethodAlias;
}
示例3: RegularExpression
public RegularExpression(List<Expression>/*!*/ pattern, RubyRegexOptions options, bool isCondition, SourceSpan location)
: base(location) {
Assert.NotNull(pattern);
_pattern = pattern;
_options = options;
}
示例4: AssignExpressionNode
public AssignExpressionNode(AssignOperations operation, WritableNode left, ExpressionNode value, SourceSpan sourceSpan)
: base(sourceSpan)
{
this.operation = operation;
this.left = left;
this.value = value;
}
示例5: ParallelAssignmentExpression
public ParallelAssignmentExpression(CompoundLeftValue/*!*/ lhs, CompoundRightValue/*!*/ rhs, SourceSpan location)
: base(null, location) {
Assert.NotNull(lhs, rhs);
_lhs = lhs;
_rhs = rhs;
}
示例6: TransformSet
internal override MSAst.Expression TransformSet(SourceSpan span, MSAst.Expression right, PythonOperationKind op) {
if (op == PythonOperationKind.None) {
return GlobalParent.AddDebugInfoAndVoid(
GlobalParent.Set(
typeof(object),
_name,
_target,
right
),
span
);
} else {
MSAst.ParameterExpression temp = Ast.Variable(typeof(object), "inplace");
return GlobalParent.AddDebugInfo(
Ast.Block(
new[] { temp },
Ast.Assign(temp, _target),
SetMemberOperator(right, op, temp),
AstUtils.Empty()
),
Span.Start,
span.End
);
}
}
示例7: Binary
public Binary(SourceSpan span, Operator op, Expression left, Expression right)
: base(span)
{
_op = op;
_left = left;
_right = right;
}
示例8: ElseIfClause
public ElseIfClause(Expression condition, List<Expression>/*!*/ statements, SourceSpan location)
: base(location) {
Assert.NotNullItems(statements);
_statements = statements;
_condition = condition;
}
示例9: ErrorReported
public override void ErrorReported(ScriptSource source, string message, SourceSpan span, int errorCode, Severity severity) {
_source = source;
_message = message;
_span = span;
_errorCode = errorCode;
// _severity = severity;
}
示例10: TransformSet
internal override MSAst.Expression TransformSet(AstGenerator ag, SourceSpan span, MSAst.Expression right, Operators op) {
if (op == Operators.None) {
return ag.AddDebugInfoAndVoid(
Binders.Set(
ag.BinderState,
typeof(object),
SymbolTable.IdToString(_name),
ag.Transform(_target),
right
),
span
);
} else {
MSAst.ParameterExpression temp = ag.GetTemporary("inplace");
return ag.AddDebugInfo(
Ast.Block(
Ast.Assign(temp, ag.Transform(_target)),
SetMemberOperator(ag, right, op, temp),
Ast.Empty()
),
Span.Start,
span.End
);
}
}
示例11: OrExpression
public OrExpression(Expression/*!*/ left, Expression/*!*/ right, SourceSpan location)
: base(location) {
Assert.NotNull(left, right);
_left = left;
_right = right;
}
示例12: Program
public Program(SourceSpan span, SourceSpan start, SourceSpan end, Statement body)
: base(span)
{
_start = start;
_end = end;
_body = body;
}
示例13: LocalVariable
internal LocalVariable(string/*!*/ name, SourceSpan location, int definitionLexicalDepth)
: base(name, location) {
Debug.Assert(definitionLexicalDepth >= -1);
_definitionLexicalDepth = definitionLexicalDepth;
_closureIndex = -1;
}
示例14: ClassDefinition
public ClassDefinition(LexicalScope/*!*/ definedScope, ConstantVariable/*!*/ name, Expression superClass, Body/*!*/ body, SourceSpan location)
: base(definedScope, name, body, location)
{
ContractUtils.RequiresNotNull(name, "name");
_superClass = superClass;
}
示例15: ForLoopExpression
public ForLoopExpression(CompoundLeftValue/*!*/ variables, Expression/*!*/ list, Statements body, SourceSpan location)
: base(location) {
Assert.NotNull(variables, list);
_block = new BlockDefinition(null, variables, body, location);
_list = list;
}