Example #1
0
 public void Simple()
 {
     var text = "@( ertzu )@";
     var source = new Source(text) + 0;
     var length = Lexer.Instance.Text(source);
     Tracer.Assert(length != null && length.Value == text.Length);
 }
Example #2
0
 internal static Syntax Parse(string text, bool trace)
 {
     var source = new Source(text);
     MainTokenFactory.Parser.Trace = trace;
     NestedTokenFactory.Parser.Trace = trace;
     var result = MainTokenFactory.Parser.Execute(source + 0);
     MainTokenFactory.Parser.Trace = false;
     NestedTokenFactory.Parser.Trace = false;
     return result;
 }
Example #3
0
        public void FromLineAndColumn()
        {
            var source = new Source(Text);

            var s = source.FromLineAndColumn(0, 0);
            Tracer.Assert(s.LineIndex == 0);
            Tracer.Assert(s.ColumnIndex == 0);

            s = source.FromLineAndColumn(1, 2);
            Tracer.Assert(s.LineIndex == 1);
            Tracer.Assert(s.ColumnIndex == 2);

            s = source.FromLineAndColumn(2, 12);
            Tracer.Assert(s.LineIndex == 2);
            Tracer.Assert(s.ColumnIndex == 6);

            s = source.FromLineAndColumn(100, 12);
            Tracer.Assert(s.LineIndex == 9);
            Tracer.Assert(s.ColumnIndex == 0);
        }
Example #4
0
 internal FileTestCompiler(Source file) { }
Example #5
0
 static void Run(Source file)
 {
      new FileTestCompiler(file).Run();
 }