redsnow 0.3.7 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
File without changes
|
data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/CONTRIBUTING.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/examples/smartypants.c
RENAMED
|
File without changes
|
data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/examples/sundown.c
RENAMED
|
File without changes
|
|
File without changes
|
data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/houdini_href_e.c
RENAMED
|
File without changes
|
data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/houdini_html_e.c
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/html_smartypants.c
RENAMED
|
File without changes
|
data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html_block_names.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/html_blocks.h
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/msvc/markdown/markdown.vcproj
RENAMED
|
File without changes
|
|
File without changes
|
data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/msvc/sundown/sundown.vcproj
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -14,8 +14,16 @@
|
|
|
14
14
|
#include "markdown.h"
|
|
15
15
|
|
|
16
16
|
namespace mdp {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
|
|
18
|
+
const char* const MarkdownEmphasisChars = "*_";
|
|
19
|
+
const char* const MarkdownListItemChars = "+-*";
|
|
20
|
+
|
|
21
|
+
const char MarkdownBeginReference = '[';
|
|
22
|
+
const char MarkdownEndReference = ']';
|
|
23
|
+
|
|
24
|
+
const char* const MarkdownLinkRegex = "^[[:blank:]]*\\[(.*)][[:blank:]]*(\\[([^][()]*)]|\\(([^][()]+)\\))[[:blank:]]*$";
|
|
25
|
+
|
|
26
|
+
/**
|
|
19
27
|
* GitHub-flavored Markdown Parser
|
|
20
28
|
*/
|
|
21
29
|
class MarkdownParser {
|
|
File without changes
|
|
@@ -57,54 +57,62 @@
|
|
|
57
57
|
'src',
|
|
58
58
|
'ext/markdown-parser/src',
|
|
59
59
|
'ext/markdown-parser/ext/sundown/src',
|
|
60
|
-
'ext/markdown-parser/ext/sundown/html'
|
|
60
|
+
'ext/markdown-parser/ext/sundown/html',
|
|
61
61
|
],
|
|
62
62
|
'sources': [
|
|
63
|
-
'src/CBlueprint.cc',
|
|
64
|
-
'src/CBlueprint.h',
|
|
65
|
-
'src/CBlueprintSourcemap.cc',
|
|
66
|
-
'src/CBlueprintSourcemap.h',
|
|
67
|
-
'src/CSourceAnnotation.cc',
|
|
68
|
-
'src/CSourceAnnotation.h',
|
|
69
63
|
'src/HTTP.cc',
|
|
70
64
|
'src/HTTP.h',
|
|
65
|
+
'src/MSON.cc',
|
|
66
|
+
'src/MSONOneOfParser.cc',
|
|
67
|
+
'src/MSONSourcemap.cc',
|
|
68
|
+
'src/MSONTypeSectionParser.cc',
|
|
69
|
+
'src/MSONValueMemberParser.cc',
|
|
70
|
+
'src/Blueprint.cc',
|
|
71
|
+
'src/BlueprintSourcemap.cc',
|
|
71
72
|
'src/Section.cc',
|
|
72
73
|
'src/Section.h',
|
|
73
|
-
'src/Serialize.cc',
|
|
74
|
-
'src/Serialize.h',
|
|
75
|
-
'src/SerializeJSON.cc',
|
|
76
|
-
'src/SerializeJSON.h',
|
|
77
|
-
'src/SerializeYAML.cc',
|
|
78
|
-
'src/SerializeYAML.h',
|
|
79
74
|
'src/Signature.cc',
|
|
80
75
|
'src/Signature.h',
|
|
81
76
|
'src/snowcrash.cc',
|
|
82
77
|
'src/snowcrash.h',
|
|
83
|
-
'src/csnowcrash.cc',
|
|
84
|
-
'src/csnowcrash.h',
|
|
85
78
|
'src/UriTemplateParser.cc',
|
|
86
79
|
'src/UriTemplateParser.h',
|
|
87
80
|
'src/PayloadParser.h',
|
|
88
81
|
'src/SectionParserData.h',
|
|
89
82
|
'src/ActionParser.h',
|
|
90
83
|
'src/AssetParser.h',
|
|
84
|
+
'src/AttributesParser.h',
|
|
91
85
|
'src/Blueprint.h',
|
|
92
86
|
'src/BlueprintParser.h',
|
|
93
87
|
'src/BlueprintSourcemap.h',
|
|
94
88
|
'src/BlueprintUtility.h',
|
|
95
89
|
'src/CodeBlockUtility.h',
|
|
90
|
+
'src/DataStructureGroupParser.h',
|
|
96
91
|
'src/HeadersParser.h',
|
|
92
|
+
'src/HeadersParser.cc',
|
|
93
|
+
'src/ModelTable.h',
|
|
94
|
+
'src/MSON.h',
|
|
95
|
+
'src/MSONSourcemap.h',
|
|
96
|
+
'src/MSONMixinParser.h',
|
|
97
|
+
'src/MSONNamedTypeParser.h',
|
|
98
|
+
'src/MSONOneOfParser.h',
|
|
99
|
+
'src/MSONParameterParser.h',
|
|
100
|
+
'src/MSONPropertyMemberParser.h',
|
|
101
|
+
'src/MSONTypeSectionParser.h',
|
|
102
|
+
'src/MSONUtility.h',
|
|
103
|
+
'src/MSONValueMemberParser.h',
|
|
97
104
|
'src/ParameterParser.h',
|
|
98
105
|
'src/ParametersParser.h',
|
|
99
106
|
'src/Platform.h',
|
|
100
107
|
'src/RegexMatch.h',
|
|
108
|
+
'src/RelationParser.h',
|
|
101
109
|
'src/ResourceGroupParser.h',
|
|
102
110
|
'src/ResourceParser.h',
|
|
103
111
|
'src/SectionParser.h',
|
|
104
112
|
'src/SectionProcessor.h',
|
|
113
|
+
'src/SignatureSectionProcessor.h',
|
|
105
114
|
'src/SourceAnnotation.h',
|
|
106
115
|
'src/StringUtility.h',
|
|
107
|
-
'src/SymbolTable.h',
|
|
108
116
|
'src/ValuesParser.h',
|
|
109
117
|
'src/Version.h'
|
|
110
118
|
],
|
|
@@ -115,7 +123,7 @@
|
|
|
115
123
|
]
|
|
116
124
|
],
|
|
117
125
|
'dependencies': [
|
|
118
|
-
'libmarkdownparser'
|
|
126
|
+
'libmarkdownparser',
|
|
119
127
|
]
|
|
120
128
|
},
|
|
121
129
|
{
|
|
@@ -132,23 +140,36 @@
|
|
|
132
140
|
'sources': [
|
|
133
141
|
'test/test-ActionParser.cc',
|
|
134
142
|
'test/test-AssetParser.cc',
|
|
143
|
+
'test/test-AttributesParser.cc',
|
|
135
144
|
'test/test-Blueprint.cc',
|
|
136
145
|
'test/test-BlueprintParser.cc',
|
|
146
|
+
'test/test-BlueprintUtility.cc',
|
|
147
|
+
'test/test-DataStructureGroupParser.cc',
|
|
137
148
|
'test/test-HeadersParser.cc',
|
|
138
149
|
'test/test-Indentation.cc',
|
|
150
|
+
'test/test-ModelTable.cc',
|
|
151
|
+
'test/test-MSONMixinParser.cc',
|
|
152
|
+
'test/test-MSONNamedTypeParser.cc',
|
|
153
|
+
'test/test-MSONOneOfParser.cc',
|
|
154
|
+
'test/test-MSONParameterParser.cc',
|
|
155
|
+
'test/test-MSONPropertyMemberParser.cc',
|
|
156
|
+
'test/test-MSONTypeSectionParser.cc',
|
|
157
|
+
'test/test-MSONUtility.cc',
|
|
158
|
+
'test/test-MSONValueMemberParser.cc',
|
|
139
159
|
'test/test-ParameterParser.cc',
|
|
140
160
|
'test/test-ParametersParser.cc',
|
|
141
161
|
'test/test-PayloadParser.cc',
|
|
142
162
|
'test/test-RegexMatch.cc',
|
|
163
|
+
'test/test-RelationParser.cc',
|
|
143
164
|
'test/test-ResourceParser.cc',
|
|
144
165
|
'test/test-ResourceGroupParser.cc',
|
|
145
166
|
'test/test-SectionParser.cc',
|
|
167
|
+
'test/test-Signature.cc',
|
|
168
|
+
'test/test-StringUtility.cc',
|
|
146
169
|
'test/test-SymbolIdentifier.cc',
|
|
147
|
-
'test/test-SymbolTable.cc',
|
|
148
170
|
'test/test-UriTemplateParser.cc',
|
|
149
171
|
'test/test-ValuesParser.cc',
|
|
150
172
|
'test/test-Warnings.cc',
|
|
151
|
-
'test/test-csnowcrash.cc',
|
|
152
173
|
'test/test-snowcrash.cc'
|
|
153
174
|
],
|
|
154
175
|
'dependencies': [
|
|
@@ -156,24 +177,6 @@
|
|
|
156
177
|
'libmarkdownparser'
|
|
157
178
|
]
|
|
158
179
|
},
|
|
159
|
-
{
|
|
160
|
-
'target_name': 'snowcrash',
|
|
161
|
-
'type': 'executable',
|
|
162
|
-
'include_dirs': [
|
|
163
|
-
'src',
|
|
164
|
-
'src/snowcrash',
|
|
165
|
-
'ext/markdown-parser/src',
|
|
166
|
-
'ext/markdown-parser/ext/sundown/src',
|
|
167
|
-
'ext/cmdline'
|
|
168
|
-
],
|
|
169
|
-
'sources': [
|
|
170
|
-
'src/snowcrash/snowcrash.cc'
|
|
171
|
-
],
|
|
172
|
-
'dependencies': [
|
|
173
|
-
'libsnowcrash',
|
|
174
|
-
'libmarkdownparser'
|
|
175
|
-
]
|
|
176
|
-
},
|
|
177
180
|
{
|
|
178
181
|
'target_name': 'perf-libsnowcrash',
|
|
179
182
|
'type': 'executable',
|
|
@@ -181,7 +184,6 @@
|
|
|
181
184
|
'src',
|
|
182
185
|
'ext/markdown-parser/src',
|
|
183
186
|
'ext/markdown-parser/ext/sundown/src',
|
|
184
|
-
'ext/cmdline',
|
|
185
187
|
'test',
|
|
186
188
|
'test/performance',
|
|
187
189
|
],
|
|
@@ -190,7 +192,7 @@
|
|
|
190
192
|
],
|
|
191
193
|
'dependencies': [
|
|
192
194
|
'libsnowcrash',
|
|
193
|
-
'libmarkdownparser'
|
|
195
|
+
'libmarkdownparser',
|
|
194
196
|
]
|
|
195
197
|
}
|
|
196
198
|
]
|
|
File without changes
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
#include "SectionParser.h"
|
|
14
14
|
#include "ParametersParser.h"
|
|
15
15
|
#include "PayloadParser.h"
|
|
16
|
+
#include "RelationParser.h"
|
|
16
17
|
#include "RegexMatch.h"
|
|
17
18
|
|
|
18
19
|
namespace snowcrash {
|
|
@@ -21,7 +22,7 @@ namespace snowcrash {
|
|
|
21
22
|
const char* const ActionHeaderRegex = "^[[:blank:]]*" HTTP_REQUEST_METHOD "[[:blank:]]*" URI_TEMPLATE "?$";
|
|
22
23
|
|
|
23
24
|
/** Named action matching regex */
|
|
24
|
-
const char* const NamedActionHeaderRegex = "^[[:blank:]]*" SYMBOL_IDENTIFIER "\\[" HTTP_REQUEST_METHOD "]$";
|
|
25
|
+
const char* const NamedActionHeaderRegex = "^[[:blank:]]*" SYMBOL_IDENTIFIER "\\[" HTTP_REQUEST_METHOD "[[:blank:]]*" URI_TEMPLATE "?]$";
|
|
25
26
|
|
|
26
27
|
/** Internal type alias for Collection iterator of Action */
|
|
27
28
|
typedef Collection<Action>::const_iterator ActionIterator;
|
|
@@ -46,7 +47,7 @@ namespace snowcrash {
|
|
|
46
47
|
SectionLayout& layout,
|
|
47
48
|
const ParseResultRef<Action>& out) {
|
|
48
49
|
|
|
49
|
-
actionHTTPMethodAndName(node, out.node.method, out.node.name);
|
|
50
|
+
actionHTTPMethodAndName(node, out.node.method, out.node.name, out.node.uriTemplate);
|
|
50
51
|
TrimString(out.node.name);
|
|
51
52
|
|
|
52
53
|
mdp::ByteBuffer remainingContent;
|
|
@@ -60,6 +61,10 @@ namespace snowcrash {
|
|
|
60
61
|
if (!out.node.name.empty()) {
|
|
61
62
|
out.sourceMap.name.sourceMap = node->sourceMap;
|
|
62
63
|
}
|
|
64
|
+
|
|
65
|
+
if (!out.node.uriTemplate.empty()) {
|
|
66
|
+
out.sourceMap.uriTemplate.sourceMap = node->sourceMap;
|
|
67
|
+
}
|
|
63
68
|
}
|
|
64
69
|
|
|
65
70
|
if (!remainingContent.empty()) {
|
|
@@ -85,6 +90,12 @@ namespace snowcrash {
|
|
|
85
90
|
mdp::CharactersRangeSet sourceMap = mdp::BytesRangeSetToCharactersRangeSet(node->sourceMap, pd.sourceData);
|
|
86
91
|
|
|
87
92
|
switch (sectionType) {
|
|
93
|
+
case RelationSectionType:
|
|
94
|
+
{
|
|
95
|
+
ParseResultRef<Relation> relation(out.report, out.node.relation, out.sourceMap.relation);
|
|
96
|
+
return RelationParser::parse(node, siblings, pd, relation);
|
|
97
|
+
}
|
|
98
|
+
|
|
88
99
|
case ParametersSectionType:
|
|
89
100
|
{
|
|
90
101
|
ParseResultRef<Parameters> parameters(out.report, out.node.parameters, out.sourceMap.parameters);
|
|
@@ -155,6 +166,12 @@ namespace snowcrash {
|
|
|
155
166
|
return SectionProcessor<Action>::handleDeprecatedHeaders(node, siblings, pd, headers);
|
|
156
167
|
}
|
|
157
168
|
|
|
169
|
+
case AttributesSectionType:
|
|
170
|
+
{
|
|
171
|
+
ParseResultRef<Attributes> attributes(out.report, out.node.attributes, out.sourceMap.attributes);
|
|
172
|
+
return AttributesParser::parse(node, siblings, pd, attributes);
|
|
173
|
+
}
|
|
174
|
+
|
|
158
175
|
default:
|
|
159
176
|
break;
|
|
160
177
|
}
|
|
@@ -253,6 +270,13 @@ namespace snowcrash {
|
|
|
253
270
|
|
|
254
271
|
SectionType nestedType = UndefinedSectionType;
|
|
255
272
|
|
|
273
|
+
// Check if relation section
|
|
274
|
+
nestedType = SectionProcessor<Relation>::sectionType(node);
|
|
275
|
+
|
|
276
|
+
if (nestedType != UndefinedSectionType) {
|
|
277
|
+
return nestedType;
|
|
278
|
+
}
|
|
279
|
+
|
|
256
280
|
// Check if parameters section
|
|
257
281
|
nestedType = SectionProcessor<Parameters>::sectionType(node);
|
|
258
282
|
|
|
@@ -263,7 +287,14 @@ namespace snowcrash {
|
|
|
263
287
|
// Check if headers section
|
|
264
288
|
nestedType = SectionProcessor<Headers>::sectionType(node);
|
|
265
289
|
|
|
266
|
-
if (nestedType
|
|
290
|
+
if (nestedType != UndefinedSectionType) {
|
|
291
|
+
return nestedType;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// Check if attributes section
|
|
295
|
+
nestedType = SectionProcessor<Attributes>::sectionType(node);
|
|
296
|
+
|
|
297
|
+
if (nestedType != UndefinedSectionType) {
|
|
267
298
|
return nestedType;
|
|
268
299
|
}
|
|
269
300
|
|
|
@@ -285,6 +316,7 @@ namespace snowcrash {
|
|
|
285
316
|
nested.push_back(ResponseSectionType);
|
|
286
317
|
nested.push_back(RequestBodySectionType);
|
|
287
318
|
nested.push_back(RequestSectionType);
|
|
319
|
+
nested.push_back(RelationSectionType);
|
|
288
320
|
|
|
289
321
|
types = SectionProcessor<Payload>::nestedSectionTypes();
|
|
290
322
|
nested.insert(nested.end(), types.begin(), types.end());
|
|
@@ -450,6 +482,7 @@ namespace snowcrash {
|
|
|
450
482
|
}
|
|
451
483
|
|
|
452
484
|
CaptureGroups captureGroups;
|
|
485
|
+
|
|
453
486
|
if (RegexCapture(subject, ActionHeaderRegex, captureGroups, 3)) {
|
|
454
487
|
|
|
455
488
|
if (captureGroups[2].empty()) {
|
|
@@ -466,7 +499,8 @@ namespace snowcrash {
|
|
|
466
499
|
/** \return HTTP request method and name of an action */
|
|
467
500
|
static void actionHTTPMethodAndName(const MarkdownNodeIterator& node,
|
|
468
501
|
mdp::ByteBuffer& method,
|
|
469
|
-
mdp::ByteBuffer& name
|
|
502
|
+
mdp::ByteBuffer& name,
|
|
503
|
+
mdp::ByteBuffer& uriTemplate) {
|
|
470
504
|
|
|
471
505
|
CaptureGroups captureGroups;
|
|
472
506
|
mdp::ByteBuffer subject, remaining;
|
|
@@ -476,9 +510,10 @@ namespace snowcrash {
|
|
|
476
510
|
|
|
477
511
|
if (RegexCapture(subject, ActionHeaderRegex, captureGroups, 3)) {
|
|
478
512
|
method = captureGroups[1];
|
|
479
|
-
} else if (RegexCapture(subject, NamedActionHeaderRegex, captureGroups,
|
|
513
|
+
} else if (RegexCapture(subject, NamedActionHeaderRegex, captureGroups, 4)) {
|
|
480
514
|
name = captureGroups[1];
|
|
481
515
|
method = captureGroups[2];
|
|
516
|
+
uriTemplate = captureGroups[3];
|
|
482
517
|
}
|
|
483
518
|
|
|
484
519
|
return;
|
|
@@ -490,7 +525,16 @@ namespace snowcrash {
|
|
|
490
525
|
|
|
491
526
|
return std::find_if(actions.begin(),
|
|
492
527
|
actions.end(),
|
|
493
|
-
std::bind2nd(MatchAction
|
|
528
|
+
std::bind2nd(MatchAction(), action));
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
/** Finds a relation identifier inside an actions collection */
|
|
532
|
+
static ActionIterator findRelation(const Actions& actions,
|
|
533
|
+
const Relation& relation) {
|
|
534
|
+
|
|
535
|
+
return std::find_if(actions.begin(),
|
|
536
|
+
actions.end(),
|
|
537
|
+
std::bind2nd(MatchRelation(), relation));
|
|
494
538
|
}
|
|
495
539
|
};
|
|
496
540
|
|
|
@@ -52,13 +52,7 @@ namespace snowcrash {
|
|
|
52
52
|
return ++MarkdownNodeIterator(node);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
const MarkdownNodes& siblings,
|
|
57
|
-
SectionParserData& pd,
|
|
58
|
-
const ParseResultRef<Asset>& out) {
|
|
59
|
-
|
|
60
|
-
return node;
|
|
61
|
-
}
|
|
55
|
+
NO_SECTION_DESCRIPTION(Asset)
|
|
62
56
|
|
|
63
57
|
static MarkdownNodeIterator processContent(const MarkdownNodeIterator& node,
|
|
64
58
|
const MarkdownNodes& siblings,
|
|
@@ -77,11 +71,6 @@ namespace snowcrash {
|
|
|
77
71
|
return ++MarkdownNodeIterator(node);
|
|
78
72
|
}
|
|
79
73
|
|
|
80
|
-
static bool isDescriptionNode(const MarkdownNodeIterator& node,
|
|
81
|
-
SectionType sectionType) {
|
|
82
|
-
return false;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
74
|
static bool isContentNode(const MarkdownNodeIterator& node,
|
|
86
75
|
SectionType sectionType) {
|
|
87
76
|
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
//
|
|
2
|
+
// AttributesParser.h
|
|
3
|
+
// snowcrash
|
|
4
|
+
//
|
|
5
|
+
// Created by Pavan Kumar Sunkara on 11/25/14.
|
|
6
|
+
// Copyright (c) 2014 Apiary Inc. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifndef SNOWCRASH_ATTRIBUTESPARSER_H
|
|
10
|
+
#define SNOWCRASH_ATTRIBUTESPARSER_H
|
|
11
|
+
|
|
12
|
+
#include "RegexMatch.h"
|
|
13
|
+
#include "MSONValueMemberParser.h"
|
|
14
|
+
|
|
15
|
+
using namespace scpl;
|
|
16
|
+
|
|
17
|
+
namespace snowcrash {
|
|
18
|
+
|
|
19
|
+
/** Attributes matching regex */
|
|
20
|
+
const char* const AttributesRegex = "^[[:blank:]]*[Aa]ttributes?[[:blank:]]*(\\(.*\\))?$";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Attributes section processor
|
|
24
|
+
*/
|
|
25
|
+
template<>
|
|
26
|
+
struct SectionProcessor<Attributes> : public SignatureSectionProcessorBase<Attributes> {
|
|
27
|
+
|
|
28
|
+
static SignatureTraits signatureTraits() {
|
|
29
|
+
|
|
30
|
+
SignatureTraits signatureTraits(SignatureTraits::IdentifierTrait |
|
|
31
|
+
SignatureTraits::AttributesTrait);
|
|
32
|
+
|
|
33
|
+
return signatureTraits;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static MarkdownNodeIterator finalizeSignature(const MarkdownNodeIterator& node,
|
|
37
|
+
SectionParserData& pd,
|
|
38
|
+
const Signature& signature,
|
|
39
|
+
const ParseResultRef<Attributes>& out) {
|
|
40
|
+
|
|
41
|
+
if (!IEqual<std::string>()(signature.identifier, "Attribute") &&
|
|
42
|
+
!IEqual<std::string>()(signature.identifier, "Attributes")) {
|
|
43
|
+
|
|
44
|
+
return node;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
mson::parseTypeDefinition(node, pd, signature.attributes, out.report, out.node.typeDefinition);
|
|
48
|
+
|
|
49
|
+
if (pd.exportSourceMap()) {
|
|
50
|
+
|
|
51
|
+
if (!out.node.typeDefinition.empty()) {
|
|
52
|
+
out.sourceMap.typeDefinition.sourceMap = node->sourceMap;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Default to `object` type specification
|
|
57
|
+
if (out.node.typeDefinition.baseType == mson::UndefinedBaseType) {
|
|
58
|
+
out.node.typeDefinition.baseType = mson::ImplicitObjectBaseType;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
SectionProcessor<mson::ValueMember>::parseRemainingContent(node, pd, signature.remainingContent,
|
|
62
|
+
out.node.sections, out.sourceMap.sections);
|
|
63
|
+
|
|
64
|
+
return ++MarkdownNodeIterator(node);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
static MarkdownNodeIterator processDescription(const MarkdownNodeIterator& node,
|
|
68
|
+
const MarkdownNodes& siblings,
|
|
69
|
+
SectionParserData& pd,
|
|
70
|
+
const ParseResultRef<Attributes>& out) {
|
|
71
|
+
|
|
72
|
+
return SectionProcessor<mson::ValueMember>::blockDescription(node, pd, out.node.sections, out.sourceMap.sections);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static MarkdownNodeIterator processNestedSection(const MarkdownNodeIterator& node,
|
|
76
|
+
const MarkdownNodes& siblings,
|
|
77
|
+
SectionParserData& pd,
|
|
78
|
+
const ParseResultRef<Attributes>& out) {
|
|
79
|
+
|
|
80
|
+
ParseResultRef<mson::TypeSections> typeSections(out.report, out.node.sections, out.sourceMap.sections);
|
|
81
|
+
|
|
82
|
+
return SectionProcessor<mson::ValueMember>
|
|
83
|
+
::processNestedMembers<MSONTypeSectionListParser>(node, siblings, pd, typeSections,
|
|
84
|
+
out.node.typeDefinition.baseType);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
static bool isDescriptionNode(const MarkdownNodeIterator& node,
|
|
88
|
+
SectionType sectionType) {
|
|
89
|
+
|
|
90
|
+
return SectionProcessor<mson::ValueMember>::isDescriptionNode(node, sectionType);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
static SectionType sectionType(const MarkdownNodeIterator& node) {
|
|
94
|
+
|
|
95
|
+
if (node->type == mdp::ListItemMarkdownNodeType &&
|
|
96
|
+
!node->children().empty()) {
|
|
97
|
+
|
|
98
|
+
mdp::ByteBuffer remaining, subject = node->children().front().text;
|
|
99
|
+
|
|
100
|
+
subject = GetFirstLine(subject, remaining);
|
|
101
|
+
TrimString(subject);
|
|
102
|
+
|
|
103
|
+
if (RegexMatch(subject, AttributesRegex)) {
|
|
104
|
+
return AttributesSectionType;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return UndefinedSectionType;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
static SectionType nestedSectionType(const MarkdownNodeIterator& node) {
|
|
112
|
+
|
|
113
|
+
return SectionProcessor<mson::ValueMember>::nestedSectionType(node);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/** Attributes Section Parser */
|
|
118
|
+
typedef SectionParser<Attributes, ListSectionAdapter> AttributesParser;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
#endif
|