~alexreg/mathtexdotnet/0.1

« back to all changes in this revision

Viewing changes to TexDotNet/TexHelper.cs

  • Committer: Alex Regueiro
  • Date: 2009-09-30 17:48:09 UTC
  • Revision ID: alexreg@gmail.com-20090930174809-gjvb1o0ekuu4fuh1
Parser now correctly handles expressions where infix operators are read in a LTR fashion.

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
                throw new ParserException(TexToken.Null, "Unexpected end of token stream.");
69
69
        }
70
70
 
 
71
        public static bool IsLtrInfixOperator(this TexSymbolKind symbol)
 
72
        {
 
73
            switch (symbol)
 
74
            {
 
75
                case TexSymbolKind.Plus:
 
76
                case TexSymbolKind.Minus:
 
77
                case TexSymbolKind.PlusMinus:
 
78
                case TexSymbolKind.MinusPlus:
 
79
                case TexSymbolKind.Cross:
 
80
                case TexSymbolKind.Dot:
 
81
                case TexSymbolKind.Star:
 
82
                case TexSymbolKind.Divide:
 
83
                case TexSymbolKind.Over:
 
84
                case TexSymbolKind.InlineModulo:
 
85
                    return true;
 
86
                default:
 
87
                    return false;
 
88
            }
 
89
        }
 
90
 
71
91
        public static bool IsLongOperator(this TexSymbolKind symbol)
72
92
        {
73
93
            switch (symbol)