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"); }
public TomlValue Eval(TomlValue table) { return(pathExpression.Eval(result.Eval(table))); }