redsnow 0.3.7 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/Rakefile +4 -4
- data/ext/drafter/Makefile +54 -0
- data/ext/drafter/appveyor.yml +10 -0
- data/ext/drafter/bin/drafter +0 -0
- data/ext/{snowcrash → drafter}/build/Makefile +29 -14
- data/ext/{snowcrash/build/snowcrash.Makefile → drafter/build/drafter.Makefile} +1 -1
- data/ext/{snowcrash/build/snowcrash.target.mk → drafter/build/drafter.target.mk} +25 -23
- data/ext/{snowcrash/build → drafter/build/ext/snowcrash}/libmarkdownparser.target.mk +7 -7
- data/ext/drafter/build/ext/snowcrash/libsnowcrash.target.mk +152 -0
- data/ext/{snowcrash/build → drafter/build/ext/snowcrash}/libsundown.target.mk +13 -13
- data/ext/{snowcrash/build → drafter/build/ext/snowcrash}/perf-libsnowcrash.target.mk +14 -20
- data/ext/drafter/build/ext/snowcrash/snowcrash.Makefile +6 -0
- data/ext/{snowcrash → drafter}/build/gyp-mac-tool +0 -0
- data/ext/{snowcrash/build/libsnowcrash.target.mk → drafter/build/libdrafter.target.mk} +29 -36
- data/ext/drafter/build/libsos.target.mk +133 -0
- data/ext/drafter/build/out/Release/drafter +0 -0
- data/ext/drafter/build/out/Release/libdrafter.dylib +0 -0
- data/ext/drafter/build/out/Release/libmarkdownparser.a +0 -0
- data/ext/drafter/build/out/Release/libsnowcrash.a +0 -0
- data/ext/drafter/build/out/Release/libsos.a +0 -0
- data/ext/{snowcrash → drafter}/build/out/Release/libsundown.a +0 -0
- data/ext/{snowcrash → drafter}/build/out/Release/linker.lock +0 -0
- data/ext/drafter/build/out/Release/obj.target/drafter/src/config.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/drafter/src/main.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/drafter/src/reporting.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libdrafter/src/Serialize.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libdrafter/src/SerializeAST.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libdrafter/src/SerializeResult.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libdrafter/src/SerializeSourcemap.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libdrafter/src/cdrafter.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libdrafter/src/drafter.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libmarkdownparser/ext/snowcrash/ext/markdown-parser/src/ByteBuffer.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libmarkdownparser/ext/snowcrash/ext/markdown-parser/src/MarkdownNode.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libmarkdownparser/ext/snowcrash/ext/markdown-parser/src/MarkdownParser.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/Blueprint.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/BlueprintSourcemap.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/HTTP.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/HeadersParser.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/MSON.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/MSONOneOfParser.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/MSONSourcemap.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/MSONTypeSectionParser.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/MSONValueMemberParser.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/Section.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/Signature.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/UriTemplateParser.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/posix/RegexMatch.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/snowcrash.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsos/ext/sos/src/sos.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsundown/ext/snowcrash/ext/markdown-parser/ext/sundown/html/houdini_href_e.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsundown/ext/snowcrash/ext/markdown-parser/ext/sundown/html/houdini_html_e.o +0 -0
- data/ext/{snowcrash/build/out/Release/obj.target/libsundown → drafter/build/out/Release/obj.target/libsundown/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/html.o +0 -0
- data/ext/{snowcrash/build/out/Release/obj.target/libsundown → drafter/build/out/Release/obj.target/libsundown/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/html_smartypants.o +0 -0
- data/ext/{snowcrash/build/out/Release/obj.target/libsundown → drafter/build/out/Release/obj.target/libsundown/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/autolink.o +0 -0
- data/ext/{snowcrash/build/out/Release/obj.target/libsundown → drafter/build/out/Release/obj.target/libsundown/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/buffer.o +0 -0
- data/ext/{snowcrash/build/out/Release/obj.target/libsundown → drafter/build/out/Release/obj.target/libsundown/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/markdown.o +0 -0
- data/ext/{snowcrash/build/out/Release/obj.target/libsundown → drafter/build/out/Release/obj.target/libsundown/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/src_map.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsundown/ext/snowcrash/ext/markdown-parser/ext/sundown/src/stack.o +0 -0
- data/ext/drafter/circle.yml +12 -0
- data/ext/{snowcrash → drafter}/config.gypi +1 -1
- data/ext/{snowcrash → drafter}/config.mk +0 -0
- data/ext/{snowcrash → drafter}/configure +16 -5
- data/ext/drafter/drafter.gyp +118 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/Makefile +4 -12
- data/ext/{snowcrash → drafter/ext/snowcrash}/Vagrantfile +14 -4
- data/ext/drafter/ext/snowcrash/appveyor.yml +7 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/common.gypi +0 -0
- data/ext/drafter/ext/snowcrash/configure +197 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/Makefile +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/CONTRIBUTING.md +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/Makefile +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/Makefile.win +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/examples/smartypants.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/examples/sundown.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/houdini.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/houdini_href_e.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/houdini_html_e.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/html.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/html.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/html_smartypants.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html_block_names.txt +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/autolink.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/autolink.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/buffer.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/buffer.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/html_blocks.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/markdown.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/markdown.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/src_map.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/src_map.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/stack.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/stack.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/sundown.def +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/msvc/markdown/markdown.vcproj +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/msvc/msvc.sln +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/msvc/sundown/sundown.vcproj +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/src/ByteBuffer.cc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/src/ByteBuffer.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/src/MarkdownNode.cc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/src/MarkdownNode.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/src/MarkdownParser.cc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/src/MarkdownParser.h +10 -2
- data/ext/{snowcrash → drafter/ext/snowcrash}/provisioning.sh +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/snowcrash.gyp +41 -39
- data/ext/{snowcrash → drafter/ext/snowcrash}/snowcrash.xcworkspace/contents.xcworkspacedata +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/ActionParser.h +50 -6
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/AssetParser.h +1 -12
- data/ext/drafter/ext/snowcrash/src/AttributesParser.h +121 -0
- data/ext/drafter/ext/snowcrash/src/Blueprint.cc +90 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/Blueprint.h +169 -33
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/BlueprintParser.h +305 -48
- data/ext/drafter/ext/snowcrash/src/BlueprintSourcemap.cc +81 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/BlueprintSourcemap.h +130 -39
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/BlueprintUtility.h +10 -4
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/CodeBlockUtility.h +1 -1
- data/ext/drafter/ext/snowcrash/src/DataStructureGroupParser.h +154 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/HTTP.cc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/HTTP.h +0 -0
- data/ext/drafter/ext/snowcrash/src/HeadersParser.cc +110 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/HeadersParser.h +123 -54
- data/ext/drafter/ext/snowcrash/src/MSON.cc +272 -0
- data/ext/drafter/ext/snowcrash/src/MSON.h +399 -0
- data/ext/drafter/ext/snowcrash/src/MSONMixinParser.h +95 -0
- data/ext/drafter/ext/snowcrash/src/MSONNamedTypeParser.h +108 -0
- data/ext/drafter/ext/snowcrash/src/MSONOneOfParser.cc +132 -0
- data/ext/drafter/ext/snowcrash/src/MSONOneOfParser.h +80 -0
- data/ext/drafter/ext/snowcrash/src/MSONParameterParser.h +232 -0
- data/ext/drafter/ext/snowcrash/src/MSONPropertyMemberParser.h +91 -0
- data/ext/drafter/ext/snowcrash/src/MSONSourcemap.cc +141 -0
- data/ext/drafter/ext/snowcrash/src/MSONSourcemap.h +181 -0
- data/ext/drafter/ext/snowcrash/src/MSONTypeSectionParser.cc +209 -0
- data/ext/drafter/ext/snowcrash/src/MSONTypeSectionParser.h +213 -0
- data/ext/drafter/ext/snowcrash/src/MSONUtility.h +423 -0
- data/ext/drafter/ext/snowcrash/src/MSONValueMemberParser.cc +179 -0
- data/ext/drafter/ext/snowcrash/src/MSONValueMemberParser.h +346 -0
- data/ext/drafter/ext/snowcrash/src/ModelTable.h +87 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/ParameterParser.h +120 -61
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/ParametersParser.h +17 -18
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/PayloadParser.h +36 -18
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/Platform.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/RegexMatch.h +0 -0
- data/ext/drafter/ext/snowcrash/src/RelationParser.h +75 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/ResourceGroupParser.h +127 -33
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/ResourceParser.h +126 -33
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/Section.cc +6 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/Section.h +15 -2
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/SectionParser.h +3 -1
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/SectionParserData.h +15 -5
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/SectionProcessor.h +24 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/Signature.cc +14 -0
- data/ext/drafter/ext/snowcrash/src/Signature.h +80 -0
- data/ext/drafter/ext/snowcrash/src/SignatureSectionProcessor.h +439 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/SourceAnnotation.h +3 -2
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/StringUtility.h +103 -6
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/UriTemplateParser.cc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/UriTemplateParser.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/ValuesParser.h +1 -13
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/posix/RegexMatch.cc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/snowcrash.cc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/snowcrash.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/win/RegexMatch.cc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/AUTHORS +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/DEPS +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/OWNERS +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/PRESUBMIT.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/buildbot/buildbot_run.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/codereview.settings +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/data/win/large-pdb-shim.cc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/gyp +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/gyp.bat +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/gyp_main.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSNew.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSProject.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSSettings.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSToolFile.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSUserFile.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSUtil.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSVersion.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/__init__.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/__init__.pyc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/common.py +0 -0
- data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/common.pyc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/easy_xml.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/flock_tool.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/__init__.py +0 -0
- data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/generator/__init__.pyc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/android.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/cmake.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/dump_dependency_json.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/eclipse.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/gypd.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/gypsh.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/make.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/make.pyc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/msvs.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/ninja.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/xcode.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/xcode.pyc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/input.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/input.pyc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/mac_tool.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/msvs_emulation.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/ninja_syntax.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/ordered_dict.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/win_tool.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/xcode_emulation.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/xcode_emulation.pyc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/xcodeproj_file.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/xcodeproj_file.pyc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/xml_fix.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylintrc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/samples/samples +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/samples/samples.bat +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/setup.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/Xcode/Specifications/gyp.pbfilespec +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/Xcode/Specifications/gyp.xclangspec +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/emacs/gyp.el +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/graphviz.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/pretty_gyp.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/pretty_sln.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/pretty_vcproj.py +0 -0
- data/ext/drafter/ext/snowcrash/vcbuild.bat +139 -0
- data/ext/drafter/ext/sos/Makefile +57 -0
- data/ext/drafter/ext/sos/src/sos.cc +200 -0
- data/ext/drafter/ext/sos/src/sos.h +179 -0
- data/ext/drafter/ext/sos/src/sosJSON.h +105 -0
- data/ext/drafter/ext/sos/src/sosYAML.h +104 -0
- data/ext/{snowcrash → drafter}/src/Serialize.cc +30 -15
- data/ext/drafter/src/Serialize.h +135 -0
- data/ext/drafter/src/SerializeAST.cc +775 -0
- data/ext/drafter/src/SerializeAST.h +19 -0
- data/ext/drafter/src/SerializeResult.cc +67 -0
- data/ext/drafter/src/SerializeResult.h +26 -0
- data/ext/drafter/src/SerializeSourcemap.cc +446 -0
- data/ext/drafter/src/SerializeSourcemap.h +19 -0
- data/ext/drafter/src/Version.h +38 -0
- data/ext/drafter/src/cdrafter.cc +44 -0
- data/ext/drafter/src/cdrafter.h +55 -0
- data/ext/drafter/src/config.cc +80 -0
- data/ext/drafter/src/config.h +35 -0
- data/ext/drafter/src/drafter.cc +22 -0
- data/ext/drafter/src/drafter.h +38 -0
- data/ext/drafter/src/main.cc +91 -0
- data/ext/drafter/src/reporting.cc +162 -0
- data/ext/drafter/src/reporting.h +28 -0
- data/ext/drafter/src/stream.h +146 -0
- data/ext/drafter/tools/homebrew/drafter.rb +12 -0
- data/ext/{snowcrash → drafter}/vcbuild.bat +3 -3
- data/lib/redsnow.rb +6 -11
- data/lib/redsnow/binding.rb +11 -201
- data/lib/redsnow/blueprint.rb +104 -169
- data/lib/redsnow/parseresult.rb +28 -42
- data/lib/redsnow/sourcemap.rb +92 -177
- data/lib/redsnow/version.rb +1 -1
- data/redsnow.gemspec +1 -1
- metadata +249 -197
- data/ext/snowcrash/bin/snowcrash +0 -0
- data/ext/snowcrash/build/out/Release/libmarkdownparser.a +0 -0
- data/ext/snowcrash/build/out/Release/libsnowcrash.dylib +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libmarkdownparser/ext/markdown-parser/src/ByteBuffer.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libmarkdownparser/ext/markdown-parser/src/MarkdownNode.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libmarkdownparser/ext/markdown-parser/src/MarkdownParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/CBlueprint.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/CBlueprintSourcemap.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/CSourceAnnotation.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/HTTP.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/Section.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/Serialize.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/SerializeJSON.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/SerializeYAML.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/Signature.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/UriTemplateParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/csnowcrash.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/posix/RegexMatch.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/snowcrash.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/html/houdini_href_e.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/html/houdini_html_e.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/src/stack.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/snowcrash/src/snowcrash/snowcrash.o +0 -0
- data/ext/snowcrash/build/out/Release/snowcrash +0 -0
- data/ext/snowcrash/src/CBlueprint.cc +0 -628
- data/ext/snowcrash/src/CBlueprint.h +0 -366
- data/ext/snowcrash/src/CBlueprintSourcemap.cc +0 -630
- data/ext/snowcrash/src/CBlueprintSourcemap.h +0 -351
- data/ext/snowcrash/src/CSourceAnnotation.cc +0 -154
- data/ext/snowcrash/src/CSourceAnnotation.h +0 -106
- data/ext/snowcrash/src/Serialize.h +0 -71
- data/ext/snowcrash/src/SerializeJSON.cc +0 -1221
- data/ext/snowcrash/src/SerializeJSON.h +0 -24
- data/ext/snowcrash/src/SerializeYAML.cc +0 -702
- data/ext/snowcrash/src/SerializeYAML.h +0 -24
- data/ext/snowcrash/src/Signature.h +0 -32
- data/ext/snowcrash/src/SymbolTable.h +0 -94
- data/ext/snowcrash/src/Version.h +0 -39
- data/ext/snowcrash/src/csnowcrash.cc +0 -29
- data/ext/snowcrash/src/csnowcrash.h +0 -40
- data/ext/snowcrash/src/snowcrash/snowcrash.cc +0 -200
- data/ext/snowcrash/tools/gyp/pylib/gyp/common.pyc +0 -0
- data/ext/snowcrash/tools/gyp/pylib/gyp/generator/__init__.pyc +0 -0
- data/ext/snowcrash/tools/homebrew/snowcrash.rb +0 -12
@@ -1,24 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// SerializeJSON.h
|
3
|
-
// snowcrash
|
4
|
-
//
|
5
|
-
// Created by Zdenek Nemec on 4/27/13.
|
6
|
-
// Copyright (c) 2013 Apiary Inc. All rights reserved.
|
7
|
-
//
|
8
|
-
|
9
|
-
#ifndef SNOWCRASH_SERIALIZE_JSON_H
|
10
|
-
#define SNOWCRASH_SERIALIZE_JSON_H
|
11
|
-
|
12
|
-
#include <ostream>
|
13
|
-
#include "BlueprintSourcemap.h"
|
14
|
-
|
15
|
-
namespace snowcrash {
|
16
|
-
|
17
|
-
// Naive JSON serialization to ostream
|
18
|
-
void SerializeJSON(const snowcrash::Blueprint& blueprint, std::ostream &os);
|
19
|
-
|
20
|
-
// Naive Sourcmap JSON serialization to ostream
|
21
|
-
void SerializeSourceMapJSON(const snowcrash::SourceMap<snowcrash::Blueprint>& blueprint, std::ostream &os);
|
22
|
-
}
|
23
|
-
|
24
|
-
#endif
|
@@ -1,702 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// SerializeYAML.cc
|
3
|
-
// snowcrash
|
4
|
-
//
|
5
|
-
// Created by Zdenek Nemec on 5/3/13.
|
6
|
-
// Copyright (c) 2013 Apiary Inc. All rights reserved.
|
7
|
-
//
|
8
|
-
|
9
|
-
#include "Serialize.h"
|
10
|
-
#include "SerializeYAML.h"
|
11
|
-
|
12
|
-
using namespace snowcrash;
|
13
|
-
|
14
|
-
static std::string ReservedCharacters = "#-[]:|>!*&%@`,{}?\'";
|
15
|
-
|
16
|
-
/** Normalizes string value for use in YAML and checks whether quotation is need */
|
17
|
-
static std::string NormalizeStringValue(const std::string& value, bool& needsQuotation)
|
18
|
-
{
|
19
|
-
std::string normalizedValue = value;
|
20
|
-
|
21
|
-
if (normalizedValue.find("\"") != std::string::npos)
|
22
|
-
normalizedValue = EscapeDoubleQuotes(normalizedValue);
|
23
|
-
|
24
|
-
if (value.find("\n") != std::string::npos)
|
25
|
-
normalizedValue = EscapeNewlines(normalizedValue);
|
26
|
-
|
27
|
-
needsQuotation = (normalizedValue != value);
|
28
|
-
|
29
|
-
if (!needsQuotation) {
|
30
|
-
for (std::string::const_iterator it = value.begin() ; it < value.end() ; ++it){
|
31
|
-
needsQuotation = ReservedCharacters.find(*it) != std::string::npos;
|
32
|
-
if (needsQuotation)
|
33
|
-
break;
|
34
|
-
}
|
35
|
-
}
|
36
|
-
|
37
|
-
return normalizedValue;
|
38
|
-
}
|
39
|
-
|
40
|
-
|
41
|
-
/** Insert array item mark */
|
42
|
-
static void ArrayItemLeadIn(size_t level, std::ostream &os, bool withTrailingSpace = true)
|
43
|
-
{
|
44
|
-
if (level < 1)
|
45
|
-
return;
|
46
|
-
|
47
|
-
for (size_t i = 0; i < level - 1; ++i)
|
48
|
-
os << " ";
|
49
|
-
|
50
|
-
os << "-";
|
51
|
-
|
52
|
-
if (withTrailingSpace) {
|
53
|
-
os << " ";
|
54
|
-
}
|
55
|
-
}
|
56
|
-
|
57
|
-
/** Serialize key value pair */
|
58
|
-
static void serialize(const std::string& key, const std::string& value, size_t level, std::ostream &os, bool implicitQuotation = true)
|
59
|
-
{
|
60
|
-
if (key.empty())
|
61
|
-
return;
|
62
|
-
|
63
|
-
for (size_t i = 0; i < level; ++i)
|
64
|
-
os << " ";
|
65
|
-
|
66
|
-
if (!value.empty()) {
|
67
|
-
|
68
|
-
os << key << ": ";
|
69
|
-
|
70
|
-
bool needsQuotation = false;
|
71
|
-
std::string normalizedValue = NormalizeStringValue(value, needsQuotation);
|
72
|
-
|
73
|
-
if (implicitQuotation) {
|
74
|
-
// Always use quotation
|
75
|
-
os << "\"" << normalizedValue << "\"";
|
76
|
-
}
|
77
|
-
else {
|
78
|
-
if (needsQuotation)
|
79
|
-
os << "\"" << normalizedValue << "\"";
|
80
|
-
else
|
81
|
-
os << value;
|
82
|
-
}
|
83
|
-
|
84
|
-
os << std::endl;
|
85
|
-
}
|
86
|
-
else
|
87
|
-
os << key << ":\n";
|
88
|
-
}
|
89
|
-
|
90
|
-
/** Serialize source map without key into output stream */
|
91
|
-
static void serialize(const SourceMapBase& set, size_t level, std::ostream &os)
|
92
|
-
{
|
93
|
-
if (!set.sourceMap.empty()) {
|
94
|
-
size_t i = 0;
|
95
|
-
os << std::endl;
|
96
|
-
|
97
|
-
for (mdp::RangeSet<mdp::BytesRange>::const_iterator it = set.sourceMap.begin(); it != set.sourceMap.end(); ++i, ++it) {
|
98
|
-
|
99
|
-
ArrayItemLeadIn(level, os, false);
|
100
|
-
os << "\n";
|
101
|
-
ArrayItemLeadIn(level + 1, os);
|
102
|
-
os << it->location << "\n";
|
103
|
-
ArrayItemLeadIn(level + 1, os);
|
104
|
-
os << it->length << "\n";
|
105
|
-
}
|
106
|
-
} else {
|
107
|
-
os << " []\n";
|
108
|
-
}
|
109
|
-
}
|
110
|
-
|
111
|
-
/** Serialize a key and source map value into output stream. */
|
112
|
-
static void serialize(const std::string& key, const SourceMapBase& value, size_t level, std::ostream &os, bool keyLevelIsZero = false)
|
113
|
-
{
|
114
|
-
if (key.empty())
|
115
|
-
return;
|
116
|
-
|
117
|
-
if (!keyLevelIsZero) {
|
118
|
-
for (size_t i = 0; i < level; ++i)
|
119
|
-
os << " ";
|
120
|
-
}
|
121
|
-
|
122
|
-
os << key << ":";
|
123
|
-
serialize(value, level + 1, os);
|
124
|
-
}
|
125
|
-
|
126
|
-
/** Serializes source map collection */
|
127
|
-
static void serializeSourceMapCollection(const Collection<SourceMap<KeyValuePair> >::type& collection, size_t level, std::ostream &os)
|
128
|
-
{
|
129
|
-
for (Collection<SourceMap<KeyValuePair> >::const_iterator it = collection.begin();
|
130
|
-
it != collection.end();
|
131
|
-
++it) {
|
132
|
-
|
133
|
-
// Array item
|
134
|
-
ArrayItemLeadIn(level + 1, os, false);
|
135
|
-
|
136
|
-
// Source Map
|
137
|
-
serialize(*it, level + 2, os);
|
138
|
-
}
|
139
|
-
}
|
140
|
-
|
141
|
-
/** Serializes key value collection */
|
142
|
-
static void serializeKeyValueCollection(const Collection<KeyValuePair>::type& collection, size_t level, std::ostream &os)
|
143
|
-
{
|
144
|
-
for (Collection<KeyValuePair>::const_iterator it = collection.begin();
|
145
|
-
it != collection.end();
|
146
|
-
++it) {
|
147
|
-
|
148
|
-
// Array item
|
149
|
-
ArrayItemLeadIn(level + 1, os);
|
150
|
-
|
151
|
-
// Name
|
152
|
-
serialize(SerializeKey::Name, it->first, 0, os);
|
153
|
-
|
154
|
-
// Value
|
155
|
-
serialize(SerializeKey::Value, it->second, level + 1, os);
|
156
|
-
}
|
157
|
-
}
|
158
|
-
|
159
|
-
/** Serialize Metadata */
|
160
|
-
static void serialize(const Collection<Metadata>::type& metadata, std::ostream &os)
|
161
|
-
{
|
162
|
-
serialize(SerializeKey::Metadata, std::string(), 0, os);
|
163
|
-
|
164
|
-
if (metadata.empty())
|
165
|
-
return;
|
166
|
-
|
167
|
-
serializeKeyValueCollection(metadata, 0, os);
|
168
|
-
}
|
169
|
-
|
170
|
-
/** Serialize Metadata source map */
|
171
|
-
static void serialize(const Collection<SourceMap<Metadata> >::type& metadata, std::ostream &os)
|
172
|
-
{
|
173
|
-
serialize(SerializeKey::Metadata, std::string(), 0, os);
|
174
|
-
|
175
|
-
if (metadata.empty())
|
176
|
-
return;
|
177
|
-
|
178
|
-
serializeSourceMapCollection(metadata, 0, os);
|
179
|
-
}
|
180
|
-
|
181
|
-
|
182
|
-
/** Serialize Headers */
|
183
|
-
static void serialize(const Headers& headers, size_t level, std::ostream &os)
|
184
|
-
{
|
185
|
-
serializeKeyValueCollection(headers, level, os);
|
186
|
-
}
|
187
|
-
|
188
|
-
/** Serialize Headers source map */
|
189
|
-
static void serialize(const Collection<SourceMap<Header> >::type& headers, size_t level, std::ostream &os)
|
190
|
-
{
|
191
|
-
serializeSourceMapCollection(headers, level, os);
|
192
|
-
}
|
193
|
-
|
194
|
-
/** Serialize Parameters */
|
195
|
-
static void serialize(const Parameters& parameters, size_t level, std::ostream &os)
|
196
|
-
{
|
197
|
-
for (Collection<Parameter>::const_iterator it = parameters.begin(); it != parameters.end(); ++it) {
|
198
|
-
|
199
|
-
// Array item
|
200
|
-
ArrayItemLeadIn(level + 1, os);
|
201
|
-
|
202
|
-
// Key / name
|
203
|
-
serialize(SerializeKey::Name, it->name, 0, os);
|
204
|
-
|
205
|
-
// Description
|
206
|
-
serialize(SerializeKey::Description, it->description, level + 1, os);
|
207
|
-
|
208
|
-
// Type
|
209
|
-
serialize(SerializeKey::Type, it->type, level + 1, os);
|
210
|
-
|
211
|
-
// Required
|
212
|
-
serialize(SerializeKey::Required, (it->use == OptionalParameterUse) ? "false" : "true", level + 1, os, false);
|
213
|
-
|
214
|
-
// Default
|
215
|
-
serialize(SerializeKey::Default, it->defaultValue, level + 1, os);
|
216
|
-
|
217
|
-
// Example
|
218
|
-
serialize(SerializeKey::Example, it->exampleValue, level + 1, os);
|
219
|
-
|
220
|
-
// Values
|
221
|
-
serialize(SerializeKey::Values, std::string(), level + 1, os);
|
222
|
-
|
223
|
-
for (Collection<Value>::const_iterator val_it = it->values.begin();
|
224
|
-
val_it != it->values.end();
|
225
|
-
++val_it) {
|
226
|
-
|
227
|
-
ArrayItemLeadIn(level + 2, os);
|
228
|
-
|
229
|
-
serialize(SerializeKey::Value, *val_it, 0, os);
|
230
|
-
}
|
231
|
-
}
|
232
|
-
}
|
233
|
-
|
234
|
-
/** Serialize Parameters source map */
|
235
|
-
static void serialize(const Collection<SourceMap<Parameter> >::type& parameters, size_t level, std::ostream &os)
|
236
|
-
{
|
237
|
-
for (Collection<SourceMap<Parameter> >::const_iterator it = parameters.begin();
|
238
|
-
it != parameters.end();
|
239
|
-
++it) {
|
240
|
-
|
241
|
-
// Array item
|
242
|
-
ArrayItemLeadIn(level + 1, os);
|
243
|
-
|
244
|
-
// Key / name
|
245
|
-
serialize(SerializeKey::Name, it->name, level + 1, os, true);
|
246
|
-
|
247
|
-
// Description
|
248
|
-
serialize(SerializeKey::Description, it->description, level + 1, os);
|
249
|
-
|
250
|
-
// Type
|
251
|
-
serialize(SerializeKey::Type, it->type, level + 1, os);
|
252
|
-
|
253
|
-
// Required
|
254
|
-
serialize(SerializeKey::Required, it->use, level + 1, os);
|
255
|
-
|
256
|
-
// Default
|
257
|
-
serialize(SerializeKey::Default, it->defaultValue, level + 1, os);
|
258
|
-
|
259
|
-
// Example
|
260
|
-
serialize(SerializeKey::Example, it->exampleValue, level + 1, os);
|
261
|
-
|
262
|
-
// Values
|
263
|
-
serialize(SerializeKey::Values, std::string(), level + 1, os);
|
264
|
-
|
265
|
-
for (Collection<SourceMap<Value> >::const_iterator val_it = it->values.collection.begin();
|
266
|
-
val_it != it->values.collection.end();
|
267
|
-
++val_it) {
|
268
|
-
|
269
|
-
// Array item
|
270
|
-
ArrayItemLeadIn(level + 2, os);
|
271
|
-
|
272
|
-
// Source Map
|
273
|
-
serialize(*val_it, level + 3, os);
|
274
|
-
}
|
275
|
-
}
|
276
|
-
}
|
277
|
-
|
278
|
-
/** Serialize Reference */
|
279
|
-
static void serialize(const Reference& reference, size_t level, std::ostream &os)
|
280
|
-
{
|
281
|
-
if (reference.id.empty()) {
|
282
|
-
return;
|
283
|
-
}
|
284
|
-
|
285
|
-
serialize(SerializeKey::Reference, "", level - 1, os);
|
286
|
-
|
287
|
-
// ID
|
288
|
-
serialize(SerializeKey::Id, reference.id, level, os);
|
289
|
-
}
|
290
|
-
|
291
|
-
/** Serialize Reference source map */
|
292
|
-
static void serialize(const SourceMap<Reference>& reference, size_t level, std::ostream &os)
|
293
|
-
{
|
294
|
-
if (reference.sourceMap.empty()) {
|
295
|
-
return;
|
296
|
-
}
|
297
|
-
|
298
|
-
serialize(SerializeKey::Reference, reference, level - 1, os);
|
299
|
-
}
|
300
|
-
|
301
|
-
/** Serialize Payload */
|
302
|
-
static void serialize(const Payload& payload, size_t level, bool array, std::ostream &os)
|
303
|
-
{
|
304
|
-
for (size_t i = 0; i < level - 1; i++) {
|
305
|
-
os << " ";
|
306
|
-
}
|
307
|
-
|
308
|
-
if (array)
|
309
|
-
os << "- ";
|
310
|
-
else
|
311
|
-
os << " ";
|
312
|
-
|
313
|
-
// Name
|
314
|
-
serialize(SerializeKey::Name, payload.name, 0, os);
|
315
|
-
|
316
|
-
// Reference
|
317
|
-
serialize(payload.reference, level + 1, os);
|
318
|
-
|
319
|
-
// Description
|
320
|
-
serialize(SerializeKey::Description, payload.description, level, os);
|
321
|
-
|
322
|
-
// Headers
|
323
|
-
serialize(SerializeKey::Headers, std::string(), level, os);
|
324
|
-
|
325
|
-
if (!payload.headers.empty()) {
|
326
|
-
serialize(payload.headers, level, os);
|
327
|
-
}
|
328
|
-
|
329
|
-
// Body
|
330
|
-
serialize(SerializeKey::Body, payload.body, level, os);
|
331
|
-
|
332
|
-
// Schema
|
333
|
-
serialize(SerializeKey::Schema, payload.schema, level, os);
|
334
|
-
}
|
335
|
-
|
336
|
-
/** Serialize Payload source map */
|
337
|
-
static void serialize(const SourceMap<Payload>& payload, size_t level, bool array, std::ostream &os)
|
338
|
-
{
|
339
|
-
for (size_t i = 0; i < level - 1; i++) {
|
340
|
-
os << " ";
|
341
|
-
}
|
342
|
-
|
343
|
-
if (array)
|
344
|
-
os << "- ";
|
345
|
-
else
|
346
|
-
os << " ";
|
347
|
-
|
348
|
-
// Name
|
349
|
-
serialize(SerializeKey::Name, payload.name, level, os, true);
|
350
|
-
|
351
|
-
// Reference
|
352
|
-
serialize(payload.reference, level + 1, os);
|
353
|
-
|
354
|
-
// Description
|
355
|
-
serialize(SerializeKey::Description, payload.description, level, os);
|
356
|
-
|
357
|
-
// Headers
|
358
|
-
serialize(SerializeKey::Headers, std::string(), level, os);
|
359
|
-
|
360
|
-
if (!payload.headers.collection.empty()) {
|
361
|
-
serialize(payload.headers.collection, level, os);
|
362
|
-
}
|
363
|
-
|
364
|
-
// Body
|
365
|
-
serialize(SerializeKey::Body, payload.body, level, os);
|
366
|
-
|
367
|
-
// Schema
|
368
|
-
serialize(SerializeKey::Schema, payload.schema, level, os);
|
369
|
-
}
|
370
|
-
|
371
|
-
/** Serialize Transaction Example */
|
372
|
-
static void serialize(const TransactionExample& example, std::ostream &os)
|
373
|
-
{
|
374
|
-
os << " - "; // indent 4
|
375
|
-
|
376
|
-
// Name
|
377
|
-
serialize(SerializeKey::Name, example.name, 0, os);
|
378
|
-
|
379
|
-
// Description
|
380
|
-
serialize(SerializeKey::Description, example.description, 4, os);
|
381
|
-
|
382
|
-
// Requests
|
383
|
-
serialize(SerializeKey::Requests, std::string(), 4, os);
|
384
|
-
|
385
|
-
if (!example.requests.empty()) {
|
386
|
-
for (Collection<Request>::const_iterator it = example.requests.begin();
|
387
|
-
it != example.requests.end();
|
388
|
-
++it) {
|
389
|
-
|
390
|
-
serialize(*it, 5, true, os);
|
391
|
-
}
|
392
|
-
}
|
393
|
-
|
394
|
-
// Responses
|
395
|
-
serialize(SerializeKey::Responses, std::string(), 4, os);
|
396
|
-
|
397
|
-
if (!example.responses.empty()) {
|
398
|
-
for (Collection<Response>::const_iterator it = example.responses.begin();
|
399
|
-
it != example.responses.end();
|
400
|
-
++it) {
|
401
|
-
|
402
|
-
serialize(*it, 5, true, os);
|
403
|
-
}
|
404
|
-
}
|
405
|
-
}
|
406
|
-
|
407
|
-
/** Serialize Transaction Example source map */
|
408
|
-
static void serialize(const SourceMap<TransactionExample>& example, std::ostream &os)
|
409
|
-
{
|
410
|
-
os << " - "; // indent 4
|
411
|
-
|
412
|
-
// Name
|
413
|
-
serialize(SerializeKey::Name, example.name, 4, os, true);
|
414
|
-
|
415
|
-
// Description
|
416
|
-
serialize(SerializeKey::Description, example.description, 4, os);
|
417
|
-
|
418
|
-
// Requests
|
419
|
-
serialize(SerializeKey::Requests, std::string(), 4, os);
|
420
|
-
|
421
|
-
if (!example.requests.collection.empty()) {
|
422
|
-
for (Collection<SourceMap<Request> >::const_iterator it = example.requests.collection.begin();
|
423
|
-
it != example.requests.collection.end();
|
424
|
-
++it) {
|
425
|
-
|
426
|
-
serialize(*it, 5, true, os);
|
427
|
-
}
|
428
|
-
}
|
429
|
-
|
430
|
-
// Responses
|
431
|
-
serialize(SerializeKey::Responses, std::string(), 4, os);
|
432
|
-
|
433
|
-
if (!example.responses.collection.empty()) {
|
434
|
-
for (Collection<SourceMap<Response> >::const_iterator it = example.responses.collection.begin();
|
435
|
-
it != example.responses.collection.end();
|
436
|
-
++it) {
|
437
|
-
|
438
|
-
serialize(*it, 5, true, os);
|
439
|
-
}
|
440
|
-
}
|
441
|
-
}
|
442
|
-
|
443
|
-
/** Serialize Action */
|
444
|
-
static void serialize(const Action& action, std::ostream &os)
|
445
|
-
{
|
446
|
-
os << " - "; // indent 3
|
447
|
-
|
448
|
-
// Name
|
449
|
-
serialize(SerializeKey::Name, action.name, 0, os);
|
450
|
-
|
451
|
-
// Description
|
452
|
-
serialize(SerializeKey::Description, action.description, 3, os);
|
453
|
-
|
454
|
-
// HTTP method
|
455
|
-
serialize(SerializeKey::Method, action.method, 3, os);
|
456
|
-
|
457
|
-
// Parameters
|
458
|
-
serialize(SerializeKey::Parameters, std::string(), 3, os);
|
459
|
-
|
460
|
-
if (!action.parameters.empty())
|
461
|
-
serialize(action.parameters, 3, os);
|
462
|
-
|
463
|
-
// Examples
|
464
|
-
serialize(SerializeKey::Examples, std::string(), 3, os);
|
465
|
-
|
466
|
-
if (!action.examples.empty()) {
|
467
|
-
for (Collection<TransactionExample>::const_iterator it = action.examples.begin();
|
468
|
-
it != action.examples.end();
|
469
|
-
++it) {
|
470
|
-
|
471
|
-
serialize(*it, os);
|
472
|
-
}
|
473
|
-
}
|
474
|
-
}
|
475
|
-
|
476
|
-
/** Serialize Action source map */
|
477
|
-
static void serialize(const SourceMap<Action>& action, std::ostream &os)
|
478
|
-
{
|
479
|
-
os << " - "; // indent 3
|
480
|
-
|
481
|
-
// Name
|
482
|
-
serialize(SerializeKey::Name, action.name, 3, os, true);
|
483
|
-
|
484
|
-
// Description
|
485
|
-
serialize(SerializeKey::Description, action.description, 3, os);
|
486
|
-
|
487
|
-
// HTTP method
|
488
|
-
serialize(SerializeKey::Method, action.method, 3, os);
|
489
|
-
|
490
|
-
// Parameters
|
491
|
-
serialize(SerializeKey::Parameters, std::string(), 3, os);
|
492
|
-
|
493
|
-
if (!action.parameters.collection.empty())
|
494
|
-
serialize(action.parameters.collection, 3, os);
|
495
|
-
|
496
|
-
// Examples
|
497
|
-
serialize(SerializeKey::Examples, std::string(), 3, os);
|
498
|
-
|
499
|
-
if (!action.examples.collection.empty()) {
|
500
|
-
for (Collection<SourceMap<TransactionExample> >::const_iterator it = action.examples.collection.begin();
|
501
|
-
it != action.examples.collection.end();
|
502
|
-
++it) {
|
503
|
-
|
504
|
-
serialize(*it, os);
|
505
|
-
}
|
506
|
-
}
|
507
|
-
}
|
508
|
-
|
509
|
-
/** Serialize Resource */
|
510
|
-
static void serialize(const Resource& resource, std::ostream &os)
|
511
|
-
{
|
512
|
-
os << " - "; // indent 2
|
513
|
-
|
514
|
-
// Name
|
515
|
-
serialize(SerializeKey::Name, resource.name, 0, os);
|
516
|
-
|
517
|
-
// Description
|
518
|
-
serialize(SerializeKey::Description, resource.description, 2, os);
|
519
|
-
|
520
|
-
// URI Template
|
521
|
-
serialize(SerializeKey::URITemplate, resource.uriTemplate, 2, os);
|
522
|
-
|
523
|
-
// Model
|
524
|
-
serialize(SerializeKey::Model, std::string(), 2, os);
|
525
|
-
|
526
|
-
if (!resource.model.name.empty())
|
527
|
-
serialize(resource.model, 3, false, os);
|
528
|
-
|
529
|
-
// Parameters
|
530
|
-
serialize(SerializeKey::Parameters, std::string(), 2, os);
|
531
|
-
|
532
|
-
if (!resource.parameters.empty())
|
533
|
-
serialize(resource.parameters, 2, os);
|
534
|
-
|
535
|
-
// Actions
|
536
|
-
serialize(SerializeKey::Actions, std::string(), 2, os);
|
537
|
-
|
538
|
-
if (resource.actions.empty())
|
539
|
-
return;
|
540
|
-
|
541
|
-
for (Collection<Action>::const_iterator it = resource.actions.begin();
|
542
|
-
it != resource.actions.end();
|
543
|
-
++it) {
|
544
|
-
|
545
|
-
serialize(*it, os);
|
546
|
-
}
|
547
|
-
}
|
548
|
-
|
549
|
-
/** Serialize Resource source map */
|
550
|
-
static void serialize(const SourceMap<Resource>& resource, std::ostream &os)
|
551
|
-
{
|
552
|
-
os << " - "; // indent 2
|
553
|
-
|
554
|
-
// Name
|
555
|
-
serialize(SerializeKey::Name, resource.name, 2, os, true);
|
556
|
-
|
557
|
-
// Description
|
558
|
-
serialize(SerializeKey::Description, resource.description, 2, os);
|
559
|
-
|
560
|
-
// URI Template
|
561
|
-
serialize(SerializeKey::URITemplate, resource.uriTemplate, 2, os);
|
562
|
-
|
563
|
-
// Model
|
564
|
-
serialize(SerializeKey::Model, std::string(), 2, os);
|
565
|
-
|
566
|
-
if (!resource.model.name.sourceMap.empty())
|
567
|
-
serialize(resource.model, 3, false, os);
|
568
|
-
|
569
|
-
// Parameters
|
570
|
-
serialize(SerializeKey::Parameters, std::string(), 2, os);
|
571
|
-
|
572
|
-
if (!resource.parameters.collection.empty())
|
573
|
-
serialize(resource.parameters.collection, 2, os);
|
574
|
-
|
575
|
-
// Actions
|
576
|
-
serialize(SerializeKey::Actions, std::string(), 2, os);
|
577
|
-
|
578
|
-
if (resource.actions.collection.empty())
|
579
|
-
return;
|
580
|
-
|
581
|
-
for (Collection<SourceMap<Action> >::const_iterator it = resource.actions.collection.begin();
|
582
|
-
it != resource.actions.collection.end();
|
583
|
-
++it) {
|
584
|
-
|
585
|
-
serialize(*it, os);
|
586
|
-
}
|
587
|
-
}
|
588
|
-
|
589
|
-
/** Serialize Resource Group */
|
590
|
-
static void serialize(const ResourceGroup& group, std::ostream &os)
|
591
|
-
{
|
592
|
-
os << "- "; // indent 1
|
593
|
-
|
594
|
-
// Name
|
595
|
-
serialize(SerializeKey::Name, group.name, 0, os);
|
596
|
-
|
597
|
-
// Description
|
598
|
-
serialize(SerializeKey::Description, group.description, 1, os);
|
599
|
-
|
600
|
-
// Resources
|
601
|
-
serialize(SerializeKey::Resources, std::string(), 1, os);
|
602
|
-
|
603
|
-
if (group.resources.empty())
|
604
|
-
return;
|
605
|
-
|
606
|
-
for (Collection<Resource>::const_iterator it = group.resources.begin();
|
607
|
-
it != group.resources.end();
|
608
|
-
++it) {
|
609
|
-
|
610
|
-
serialize(*it, os);
|
611
|
-
}
|
612
|
-
}
|
613
|
-
|
614
|
-
/** Serialize Resource Group source map */
|
615
|
-
static void serialize(const SourceMap<ResourceGroup>& group, std::ostream &os)
|
616
|
-
{
|
617
|
-
os << "- "; // indent 1
|
618
|
-
|
619
|
-
// Name
|
620
|
-
serialize(SerializeKey::Name, group.name, 1, os, true);
|
621
|
-
|
622
|
-
// Description
|
623
|
-
serialize(SerializeKey::Description, group.description, 1, os);
|
624
|
-
|
625
|
-
// Resources
|
626
|
-
serialize(SerializeKey::Resources, std::string(), 1, os);
|
627
|
-
|
628
|
-
if (group.resources.collection.empty())
|
629
|
-
return;
|
630
|
-
|
631
|
-
for (Collection<SourceMap<Resource> >::const_iterator it = group.resources.collection.begin();
|
632
|
-
it != group.resources.collection.end();
|
633
|
-
++it) {
|
634
|
-
|
635
|
-
serialize(*it, os);
|
636
|
-
}
|
637
|
-
}
|
638
|
-
|
639
|
-
/** Serialize Blueprint */
|
640
|
-
static void serialize(const Blueprint& blueprint, std::ostream &os)
|
641
|
-
{
|
642
|
-
// AST Version
|
643
|
-
serialize(SerializeKey::ASTVersion, AST_SERIALIZATION_VERSION, 0, os, false);
|
644
|
-
|
645
|
-
// Metadata
|
646
|
-
serialize(blueprint.metadata, os);
|
647
|
-
|
648
|
-
// API Name
|
649
|
-
serialize(SerializeKey::Name, blueprint.name, 0, os);
|
650
|
-
|
651
|
-
// API Description
|
652
|
-
serialize(SerializeKey::Description, blueprint.description, 0, os);
|
653
|
-
|
654
|
-
// Resource Groups
|
655
|
-
serialize(SerializeKey::ResourceGroups, std::string(), 0, os);
|
656
|
-
|
657
|
-
if (blueprint.resourceGroups.empty())
|
658
|
-
return;
|
659
|
-
|
660
|
-
for (Collection<ResourceGroup>::type::const_iterator it = blueprint.resourceGroups.begin();
|
661
|
-
it != blueprint.resourceGroups.end();
|
662
|
-
++it) {
|
663
|
-
|
664
|
-
serialize(*it, os);
|
665
|
-
}
|
666
|
-
}
|
667
|
-
|
668
|
-
/** Serialize Blueprint source map */
|
669
|
-
static void serialize(const SourceMap<Blueprint>& blueprint, std::ostream &os)
|
670
|
-
{
|
671
|
-
// Metadata
|
672
|
-
serialize(blueprint.metadata.collection, os);
|
673
|
-
|
674
|
-
// API Name
|
675
|
-
serialize(SerializeKey::Name, blueprint.name, 0, os);
|
676
|
-
|
677
|
-
// API Description
|
678
|
-
serialize(SerializeKey::Description, blueprint.description, 0, os);
|
679
|
-
|
680
|
-
// Resource Groups
|
681
|
-
serialize(SerializeKey::ResourceGroups, std::string(), 0, os);
|
682
|
-
|
683
|
-
if (blueprint.resourceGroups.collection.empty())
|
684
|
-
return;
|
685
|
-
|
686
|
-
for (Collection<SourceMap<ResourceGroup> >::type::const_iterator it = blueprint.resourceGroups.collection.begin();
|
687
|
-
it != blueprint.resourceGroups.collection.end();
|
688
|
-
++it) {
|
689
|
-
|
690
|
-
serialize(*it, os);
|
691
|
-
}
|
692
|
-
}
|
693
|
-
|
694
|
-
void snowcrash::SerializeYAML(const snowcrash::Blueprint& blueprint, std::ostream &os)
|
695
|
-
{
|
696
|
-
serialize(blueprint, os);
|
697
|
-
}
|
698
|
-
|
699
|
-
void snowcrash::SerializeSourceMapYAML(const snowcrash::SourceMap<snowcrash::Blueprint>& blueprint, std::ostream &os)
|
700
|
-
{
|
701
|
-
serialize(blueprint, os);
|
702
|
-
}
|