📄 defaultparser.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using Fireball.Syntax;
//no parsing , just splitting and making whitespace possible
//1 sec to finnish ca 10000 rows
namespace Fireball.Syntax.SyntaxDocumentParsers
{
public class ScanResult_Segment
{
public Pattern Pattern = null;
public int Position = 0;
public bool IsEndSegment = false;
public bool HasContent = false;
public string Token = "";
public BlockType BlockType = null;
public Segment Segment = null;
public Scope Scope = null;
}
public class ScanResult_Word
{
public Pattern Pattern = null;
public bool HasContent = false;
public string Token = "";
public int Position = 0;
public PatternList ParentList = null;
}
/// <summary>
///
/// </summary>
public sealed class DefaultParser : IParser
{
private Language mLanguage;
private SyntaxDocument mDocument;
private long Version = 0;
/// <summary>
///
/// </summary>
public Language Language
{
get { return mLanguage; }
set
{
mLanguage = value;
this.Document.ReParse();
}
}
#region PUBLIC PROPERTY SEPARATORS
public string Separators
{
get
{
return this.Language.Separators;
}
set
{
this.Language.Separators = value;
}
}
#endregion
#region Optimerat och klart
// ska anropas om "is same but different" 鋜 true
private void MakeSame(int RowIndex)
{
Row row = Document[RowIndex];
Segment seg = null;
Segment OldStartSegment = Document[RowIndex + 1].StartSegment;
//copy back the old segments to this line...
seg = row.EndSegment;
Segment seg2 = Document[RowIndex + 1].StartSegment;
while (seg != null)
{
foreach (Word w in row)
{
if (w.Segment == seg)
{
if (w.Segment.StartWord == w)
seg2.StartWord = w;
if (w.Segment.EndWord == w)
seg2.EndWord = w;
w.Segment = seg2;
}
}
if (seg == row.StartSegment)
row.StartSegment = seg2;
if (seg == row.EndSegment)
row.EndSegment = seg2;
if (row.StartSegments.IndexOf(seg) >= 0)
row.StartSegments[row.StartSegments.IndexOf(seg)] = seg2;
if (row.EndSegments.IndexOf(seg) >= 0)
row.EndSegments[row.EndSegments.IndexOf(seg)] = seg2;
seg = seg.Parent;
seg2 = seg2.Parent;
}
row.SetExpansionSegment();
}
//om denna 鋜 true
// s
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -