From 0fec1340eba828e95c489796eb0c7a4330120686 Mon Sep 17 00:00:00 2001 From: nicole mazzuca Date: Mon, 14 Sep 2020 15:07:02 -0700 Subject: [vcpkg manifest] Add documentation! (#13488) * [vcpkg docs] add docs for manifest files These are just for the maintainer docs, not user docs. * [vcpkg] EBNF-ify platform expression parsing this modifies nothing about what strings are accepted or rejected, it just moves stuff around. also adds tests. * [vcpkg docs] add manifest mode example * [wip] docs for augustin also fix tabs * [vcpkg manifest] switch to using maps for features * Apply suggestions from code review * un-experimentize format-manifest * flesh out the user manifest mode docs * CRs * billy CRs * final personal pass-thru --- toolsrc/include/vcpkg/base/json.h | 14 ++++++++++++++ toolsrc/include/vcpkg/platform-expression.h | 21 ++------------------- 2 files changed, 16 insertions(+), 19 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/json.h b/toolsrc/include/vcpkg/base/json.h index 54f84f611..66d147918 100644 --- a/toolsrc/include/vcpkg/base/json.h +++ b/toolsrc/include/vcpkg/base/json.h @@ -474,6 +474,20 @@ namespace vcpkg::Json return visit_value(value, visitor); } + template + Optional visit_map_field(StringView key, const Value& value, IDeserializer& visitor) + { + m_path.push_back(key); + auto res = internal_visit(value, visitor); + m_path.pop_back(); + return std::move(res); + } + template + Optional visit_map_field(StringView key, const Value& value, IDeserializer&& visitor) + { + return visit_map_field(key, value, visitor); + } + template Optional> array_elements(const Array& arr, IDeserializer& visitor) { diff --git a/toolsrc/include/vcpkg/platform-expression.h b/toolsrc/include/vcpkg/platform-expression.h index 43ae6e89d..5de13b7a2 100644 --- a/toolsrc/include/vcpkg/platform-expression.h +++ b/toolsrc/include/vcpkg/platform-expression.h @@ -76,24 +76,7 @@ namespace vcpkg::PlatformExpression Allow, }; - // platform expression parses the following : - // : - // - // - // - // : - // ( ) - // - // : - // A lowercase alpha-numeric string - // : - // - // ! - // - // - // & - // - // - // | + // platform expression parses a platform expression; the EBNF of such is defined in + // /docs/maintainers/manifest-files.md#supports ExpectedS parse_platform_expression(StringView expression, MultipleBinaryOperators multiple_binary_operators); } -- cgit v1.2.3