コード例 #1
0
ファイル: ScriptExtent.cs プロジェクト: bitwiseman/Pash
 public ScriptExtent(SourceSpan origSpan, int startOffset, int endOffset)
 {
     if (startOffset == 0 && endOffset == 0)
     {
         _span = origSpan;
         return;
     }
     // create a new span with offsets
     var location = origSpan.Location;
     // we don't adjust line and column for artifical offsets. This is hopefully okay.
     var newLocation = new SourceLocation(location.Position + startOffset, location.Line, location.Column);
     // don't forget to subtract the start offset here
     _span = new SourceSpan(newLocation, origSpan.Length + endOffset - startOffset);
 }
コード例 #2
0
 protected TextSpan CreateSpanFor(SourceSpan span, Source source)
 {
     return CreateSpanFor(span.Location, span.EndPosition, source);
 }
コード例 #3
0
 public void SetSpan(SourceSpan sourceSpan)
 {
     Span = sourceSpan;
 }
コード例 #4
0
ファイル: Label.cs プロジェクト: DanielKeep/Dk.Dasm
 /// <summary>
 /// Fix the label to the given label.
 /// </summary>
 public void Fix(Label fixTo, SourceSpan span)
 {
     this.ForwardsTo = fixTo;
     this.Span = span;
 }
コード例 #5
0
ファイル: Label.cs プロジェクト: DanielKeep/Dk.Dasm
 /// <summary>
 /// Fix the label to the given value.
 /// </summary>
 public void Fix(ushort value, SourceSpan span)
 {
     this.Value = value;
     this.Span = span;
     this.Fixed = true;
 }
コード例 #6
0
 public static CodeGen At(this CodeGen cg, SourceSpan span)
 {
     return cg.At(span.Location.Line + 1, span.Location.Column, span.Location.Line + 1, span.Location.Column + span.Length);
 }