コード例 #1
0
 public override void Visit(CompositeTerm composite)
 {
     // remove blank raws
     for (int i = 0; i < composite.Terms.Count; i++)
     {
         if (composite.Terms[i] is RawTerm {
             Content: ""
         })
コード例 #2
0
        public override void Visit(CompositeTerm composite)
        {
            var           prefix = new CompositeTerm(new List <Term>());
            CompositeTerm suffix = null;

            for (int i = 0; i < composite.Terms.Count; i++)
            {
                if (composite.Terms[i] is DividerTerm)
                {
                    prefix = new CompositeTerm(new List <Term>());
                    suffix = null;
                }
                else if (composite.Terms[i] is LeftRightTerm newLeftRightTerm)
                {
                    composite.Terms.RemoveRange(i - prefix.Terms.Count, prefix.Terms.Count);
                    i -= prefix.Terms.Count;

                    if (newLeftRightTerm.Left is not RawTerm {
                        Content: ""
                    })
コード例 #3
0
ファイル: TermVisitor.cs プロジェクト: famoser/FexCompiler
 public virtual void Visit(CompositeTerm composite)
 {
     composite.Terms.ForEach(t => t.Accept(this));
 }