當前位置: 首頁>>代碼示例>>C#>>正文


C# Scripting.SourceSpan類代碼示例

本文整理匯總了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));
            }
        }
開發者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


注:本文中的Microsoft.Scripting.SourceSpan類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。