Пример #1
0
        protected static IList <BadTokenWithPositionContext> TokenDetails <TToken>(
            IList <Token <TToken> > tokens,
            ITextIndexHelper translator)
        {
            var details = new BadTokenWithPositionContext[tokens.Count];

            for (int i = 0; i < details.Length; ++i)
            {
                details[i] = TokenDetails(tokens[i], translator);
            }

            return(details);
        }
Пример #2
0
        protected static IList <BadTokenWithPositionContext> TokenDetails(
            IList <BadToken> tokens,
            ITextIndexHelper translator)
        {
            var details = new BadTokenWithPositionContext[tokens.Count];

            for (int i = 0; i < details.Length; ++i)
            {
                var baseDetails = tokens[i];
                var location    = translator?.LinePosition(baseDetails.StartIndex);

                details[i] = new BadTokenWithPositionContext(baseDetails, location);
            }

            return(details);
        }
Пример #3
0
 private UnexpectedTokenException(string messagePrefix, BadTokenWithPositionContext token)
     : base(messagePrefix, new[] { token }, null)
 {
 }