예제 #1
0
        public TomlValue Eval(TomlValue table)
        {
            var tomlValue = result?.Eval(table) ?? table;

            if (tomlValue is TomlTable tomlTable)
            {
                return(tomlTable.pairs.ElementAt(index).Value);
            }
            else if (tomlValue is TomlArray tomlArray)
            {
                return(tomlArray.Value[index]);
            }

            throw new TPathException("indexation only support arrays and tables");
        }
예제 #2
0
 public TomlValue Eval(TomlValue table)
 {
     return(pathExpression.Eval(result.Eval(table)));
 }