예제 #1
0
 public override bool IsSameType(MathObject other, IDictionary <string, MathObject> parameters)
 {
     return(other switch
     {
         MathSequence seq => IsSameType_Sequence(seq, parameters),
         MathToken token => IsSameType_Token(token, parameters),
         _ => false,
     });
예제 #2
0
 public MathSequence(MathToken token, Token leftBracket, Token rightBracket)
     : this(token)
 {
     LeftBracket    = leftBracket;
     RightBracket   = rightBracket;
     _toTokenString = ConstructorHelperBracket(leftBracket, Main, rightBracket);
     _toString      = _toTokenString.ToString();
     OriginalText   = _toTokenString.ToOriginalString().Trim();
 }
예제 #3
0
 private MathSequence(MathToken token)
 {
     List           = new ReadOnlyCollection <MathObject>(new[] { token });
     Main           = token.ToTokenString();
     Separator      = "";
     _toTokenString = Main;
     _toString      = _toTokenString.ToString();
     OriginalText   = token.OriginalText;
 }
예제 #4
0
        public MathSequence(MathToken token, Token supOrSub, Token left, MathObject math, Token right)
            : this(token)
        {
            if (supOrSub.Value == "^")
            {
                Sup       = math;
                _supFirst = true;
            }
            else
            {
                Sub = math;
            }

            _toTokenString = ConstructorHelperSupSub(_toTokenString, supOrSub, left, math.ToTokenString(), right);
            _toString      = _toTokenString.ToString();
            OriginalText   = _toTokenString.ToOriginalString().Trim();
        }