예제 #1
0
        public IJsonItem Parse(string json)
        {
            (IMatchData matchData, bool success, int _, int?failureIndex, string _) = _languageMatchEngine.Match(json);
            if (!success)
            {
                int line = EngineUtils.GetLineNumber(json, failureIndex.Value);
                throw new LanaguageSyntaxException($"Syntax error at line {line}: {EngineUtils.GetLine(json, line, 100).Trim()}...", failureIndex.Value);
            }
            JsonItem item = GetJsonItem(((FragmentMatchData)matchData).Parts[0]);

            item.Load(false);
            return(item);
        }