Пример #1
0
        private IGreenJsonSymbol CreateValue(int currentIndex)
        {
            int length             = currentIndex - SymbolStartIndex;
            IGreenJsonSymbol value = JsonValue.TryCreate(Json.AsSpan().Slice(SymbolStartIndex, length));

            if (value == null)
            {
                // Copy to a substring here, which is not necessary for JsonValue.TryCreate() anymore.
                Report(JsonParseErrors.UnrecognizedValue(Json.Substring(SymbolStartIndex, length), SymbolStartIndex, length));
                value = new GreenJsonUndefinedValueSyntax(length);
            }

            return(value);
        }
 public virtual TResult VisitUndefinedValueSyntax(GreenJsonUndefinedValueSyntax node, T arg) => DefaultVisit(node, arg);
 public override JsonValueSyntax VisitUndefinedValueSyntax(GreenJsonUndefinedValueSyntax green, JsonValueWithBackgroundSyntax parent)
     => new JsonUndefinedValueSyntax(parent, green);
Пример #4
0
 internal JsonUndefinedValueSyntax(JsonValueWithBackgroundSyntax parent, GreenJsonUndefinedValueSyntax green) : base(parent) => Green = green;