.NET CIL Browser - Back to table of contents

Source file: FoxTextLiteralToken.cs

Files in FoxPro directory:

FoxCommentToken.cs

FoxSyntaxProvider.cs

FoxTextLiteralToken.cs

FoxTokenFactory.cs

/* CIL Browser (https://github.com/MSDN-WhiteKnight/CilBrowser)
 * Copyright (c) 2023,  MSDN.WhiteKnight 
 * License: BSD 3-Clause */
using System;
using System.Collections.Generic;
using System.Text;
using CilTools.Syntax.Tokens;

namespace CilBrowser.Core.SyntaxModel.FoxPro
{
    public class FoxTextLiteralToken : SyntaxTokenDefinition
    {
        public override bool HasStart(TokenReader reader)
        {
            char c = reader.PeekChar();
            return c == '"' || c=='\'' || c == '[';
        }
        
        public override bool HasContinuation(string prevPart, TokenReader reader)
        {
            if (prevPart.Length <= 1) return true;

            char c = prevPart[prevPart.Length - 1];

            if (c == '"' && prevPart[0] == '"')
            {
                return false;
            }
            else if (c == '\'' && prevPart[0] == '\'')
            {
                return false;
            }
            else if (c == ']' && prevPart[0] == '[')
            {
                return false;
            }
            else return true;
        }
    }
}
View in source control

Back to table of contents


Generated by CIL Browser