示例#1
0
        public LaxError(CodeRange pos, string message, Exception ex) : base(message, ex)
        {
            if (pos == null)
                throw new ArgumentNullException("pos");

            Position = pos;
        }
示例#2
0
        /// <summary>
        /// Expand this position to cover the other position.
        /// </summary>
        /// <param name="end"></param>
        public CodeRange Expand2(ICodeRange pos)
        {
            var end = pos.CodeRange;
            var r = new CodeRange()
            {
                Start = this.Start,
                End = this.End,
            };
            if (end.Start < r.Start)
                r.Start = end.Start;
            if (r.End < end.End)
                r.End = end.End;

            return r;
        }
示例#3
0
 public SemanticError(CodeRange pos, string message, CodeRange existing = null) : base(pos, message)
 {
 }
示例#4
0
 public CodeRange(CodeRange a, CodeRange b)
 {
     Start = (a.Start < b.Start) ? a.Start : b.Start;
     End = (a.End > b.End) ? a.End : b.End;
 }