本文整理汇总了C#中Microsoft.Scripting.SourceSpan类的典型用法代码示例。如果您正苦于以下问题:C# SourceSpan类的具体用法?C# SourceSpan怎么用?C# SourceSpan使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SourceSpan类属于Microsoft.Scripting命名空间,在下文中一共展示了SourceSpan类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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));
}
}
开发者ID:jcteague,项目名称:ironruby,代码行数:35,代码来源:RuntimeErrorSink.cs
示例2: AliasStatement
public AliasStatement(bool isMethodAlias, string/*!*/ newName, string/*!*/ oldName, SourceSpan location)
: base(location) {
Assert.NotNull(newName, oldName);
_newName = newName;
_oldName = oldName;
_isMethodAlias = isMethodAlias;
}
开发者ID:jcteague,项目名称:ironruby,代码行数:7,代码来源:AliasStatement.cs
示例3: RegularExpression
public RegularExpression(List<Expression>/*!*/ pattern, RubyRegexOptions options, bool isCondition, SourceSpan location)
: base(location) {
Assert.NotNull(pattern);
_pattern = pattern;
_options = options;
}
开发者ID:BrianGenisio,项目名称:ironruby,代码行数:7,代码来源:RegularExpression.cs
示例4: AssignExpressionNode
public AssignExpressionNode(AssignOperations operation, WritableNode left, ExpressionNode value, SourceSpan sourceSpan)
: base(sourceSpan)
{
this.operation = operation;
this.left = left;
this.value = value;
}
开发者ID:Alxandr,项目名称:Totem-2.0,代码行数:7,代码来源:AssignExpressionNode.cs
示例5: ParallelAssignmentExpression
public ParallelAssignmentExpression(CompoundLeftValue/*!*/ lhs, CompoundRightValue/*!*/ rhs, SourceSpan location)
: base(null, location) {
Assert.NotNull(lhs, rhs);
_lhs = lhs;
_rhs = rhs;
}
开发者ID:BrianGenisio,项目名称:ironruby,代码行数:7,代码来源:ParallelAssignmentExpression.cs
示例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
);
}
}
开发者ID:mstram,项目名称:ironruby,代码行数:25,代码来源:MemberExpression.cs
示例7: Binary
public Binary(SourceSpan span, Operator op, Expression left, Expression right)
: base(span)
{
_op = op;
_left = left;
_right = right;
}
开发者ID:whoisjake,项目名称:Infix,代码行数:7,代码来源:Binary.cs
示例8: ElseIfClause
public ElseIfClause(Expression condition, List<Expression>/*!*/ statements, SourceSpan location)
: base(location) {
Assert.NotNullItems(statements);
_statements = statements;
_condition = condition;
}
开发者ID:mscottford,项目名称:ironruby,代码行数:7,代码来源:ElseIfClause.cs
示例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;
}
开发者ID:Jirapong,项目名称:main,代码行数:7,代码来源:CompiledCodeTest.cs
示例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
);
}
}
开发者ID:octavioh,项目名称:ironruby,代码行数:25,代码来源:MemberExpression.cs
示例11: OrExpression
public OrExpression(Expression/*!*/ left, Expression/*!*/ right, SourceSpan location)
: base(location) {
Assert.NotNull(left, right);
_left = left;
_right = right;
}
开发者ID:atczyc,项目名称:ironruby,代码行数:7,代码来源:OrExpression.cs
示例12: Program
public Program(SourceSpan span, SourceSpan start, SourceSpan end, Statement body)
: base(span)
{
_start = start;
_end = end;
_body = body;
}
开发者ID:whoisjake,项目名称:Infix,代码行数:7,代码来源:Program.cs
示例13: LocalVariable
internal LocalVariable(string/*!*/ name, SourceSpan location, int definitionLexicalDepth)
: base(name, location) {
Debug.Assert(definitionLexicalDepth >= -1);
_definitionLexicalDepth = definitionLexicalDepth;
_closureIndex = -1;
}
开发者ID:jschementi,项目名称:iron,代码行数:7,代码来源:LocalVariable.cs
示例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;
}
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:ClassDefinition.cs
示例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;
}
开发者ID:joshholmes,项目名称:ironruby,代码行数:7,代码来源:ForLoopExpression.cs
示例16: ConditionalExpression
public ConditionalExpression(Expression/*!*/ condition, Expression/*!*/ trueExpression, Expression/*!*/ falseExpression, SourceSpan location)
: base(location) {
Assert.NotNull(condition, trueExpression, falseExpression);
_condition = condition;
_trueExpression = trueExpression;
_falseExpression = falseExpression;
}
开发者ID:jschementi,项目名称:iron,代码行数:7,代码来源:ConditionalExpression.cs
示例17: ForLoopExpression
public ForLoopExpression(LexicalScope/*!*/ definedScope, Parameters/*!*/ variables, Expression/*!*/ list, Statements body, SourceSpan location)
: base(location) {
Assert.NotNull(definedScope, variables, list);
_block = new BlockDefinition(definedScope, variables, body, location);
_list = list;
}
开发者ID:jschementi,项目名称:iron,代码行数:7,代码来源:ForLoopExpression.cs
示例18: CompoundLeftValue
public CompoundLeftValue(List<LeftValue>/*!*/ leftValues, LeftValue unsplattedValue, SourceSpan location)
: base(location) {
Assert.NotNull(leftValues);
_leftValues = leftValues;
_unsplattedValue = unsplattedValue;
}
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:7,代码来源:CompoundLeftValue.cs
示例19: RangeExpression
public RangeExpression(Expression/*!*/ begin, Expression/*!*/ end, bool isExclusive,SourceSpan location)
: base(location) {
Assert.NotNull(begin, end);
_begin = begin;
_end = end;
_isExclusive = isExclusive;
}
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:7,代码来源:RangeExpression.cs
示例20: IsDefinedExpression
public IsDefinedExpression(Expression/*!*/ expression, SourceSpan location)
: base(location)
{
Assert.NotNull(expression);
_expression = expression;
}
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:IsDefinedExpression.cs
注:本文中的Microsoft.Scripting.SourceSpan类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论