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
@@ -0,0 +1,399 @@
|
|
1
|
+
//
|
2
|
+
// MSON.h
|
3
|
+
// snowcrash
|
4
|
+
//
|
5
|
+
// Created by Pavan Kumar Sunkara on 10/9/14.
|
6
|
+
// Copyright (c) 2014 Apiary Inc. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#ifndef SNOWCRASH_MSON_H
|
10
|
+
#define SNOWCRASH_MSON_H
|
11
|
+
|
12
|
+
#include <vector>
|
13
|
+
#include <string>
|
14
|
+
#include <map>
|
15
|
+
#include <stdexcept>
|
16
|
+
|
17
|
+
#include "Platform.h"
|
18
|
+
#include "MarkdownParser.h"
|
19
|
+
|
20
|
+
#define ELEMENTS_NOT_SET_ERR std::logic_error("no elements set")
|
21
|
+
|
22
|
+
/**
|
23
|
+
* MSON Abstract Syntax Tree
|
24
|
+
* -------------------------
|
25
|
+
*
|
26
|
+
* Data types in this document define the MSON AST
|
27
|
+
*/
|
28
|
+
|
29
|
+
namespace mson {
|
30
|
+
|
31
|
+
/** Markdown */
|
32
|
+
typedef mdp::ByteBuffer Markdown;
|
33
|
+
|
34
|
+
/** Literal */
|
35
|
+
typedef std::string Literal;
|
36
|
+
|
37
|
+
/**
|
38
|
+
* Kind of Base Type
|
39
|
+
*
|
40
|
+
* This is an internal thing to keep track of what kind of type,
|
41
|
+
* that particular named type or member is sub-typed from
|
42
|
+
*/
|
43
|
+
enum BaseType {
|
44
|
+
UndefinedBaseType = 0, // Undefined
|
45
|
+
PrimitiveBaseType, // Primitive Types
|
46
|
+
ImplicitPrimitiveBaseType, // Primitive Types (implicit)
|
47
|
+
ObjectBaseType, // Object Structure Type
|
48
|
+
ImplicitObjectBaseType, // Object Structure Type (implicit)
|
49
|
+
ValueBaseType, // Array & Enum Structure Type
|
50
|
+
ImplicitValueBaseType // Array & Enum Structure Type (implicit)
|
51
|
+
};
|
52
|
+
|
53
|
+
/** Named Types base type table */
|
54
|
+
typedef std::map<Literal, BaseType> NamedTypeBaseTable;
|
55
|
+
|
56
|
+
/** Named Types inheritance table */
|
57
|
+
typedef std::map<Literal, Literal> NamedTypeInheritanceTable;
|
58
|
+
|
59
|
+
/** A simple or actual value */
|
60
|
+
struct Value {
|
61
|
+
|
62
|
+
/** Constructor */
|
63
|
+
Value()
|
64
|
+
: variable(false) {}
|
65
|
+
|
66
|
+
/** Literal value */
|
67
|
+
Literal literal;
|
68
|
+
|
69
|
+
/** Flag to denote variable value */
|
70
|
+
bool variable;
|
71
|
+
|
72
|
+
/** Check if empty */
|
73
|
+
bool empty() const;
|
74
|
+
};
|
75
|
+
|
76
|
+
/** Collection of values */
|
77
|
+
typedef std::vector<Value> Values;
|
78
|
+
|
79
|
+
/** Type symbol (identifier) */
|
80
|
+
struct Symbol {
|
81
|
+
|
82
|
+
/** Constructor */
|
83
|
+
Symbol()
|
84
|
+
: variable(false) {}
|
85
|
+
|
86
|
+
/** Name of the symbol */
|
87
|
+
Literal literal;
|
88
|
+
|
89
|
+
/** Flag to denote variable type name */
|
90
|
+
bool variable;
|
91
|
+
|
92
|
+
/** Check if empty */
|
93
|
+
bool empty() const;
|
94
|
+
};
|
95
|
+
|
96
|
+
/** Value of type name if based type */
|
97
|
+
enum BaseTypeName {
|
98
|
+
UndefinedTypeName = 0, // Not a base type name
|
99
|
+
BooleanTypeName, // `boolean` type name
|
100
|
+
StringTypeName, // `string` type name
|
101
|
+
NumberTypeName, // `number` type name
|
102
|
+
ArrayTypeName, // `array` type name
|
103
|
+
EnumTypeName, // `enum` type name
|
104
|
+
ObjectTypeName // `object` type name
|
105
|
+
};
|
106
|
+
|
107
|
+
/** Base or named type's name */
|
108
|
+
struct TypeName {
|
109
|
+
|
110
|
+
/** Constructor */
|
111
|
+
TypeName(const BaseTypeName& base_ = UndefinedTypeName)
|
112
|
+
: base(base_) {}
|
113
|
+
|
114
|
+
/** EITHER Base type's value */
|
115
|
+
BaseTypeName base;
|
116
|
+
|
117
|
+
/** OR Named type's identifier */
|
118
|
+
Symbol symbol;
|
119
|
+
|
120
|
+
/** Check if empty */
|
121
|
+
bool empty() const;
|
122
|
+
};
|
123
|
+
|
124
|
+
/** Collection of type names */
|
125
|
+
typedef std::vector<TypeName> TypeNames;
|
126
|
+
|
127
|
+
/** Attribute of a type */
|
128
|
+
enum TypeAttribute {
|
129
|
+
RequiredTypeAttribute = (1 << 0), // The type is required
|
130
|
+
OptionalTypeAttribute = (1 << 1), // The type is optional
|
131
|
+
FixedTypeAttribute = (1 << 2), // The type is fixed
|
132
|
+
SampleTypeAttribute = (1 << 3), // The type is a sample
|
133
|
+
DefaultTypeAttribute = (1 << 4) // The type is default
|
134
|
+
};
|
135
|
+
|
136
|
+
/** List of type attributes */
|
137
|
+
typedef unsigned int TypeAttributes;
|
138
|
+
|
139
|
+
/** Defines sub-typed types for a type */
|
140
|
+
struct TypeSpecification {
|
141
|
+
|
142
|
+
/** Name of the type */
|
143
|
+
TypeName name;
|
144
|
+
|
145
|
+
/** Array of nested types */
|
146
|
+
TypeNames nestedTypes;
|
147
|
+
|
148
|
+
/** Check if empty */
|
149
|
+
bool empty() const;
|
150
|
+
};
|
151
|
+
|
152
|
+
/** Definition of an instance of a type */
|
153
|
+
struct TypeDefinition {
|
154
|
+
|
155
|
+
/** Constructor */
|
156
|
+
TypeDefinition()
|
157
|
+
: baseType(UndefinedBaseType), attributes(0) {}
|
158
|
+
|
159
|
+
/**
|
160
|
+
* Base Type (for the type definition)
|
161
|
+
*
|
162
|
+
* Representing the base type from which this member or
|
163
|
+
* named type is sub-typed from. Not present in the AST
|
164
|
+
*/
|
165
|
+
BaseType baseType;
|
166
|
+
|
167
|
+
/** Type specification */
|
168
|
+
TypeSpecification typeSpecification;
|
169
|
+
|
170
|
+
/** List of type attributes (byte-wise OR) */
|
171
|
+
TypeAttributes attributes;
|
172
|
+
|
173
|
+
/** Check if empty */
|
174
|
+
bool empty() const;
|
175
|
+
};
|
176
|
+
|
177
|
+
/** Value definition of a type instance */
|
178
|
+
struct ValueDefinition {
|
179
|
+
|
180
|
+
/** List of values */
|
181
|
+
Values values;
|
182
|
+
|
183
|
+
/** Type of the values */
|
184
|
+
TypeDefinition typeDefinition;
|
185
|
+
|
186
|
+
/** Check if empty */
|
187
|
+
bool empty() const;
|
188
|
+
};
|
189
|
+
|
190
|
+
/** Forward Declaration for element */
|
191
|
+
struct Element;
|
192
|
+
|
193
|
+
/** Collection of elements */
|
194
|
+
typedef std::vector<Element> Elements;
|
195
|
+
|
196
|
+
/** Section of a type */
|
197
|
+
struct TypeSection {
|
198
|
+
|
199
|
+
/** Class of a type section */
|
200
|
+
enum Class {
|
201
|
+
UndefinedClass = 0, // Unknown
|
202
|
+
BlockDescriptionClass, // Markdown block description
|
203
|
+
MemberTypeClass, // Contains member types
|
204
|
+
SampleClass, // Sample value(s) for member types
|
205
|
+
DefaultClass // Default value(s) for member types
|
206
|
+
};
|
207
|
+
|
208
|
+
/** Content of the type section */
|
209
|
+
struct Content {
|
210
|
+
|
211
|
+
/** EITHER Block description */
|
212
|
+
Markdown description;
|
213
|
+
|
214
|
+
/** OR Literal value */
|
215
|
+
Literal value;
|
216
|
+
|
217
|
+
/** OR Collection of elements */
|
218
|
+
Elements& elements();
|
219
|
+
const Elements& elements() const;
|
220
|
+
|
221
|
+
/** Constructor */
|
222
|
+
Content(const Markdown& description_ = Markdown(), const Literal& value_ = Literal());
|
223
|
+
|
224
|
+
/** Copy constructor */
|
225
|
+
Content(const TypeSection::Content& rhs);
|
226
|
+
|
227
|
+
/** Assignment operator */
|
228
|
+
TypeSection::Content& operator=(const TypeSection::Content& rhs);
|
229
|
+
|
230
|
+
/** Desctructor */
|
231
|
+
~Content();
|
232
|
+
|
233
|
+
private:
|
234
|
+
std::auto_ptr<Elements> m_elements;
|
235
|
+
};
|
236
|
+
|
237
|
+
/** Constructor */
|
238
|
+
TypeSection(const TypeSection::Class& klass_ = TypeSection::UndefinedClass)
|
239
|
+
: baseType(UndefinedBaseType), klass(klass_) {}
|
240
|
+
|
241
|
+
/** Base Type (for the parent of the type section) */
|
242
|
+
BaseType baseType;
|
243
|
+
|
244
|
+
/** Denotes the class of the type section */
|
245
|
+
TypeSection::Class klass;
|
246
|
+
|
247
|
+
/** Content of the type section */
|
248
|
+
TypeSection::Content content;
|
249
|
+
|
250
|
+
/** Check if empty */
|
251
|
+
bool empty() const;
|
252
|
+
};
|
253
|
+
|
254
|
+
/** Collection of type sections */
|
255
|
+
typedef std::vector<TypeSection> TypeSections;
|
256
|
+
|
257
|
+
/** User-define named type */
|
258
|
+
struct NamedType {
|
259
|
+
|
260
|
+
/** Name of the type */
|
261
|
+
TypeName name;
|
262
|
+
|
263
|
+
/** The ancestor type definition */
|
264
|
+
TypeDefinition typeDefinition;
|
265
|
+
|
266
|
+
/** List of named type's sections */
|
267
|
+
TypeSections sections;
|
268
|
+
|
269
|
+
/** Check if empty */
|
270
|
+
bool empty() const;
|
271
|
+
};
|
272
|
+
|
273
|
+
/** Individual member of an array or enum structure */
|
274
|
+
struct ValueMember {
|
275
|
+
|
276
|
+
/** Inline description */
|
277
|
+
Markdown description;
|
278
|
+
|
279
|
+
/** Definition of member's value */
|
280
|
+
ValueDefinition valueDefinition;
|
281
|
+
|
282
|
+
/** List of member type's sections */
|
283
|
+
TypeSections sections;
|
284
|
+
|
285
|
+
/** Check if empty */
|
286
|
+
bool empty() const;
|
287
|
+
};
|
288
|
+
|
289
|
+
/** Name of a property member */
|
290
|
+
struct PropertyName {
|
291
|
+
|
292
|
+
/** EITHER Literal name of the property */
|
293
|
+
Literal literal;
|
294
|
+
|
295
|
+
/** OR Variable name of the property */
|
296
|
+
ValueDefinition variable;
|
297
|
+
|
298
|
+
/** Check if empty */
|
299
|
+
bool empty() const;
|
300
|
+
};
|
301
|
+
|
302
|
+
/** Individual member of an object structure */
|
303
|
+
struct PropertyMember : public ValueMember {
|
304
|
+
|
305
|
+
/** Name of the property */
|
306
|
+
PropertyName name;
|
307
|
+
|
308
|
+
/** Check if empty */
|
309
|
+
bool empty() const;
|
310
|
+
};
|
311
|
+
|
312
|
+
/** Mixin type */
|
313
|
+
typedef TypeDefinition Mixin;
|
314
|
+
|
315
|
+
/** One Of type */
|
316
|
+
typedef Elements OneOf;
|
317
|
+
|
318
|
+
/** Element of a type section */
|
319
|
+
struct Element {
|
320
|
+
|
321
|
+
/** Class of an element */
|
322
|
+
enum Class {
|
323
|
+
UndefinedClass = 0, // Unknown
|
324
|
+
PropertyClass, // Property member
|
325
|
+
ValueClass, // Value member
|
326
|
+
MixinClass, // Mixin
|
327
|
+
OneOfClass, // One of
|
328
|
+
GroupClass // Group of elements
|
329
|
+
};
|
330
|
+
|
331
|
+
/** Content of the element */
|
332
|
+
struct Content {
|
333
|
+
|
334
|
+
/** EITHER Property member */
|
335
|
+
PropertyMember property;
|
336
|
+
|
337
|
+
/** OR Value member */
|
338
|
+
ValueMember value;
|
339
|
+
|
340
|
+
/** OR Mixin member */
|
341
|
+
Mixin mixin;
|
342
|
+
|
343
|
+
/** OR One of member */
|
344
|
+
OneOf& oneOf();
|
345
|
+
const OneOf& oneOf() const;
|
346
|
+
|
347
|
+
/** OR Collection of elements */
|
348
|
+
Elements& elements();
|
349
|
+
const Elements& elements() const;
|
350
|
+
|
351
|
+
/** Builds the structure from group of elements */
|
352
|
+
Element::Content& operator=(const Elements& rhs);
|
353
|
+
|
354
|
+
/** Constructor */
|
355
|
+
Content();
|
356
|
+
|
357
|
+
/** Copy constructor */
|
358
|
+
Content(const Element::Content& rhs);
|
359
|
+
|
360
|
+
/** Assignment operator */
|
361
|
+
Content& operator=(const Element::Content& rhs);
|
362
|
+
|
363
|
+
/** Destructor */
|
364
|
+
~Content();
|
365
|
+
|
366
|
+
private:
|
367
|
+
std::auto_ptr<Elements> m_elements;
|
368
|
+
};
|
369
|
+
|
370
|
+
/** Class of the element */
|
371
|
+
Element::Class klass;
|
372
|
+
|
373
|
+
/** Content of the element */
|
374
|
+
Element::Content content;
|
375
|
+
|
376
|
+
/** Constructor */
|
377
|
+
Element(const Element::Class& klass_ = Element::UndefinedClass);
|
378
|
+
|
379
|
+
/** Copy constructor */
|
380
|
+
Element(const Element& rhs);
|
381
|
+
|
382
|
+
/** Assignment operator */
|
383
|
+
Element& operator=(const Element& rhs);
|
384
|
+
|
385
|
+
/** Functions which allow the building of member type */
|
386
|
+
void build(const PropertyMember& propertyMember);
|
387
|
+
void build(const ValueMember& valueMember);
|
388
|
+
void build(const Mixin& mixin);
|
389
|
+
void build(const OneOf& oneOf);
|
390
|
+
void build(const Value& value);
|
391
|
+
|
392
|
+
void buildFromElements(const Elements& elements);
|
393
|
+
|
394
|
+
/** Desctructor */
|
395
|
+
~Element();
|
396
|
+
};
|
397
|
+
}
|
398
|
+
|
399
|
+
#endif
|
@@ -0,0 +1,95 @@
|
|
1
|
+
//
|
2
|
+
// MSONMixinParser.h
|
3
|
+
// snowcrash
|
4
|
+
//
|
5
|
+
// Created by Pavan Kumar Sunkara on 11/5/14.
|
6
|
+
// Copyright (c) 2014 Apiary Inc. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#ifndef SNOWCRASH_MSONMIXINPARSER_H
|
10
|
+
#define SNOWCRASH_MSONMIXINPARSER_H
|
11
|
+
|
12
|
+
#include "SectionParser.h"
|
13
|
+
#include "MSONUtility.h"
|
14
|
+
|
15
|
+
using namespace scpl;
|
16
|
+
|
17
|
+
namespace snowcrash {
|
18
|
+
|
19
|
+
/** MSON Mixin matching regex */
|
20
|
+
const char* const MSONMixinRegex = "^[[:blank:]]*([Ii]nclude[[:blank:]]+)";
|
21
|
+
|
22
|
+
/**
|
23
|
+
* MSON Mixin Section Processor
|
24
|
+
*/
|
25
|
+
template<>
|
26
|
+
struct SectionProcessor<mson::Mixin> : public SignatureSectionProcessorBase<mson::Mixin> {
|
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<mson::Mixin>& out) {
|
40
|
+
|
41
|
+
CaptureGroups captureGroups;
|
42
|
+
std::vector<mdp::ByteBuffer> attributes = signature.attributes;
|
43
|
+
|
44
|
+
if (RegexCapture(signature.identifier, MSONMixinRegex, captureGroups, 2) &&
|
45
|
+
!captureGroups[1].empty()) {
|
46
|
+
|
47
|
+
// Get the type name and insert it into attributes
|
48
|
+
std::string typeName = signature.identifier.substr(captureGroups[1].length());
|
49
|
+
attributes.insert(attributes.begin(), typeName);
|
50
|
+
}
|
51
|
+
|
52
|
+
mson::parseTypeDefinition(node, pd, attributes, out.report, out.node);
|
53
|
+
|
54
|
+
if (pd.exportSourceMap()) {
|
55
|
+
out.sourceMap.sourceMap = node->sourceMap;
|
56
|
+
}
|
57
|
+
|
58
|
+
if ((out.node.baseType == mson::PrimitiveBaseType) ||
|
59
|
+
(out.node.baseType == mson::UndefinedBaseType)) {
|
60
|
+
|
61
|
+
// WARN: invalid mixin base type
|
62
|
+
mdp::CharactersRangeSet sourceMap = mdp::BytesRangeSetToCharactersRangeSet(node->sourceMap, pd.sourceData);
|
63
|
+
out.report.warnings.push_back(Warning("mixin type may not include a type of a primitive sub-type",
|
64
|
+
FormattingWarning,
|
65
|
+
sourceMap));
|
66
|
+
}
|
67
|
+
|
68
|
+
return ++MarkdownNodeIterator(node);
|
69
|
+
}
|
70
|
+
|
71
|
+
NO_SECTION_DESCRIPTION(mson::Mixin)
|
72
|
+
|
73
|
+
static SectionType sectionType(const MarkdownNodeIterator& node) {
|
74
|
+
|
75
|
+
if (node->type == mdp::ListItemMarkdownNodeType
|
76
|
+
&& !node->children().empty()) {
|
77
|
+
|
78
|
+
mdp::ByteBuffer subject = node->children().front().text;
|
79
|
+
|
80
|
+
TrimString(subject);
|
81
|
+
|
82
|
+
if (RegexMatch(subject, MSONMixinRegex)) {
|
83
|
+
return MSONMixinSectionType;
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
return UndefinedSectionType;
|
88
|
+
}
|
89
|
+
};
|
90
|
+
|
91
|
+
/** MSON Mixin Section Parser */
|
92
|
+
typedef SectionParser<mson::Mixin, ListSectionAdapter> MSONMixinParser;
|
93
|
+
}
|
94
|
+
|
95
|
+
#endif
|