redsnow 0.1.6 → 0.2.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/CHANGELOG.md +2 -0
- data/ext/snowcrash/Makefile +1 -1
- data/ext/snowcrash/bin/snowcrash +0 -0
- data/ext/snowcrash/configure +9 -9
- data/ext/snowcrash/ext/markdown-parser/Makefile +87 -0
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/CONTRIBUTING.md +0 -0
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/Makefile +2 -1
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/Makefile.win +0 -0
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/examples/smartypants.c +0 -0
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/examples/sundown.c +0 -0
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/html/houdini.h +0 -0
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/html/houdini_href_e.c +0 -0
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/html/houdini_html_e.c +0 -0
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/html/html.c +0 -0
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/html/html.h +0 -0
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/html/html_smartypants.c +0 -0
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/html_block_names.txt +0 -0
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/src/autolink.c +0 -0
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/src/autolink.h +0 -0
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/src/buffer.c +0 -0
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/src/buffer.h +1 -1
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/src/html_blocks.h +0 -0
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/src/markdown.c +9 -3
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/src/markdown.h +0 -0
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/src/src_map.c +11 -7
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/src/src_map.h +1 -1
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/src/stack.c +0 -0
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/src/stack.h +0 -0
- data/ext/snowcrash/{sundown → ext/markdown-parser/ext/sundown}/sundown.def +0 -0
- data/ext/snowcrash/ext/markdown-parser/msvc/markdown/markdown.vcproj +188 -0
- data/ext/snowcrash/ext/markdown-parser/msvc/msvc.sln +38 -0
- data/ext/snowcrash/ext/markdown-parser/msvc/sundown/sundown.vcproj +206 -0
- data/ext/snowcrash/ext/markdown-parser/src/ByteBuffer.cc +92 -0
- data/ext/snowcrash/ext/markdown-parser/src/ByteBuffer.h +82 -0
- data/ext/snowcrash/ext/markdown-parser/src/MarkdownNode.cc +152 -0
- data/ext/snowcrash/ext/markdown-parser/src/MarkdownNode.h +103 -0
- data/ext/snowcrash/ext/markdown-parser/src/MarkdownParser.cc +388 -0
- data/ext/snowcrash/{src → ext/markdown-parser/src}/MarkdownParser.h +43 -33
- data/ext/snowcrash/snowcrash.gyp +114 -63
- data/ext/snowcrash/src/ActionParser.h +334 -398
- data/ext/snowcrash/src/AssetParser.h +82 -171
- data/ext/snowcrash/src/Blueprint.h +7 -2
- data/ext/snowcrash/src/BlueprintParser.h +212 -286
- data/ext/snowcrash/src/BlueprintUtility.h +2 -2
- data/ext/snowcrash/src/CBlueprint.h +1 -1
- data/ext/snowcrash/src/CSourceAnnotation.cc +11 -11
- data/ext/snowcrash/src/CSourceAnnotation.h +9 -9
- data/ext/snowcrash/src/CodeBlockUtility.h +199 -149
- data/ext/snowcrash/src/HeadersParser.h +197 -0
- data/ext/snowcrash/src/ParameterParser.h +429 -0
- data/ext/snowcrash/src/ParametersParser.h +136 -211
- data/ext/snowcrash/src/PayloadParser.h +458 -562
- data/ext/snowcrash/src/Platform.h +0 -3
- data/ext/snowcrash/src/ResourceGroupParser.h +183 -164
- data/ext/snowcrash/src/ResourceParser.h +325 -493
- data/ext/snowcrash/src/Section.cc +42 -0
- data/ext/snowcrash/src/Section.h +47 -0
- data/ext/snowcrash/src/SectionParser.h +229 -0
- data/ext/snowcrash/src/SectionParserData.h +81 -0
- data/ext/snowcrash/src/SectionProcessor.h +211 -0
- data/ext/snowcrash/src/Signature.cc +74 -0
- data/ext/snowcrash/src/Signature.h +32 -0
- data/ext/snowcrash/src/SourceAnnotation.h +7 -20
- data/ext/snowcrash/src/StringUtility.h +30 -10
- data/ext/snowcrash/src/SymbolTable.h +7 -7
- data/ext/snowcrash/src/UriTemplateParser.cc +10 -10
- data/ext/snowcrash/src/UriTemplateParser.h +11 -14
- data/ext/snowcrash/src/ValuesParser.h +122 -0
- data/ext/snowcrash/src/Version.h +2 -2
- data/ext/snowcrash/src/csnowcrash.cc +5 -5
- data/ext/snowcrash/src/csnowcrash.h +3 -3
- data/ext/snowcrash/src/snowcrash.cc +74 -4
- data/ext/snowcrash/src/snowcrash.h +9 -4
- data/ext/snowcrash/src/snowcrash/snowcrash.cc +16 -16
- data/ext/snowcrash/tools/homebrew/snowcrash.rb +3 -2
- data/ext/snowcrash/vcbuild.bat +13 -4
- data/lib/redsnow.rb +5 -5
- data/lib/redsnow/binding.rb +1 -1
- data/lib/redsnow/blueprint.rb +33 -2
- data/lib/redsnow/parseresult.rb +7 -4
- data/lib/redsnow/version.rb +1 -1
- data/test/redsnow_binding_test.rb +6 -6
- data/test/redsnow_parseresult_test.rb +1 -1
- metadata +62 -42
- data/ext/snowcrash/src/BlockUtility.h +0 -186
- data/ext/snowcrash/src/BlueprintParserCore.h +0 -190
- data/ext/snowcrash/src/BlueprintSection.h +0 -140
- data/ext/snowcrash/src/DescriptionSectionUtility.h +0 -156
- data/ext/snowcrash/src/HeaderParser.h +0 -289
- data/ext/snowcrash/src/ListBlockUtility.h +0 -273
- data/ext/snowcrash/src/ListUtility.h +0 -95
- data/ext/snowcrash/src/MarkdownBlock.cc +0 -176
- data/ext/snowcrash/src/MarkdownBlock.h +0 -93
- data/ext/snowcrash/src/MarkdownParser.cc +0 -266
- data/ext/snowcrash/src/ParameterDefinitonParser.h +0 -645
- data/ext/snowcrash/src/Parser.cc +0 -71
- data/ext/snowcrash/src/Parser.h +0 -29
- data/ext/snowcrash/src/ParserCore.cc +0 -120
- data/ext/snowcrash/src/ParserCore.h +0 -82
- data/ext/snowcrash/src/SectionUtility.h +0 -142
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a54dde4bcbcf36bbd37d5f863e51b16bb247232a
|
|
4
|
+
data.tar.gz: 79fecb4a236ff45e54942a3da1f871088f9aba6c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9854dd4d2376d9fe8edc14791390d86a60ec973790809400c21820cf429f6fa9e08b81e13bbe1b9e21c17a7308d105d8b68f70f5d8763a6ba3ddf734bacd5657
|
|
7
|
+
data.tar.gz: bc9ed83bc8b1e0fe7a339b7c282c08740254d75490c92ec4a05e48b00134490f5b90ce095e8715ce96a2780fac71cd557463a09be7380fc83b3b51ac2e31b416
|
data/CHANGELOG.md
CHANGED
data/ext/snowcrash/Makefile
CHANGED
|
@@ -56,7 +56,7 @@ ifdef INTEGRATION_TESTS
|
|
|
56
56
|
endif
|
|
57
57
|
|
|
58
58
|
perf: perf-libsnowcrash
|
|
59
|
-
$(BUILD_DIR)/out/$(BUILDTYPE)/perf-libsnowcrash ./test/performance/fixtures/fixture-1.
|
|
59
|
+
$(BUILD_DIR)/out/$(BUILDTYPE)/perf-libsnowcrash ./test/performance/fixtures/fixture-1.apib
|
|
60
60
|
|
|
61
61
|
install: snowcrash
|
|
62
62
|
cp -f $(BUILD_DIR)/out/$(BUILDTYPE)/snowcrash $(DESTDIR)/snowcrash
|
data/ext/snowcrash/bin/snowcrash
CHANGED
|
Binary file
|
data/ext/snowcrash/configure
CHANGED
|
@@ -36,7 +36,7 @@ parser.add_option("--shared",
|
|
|
36
36
|
dest="shared",
|
|
37
37
|
help="Build and use shared libsnowcrash instead of static one.")
|
|
38
38
|
|
|
39
|
-
parser.add_option("--include-integration-tests",
|
|
39
|
+
parser.add_option("-i", "--include-integration-tests",
|
|
40
40
|
action="store_true",
|
|
41
41
|
dest="include_integration_tests",
|
|
42
42
|
help="Configure for integration testing using Cucumber")
|
|
@@ -45,7 +45,7 @@ parser.add_option("--include-integration-tests",
|
|
|
45
45
|
|
|
46
46
|
def write(filename, data):
|
|
47
47
|
filename = os.path.join(root_dir, filename)
|
|
48
|
-
print
|
|
48
|
+
print("creating " + filename)
|
|
49
49
|
f = open(filename, 'w+')
|
|
50
50
|
f.write(data)
|
|
51
51
|
|
|
@@ -58,12 +58,12 @@ def cc_macros():
|
|
|
58
58
|
stdout=subprocess.PIPE,
|
|
59
59
|
stderr=subprocess.PIPE)
|
|
60
60
|
except OSError:
|
|
61
|
-
print
|
|
61
|
+
print('''Configure error: No acceptable C compiler found!
|
|
62
62
|
|
|
63
63
|
Please make sure you have a C compiler installed on your system and/or
|
|
64
64
|
consider adjusting the CC environment variable if you installed
|
|
65
65
|
it in a non-standard prefix.
|
|
66
|
-
'''
|
|
66
|
+
''')
|
|
67
67
|
sys.exit()
|
|
68
68
|
|
|
69
69
|
p.stdin.write('\n')
|
|
@@ -129,7 +129,7 @@ def configure_snowcrash(o):
|
|
|
129
129
|
#
|
|
130
130
|
# TODO: use bundle check
|
|
131
131
|
if options.include_integration_tests:
|
|
132
|
-
print
|
|
132
|
+
print("Installing dependencies for integration tests...")
|
|
133
133
|
try:
|
|
134
134
|
if sys.platform == 'win32':
|
|
135
135
|
subprocess.call(["bundle.bat", "install"])
|
|
@@ -139,9 +139,9 @@ if options.include_integration_tests:
|
|
|
139
139
|
if e.errno == os.errno.ENOENT:
|
|
140
140
|
raise RuntimeError(
|
|
141
141
|
"Integration test dependecies rely on Ruby Bundler "
|
|
142
|
-
"but it cannot be
|
|
142
|
+
"but it cannot be found in the system $PATH. "
|
|
143
143
|
"Please make sure to install Bundler or/and to "
|
|
144
|
-
"add it to the $PATH."
|
|
144
|
+
"add it to the $PATH. E.g.: by running `sudo gem install bundler`"
|
|
145
145
|
)
|
|
146
146
|
else:
|
|
147
147
|
raise
|
|
@@ -188,7 +188,7 @@ write('config.mk',
|
|
|
188
188
|
#
|
|
189
189
|
# Gyp call
|
|
190
190
|
#
|
|
191
|
-
print
|
|
191
|
+
print("creating makefiles")
|
|
192
192
|
|
|
193
193
|
gyp_args = ['--generator-output', build_dir, '--depth', '.']
|
|
194
194
|
if sys.platform == 'win32':
|
|
@@ -210,4 +210,4 @@ if os.path.exists(options_fn):
|
|
|
210
210
|
subprocess.call([sys.executable, 'tools/gyp/gyp_main.py'] + gyp_args)
|
|
211
211
|
|
|
212
212
|
# All done
|
|
213
|
-
print
|
|
213
|
+
print("All OK.")
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Default Shell
|
|
2
|
+
SHELL = /bin/bash
|
|
3
|
+
|
|
4
|
+
# Default build path
|
|
5
|
+
BUILD_PATH = build
|
|
6
|
+
|
|
7
|
+
# Default C++ extension
|
|
8
|
+
CXX_SRC_EXT = cc
|
|
9
|
+
|
|
10
|
+
# Default C extension
|
|
11
|
+
C_SRC_EXT = c
|
|
12
|
+
|
|
13
|
+
# Markdown parser source directory
|
|
14
|
+
SRC_PATH = src
|
|
15
|
+
|
|
16
|
+
# Test source directory
|
|
17
|
+
TEST_SRC_PATH = test
|
|
18
|
+
|
|
19
|
+
# Sundown include paths
|
|
20
|
+
SUNDOWN_INCLUDES = -Iext/sundown/src/ -Iext/sundown/html/
|
|
21
|
+
|
|
22
|
+
# Markdown parser include paths
|
|
23
|
+
INCLUDES = -I$(SRC_PATH) $(SUNDOWN_INCLUDES)
|
|
24
|
+
|
|
25
|
+
# Test include paths
|
|
26
|
+
TEST_INCLUDES = $(INCLUDES) -I$(TEST_SRC_PATH) -Itest/ext/Catch/single_include
|
|
27
|
+
|
|
28
|
+
# Markdown parser objects
|
|
29
|
+
LIB_SRC = $(shell find $(SRC_PATH)/ -name '*.$(CXX_SRC_EXT)')
|
|
30
|
+
LIB_OBJ = $(LIB_SRC:$(SRC_PATH)/%.$(CXX_SRC_EXT)=$(BUILD_PATH)/%.o)
|
|
31
|
+
LIB_DEPS = $(LIB_OBJ:.o=.d)
|
|
32
|
+
|
|
33
|
+
# Sundown library objects
|
|
34
|
+
SUNDOWN_SRC=\
|
|
35
|
+
ext/sundown/src/markdown.c \
|
|
36
|
+
ext/sundown/src/stack.c \
|
|
37
|
+
ext/sundown/src/buffer.c \
|
|
38
|
+
ext/sundown/src/autolink.c \
|
|
39
|
+
ext/sundown/src/src_map.c \
|
|
40
|
+
ext/sundown/html/html.c \
|
|
41
|
+
ext/sundown/html/html_smartypants.c \
|
|
42
|
+
ext/sundown/html/houdini_html_e.c \
|
|
43
|
+
ext/sundown/html/houdini_href_e.c
|
|
44
|
+
SUNDOWN_OBJ = $(addprefix $(BUILD_PATH)/,$(addsuffix .o,$(basename $(SUNDOWN_SRC))))
|
|
45
|
+
|
|
46
|
+
# Markdown parser tests object
|
|
47
|
+
TEST_SRC = $(shell find $(TEST_SRC_PATH)/ -name '*.$(CXX_SRC_EXT)')
|
|
48
|
+
TEST_OBJ = $(TEST_SRC:$(TEST_SRC_PATH)/%.$(CXX_SRC_EXT)=$(BUILD_PATH)/%.o)
|
|
49
|
+
TEST_DEPS = $(TEST_OBJ:.o=.d)
|
|
50
|
+
|
|
51
|
+
.PHONY: all
|
|
52
|
+
all: libmarkdownparser.a test-libmarkdownparser libsundown.a
|
|
53
|
+
|
|
54
|
+
libsundown.a: $(SUNDOWN_OBJ)
|
|
55
|
+
$(AR) rcs $(BUILD_PATH)/libsundown.a $^
|
|
56
|
+
|
|
57
|
+
libmarkdownparser.a: $(LIB_OBJ)
|
|
58
|
+
$(AR) rcs $(BUILD_PATH)/libmarkdownparser.a $^
|
|
59
|
+
|
|
60
|
+
test-libmarkdownparser: libmarkdownparser.a libsundown.a $(TEST_OBJ)
|
|
61
|
+
$(CXX) $(TEST_OBJ) $(BUILD_PATH)/libmarkdownparser.a $(BUILD_PATH)/libsundown.a $(LDFLAGS) -o $(BUILD_PATH)/$@
|
|
62
|
+
|
|
63
|
+
.PHONY: test
|
|
64
|
+
test: test-libmarkdownparser
|
|
65
|
+
$(BUILD_PATH)/test-libmarkdownparser
|
|
66
|
+
|
|
67
|
+
.PHONY: clean
|
|
68
|
+
clean:
|
|
69
|
+
$(RM) -r build
|
|
70
|
+
$(RM) -r bin
|
|
71
|
+
|
|
72
|
+
$(BUILD_PATH)/%.o: $(SRC_PATH)/%.$(CXX_SRC_EXT)
|
|
73
|
+
$(CXX) $(CXXFLAGS) $(INCLUDES) -MP -MMD -c $< -o $@
|
|
74
|
+
|
|
75
|
+
$(BUILD_PATH)/%.o: $(TEST_SRC_PATH)/%.$(CXX_SRC_EXT)
|
|
76
|
+
$(CXX) $(CXXFLAGS) $(TEST_INCLUDES) -MP -MMD -c $< -o $@
|
|
77
|
+
|
|
78
|
+
$(BUILD_PATH)/%.o: %.$(C_SRC_EXT)
|
|
79
|
+
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
|
|
80
|
+
|
|
81
|
+
$(LIB_OBJ): | $(BUILD_PATH)
|
|
82
|
+
$(SUNDOWN_OBJ): | $(BUILD_PATH)
|
|
83
|
+
|
|
84
|
+
$(BUILD_PATH):
|
|
85
|
+
mkdir -p $(BUILD_PATH)
|
|
86
|
+
mkdir -p $(BUILD_PATH)/ext/sundown/src/
|
|
87
|
+
mkdir -p $(BUILD_PATH)/ext/sundown/html/
|
|
File without changes
|
|
@@ -27,6 +27,7 @@ CC=gcc
|
|
|
27
27
|
SUNDOWN_SRC=\
|
|
28
28
|
src/markdown.o \
|
|
29
29
|
src/stack.o \
|
|
30
|
+
src/src_map.o \
|
|
30
31
|
src/buffer.o \
|
|
31
32
|
src/autolink.o \
|
|
32
33
|
html/html.o \
|
|
@@ -44,7 +45,7 @@ libsundown.so: libsundown.so.1
|
|
|
44
45
|
ln -f -s $^ $@
|
|
45
46
|
|
|
46
47
|
libsundown.so.1: $(SUNDOWN_SRC)
|
|
47
|
-
$(CC) $(LDFLAGS) -shared
|
|
48
|
+
$(CC) $(LDFLAGS) -shared $^ -o $@
|
|
48
49
|
|
|
49
50
|
# executables
|
|
50
51
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1659,6 +1659,7 @@ parse_listitem(struct buf *ob, struct sd_markdown *rndr, uint8_t *data, size_t s
|
|
|
1659
1659
|
size_t beg = 0, end, pre, sublist = 0, orgpre = 0, i = 0;
|
|
1660
1660
|
int in_empty = 0, has_inside_empty = 0, in_fence = 0;
|
|
1661
1661
|
src_map *item_map = NULL;
|
|
1662
|
+
src_map *whole_item_map = NULL;
|
|
1662
1663
|
|
|
1663
1664
|
/* keeping track of the first indentation prefix */
|
|
1664
1665
|
while (orgpre < 3 && orgpre < size && data[orgpre] == ' ')
|
|
@@ -1793,7 +1794,7 @@ parse_listitem(struct buf *ob, struct sd_markdown *rndr, uint8_t *data, size_t s
|
|
|
1793
1794
|
|
|
1794
1795
|
/* source map */
|
|
1795
1796
|
if (item_map)
|
|
1796
|
-
sublist_map = src_map_new_tail(item_map, sublist);
|
|
1797
|
+
sublist_map = src_map_new_tail(item_map, sublist, -1);
|
|
1797
1798
|
|
|
1798
1799
|
parse_block(inter, rndr, work->data + sublist, work->size - sublist, sublist_map);
|
|
1799
1800
|
|
|
@@ -1811,7 +1812,7 @@ parse_listitem(struct buf *ob, struct sd_markdown *rndr, uint8_t *data, size_t s
|
|
|
1811
1812
|
|
|
1812
1813
|
/* source map */
|
|
1813
1814
|
if (item_map)
|
|
1814
|
-
sublist_map = src_map_new_tail(item_map, sublist);
|
|
1815
|
+
sublist_map = src_map_new_tail(item_map, sublist, -1);
|
|
1815
1816
|
|
|
1816
1817
|
parse_block(inter, rndr, work->data + sublist, work->size - sublist, sublist_map);
|
|
1817
1818
|
|
|
@@ -1828,10 +1829,15 @@ parse_listitem(struct buf *ob, struct sd_markdown *rndr, uint8_t *data, size_t s
|
|
|
1828
1829
|
|
|
1829
1830
|
/* source map */
|
|
1830
1831
|
if (item_map) {
|
|
1832
|
+
range r = { orgpre, beg };
|
|
1833
|
+
|
|
1834
|
+
whole_item_map = src_map_new_tail(map, r.loc, r.len);
|
|
1835
|
+
|
|
1831
1836
|
if (rndr->cb.block_did_parse)
|
|
1832
|
-
rndr->cb.block_did_parse(
|
|
1837
|
+
rndr->cb.block_did_parse(whole_item_map, data + i, size - i, rndr->opaque);
|
|
1833
1838
|
|
|
1834
1839
|
src_map_release(item_map);
|
|
1840
|
+
src_map_release(whole_item_map);
|
|
1835
1841
|
}
|
|
1836
1842
|
|
|
1837
1843
|
rndr_popbuf(rndr, BUFFER_SPAN);
|
|
File without changes
|
|
@@ -124,8 +124,8 @@ src_map_append(src_map *map, const range *r)
|
|
|
124
124
|
if (map->size) {
|
|
125
125
|
/* check continuous range */
|
|
126
126
|
range *last_range = (range *)map->item[map->size - 1];
|
|
127
|
-
if (r->loc
|
|
128
|
-
last_range->len += r->len;
|
|
127
|
+
if (r->loc <= last_range->loc + last_range->len) {
|
|
128
|
+
last_range->len += r->len - (last_range->loc + last_range->len - r->loc);
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
@@ -161,11 +161,12 @@ src_map_location(const src_map *map, size_t index)
|
|
|
161
161
|
|
|
162
162
|
/* create new src_map from index onward */
|
|
163
163
|
src_map *
|
|
164
|
-
src_map_new_tail(const src_map *map, size_t index)
|
|
164
|
+
src_map_new_tail(const src_map *map, size_t index, size_t maxlen)
|
|
165
165
|
{
|
|
166
166
|
size_t i = 0;
|
|
167
167
|
size_t cur = 0;
|
|
168
168
|
size_t first_item = -1;
|
|
169
|
+
size_t count = 0;
|
|
169
170
|
src_map *new_map = NULL;
|
|
170
171
|
|
|
171
172
|
if (!map ||
|
|
@@ -187,13 +188,16 @@ src_map_new_tail(const src_map *map, size_t index)
|
|
|
187
188
|
|
|
188
189
|
/* create new map */
|
|
189
190
|
new_map = src_map_new();
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
for (i = first_item; i < map->size && count < maxlen; ++i) {
|
|
192
|
+
|
|
193
193
|
range *it = (range *)map->item[i];
|
|
194
194
|
range *add_range = range_new(it->loc, it->len);
|
|
195
|
-
stack_push(new_map, add_range);
|
|
196
195
|
|
|
196
|
+
if (count + it->len > maxlen) {
|
|
197
|
+
add_range->len = maxlen - count;
|
|
198
|
+
}
|
|
199
|
+
count += it->len;
|
|
200
|
+
stack_push(new_map, add_range);
|
|
197
201
|
}
|
|
198
202
|
|
|
199
203
|
return new_map;
|
|
@@ -42,7 +42,7 @@ void src_map_release(src_map *map);
|
|
|
42
42
|
src_map *src_map_new_submap(const src_map *map, const range *r);
|
|
43
43
|
|
|
44
44
|
/* src_map_new_tail: create map from tail of map */
|
|
45
|
-
src_map *src_map_new_tail(const src_map *map, size_t index);
|
|
45
|
+
src_map *src_map_new_tail(const src_map *map, size_t index, size_t maxlen);
|
|
46
46
|
|
|
47
47
|
/* src_map_append: append range to source map */
|
|
48
48
|
void src_map_append(src_map *map, const range *r);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="Windows-1252"?>
|
|
2
|
+
<VisualStudioProject
|
|
3
|
+
ProjectType="Visual C++"
|
|
4
|
+
Version="9.00"
|
|
5
|
+
Name="markdown"
|
|
6
|
+
ProjectGUID="{288550BA-B6D6-4254-B5E3-9E8CE20970AE}"
|
|
7
|
+
RootNamespace="markdown"
|
|
8
|
+
TargetFrameworkVersion="196613"
|
|
9
|
+
>
|
|
10
|
+
<Platforms>
|
|
11
|
+
<Platform
|
|
12
|
+
Name="Win32"
|
|
13
|
+
/>
|
|
14
|
+
</Platforms>
|
|
15
|
+
<ToolFiles>
|
|
16
|
+
</ToolFiles>
|
|
17
|
+
<Configurations>
|
|
18
|
+
<Configuration
|
|
19
|
+
Name="Debug|Win32"
|
|
20
|
+
OutputDirectory="..\..\build\debug"
|
|
21
|
+
IntermediateDirectory="..\..\build\data\markdown\debug"
|
|
22
|
+
ConfigurationType="4"
|
|
23
|
+
CharacterSet="2"
|
|
24
|
+
>
|
|
25
|
+
<Tool
|
|
26
|
+
Name="VCPreBuildEventTool"
|
|
27
|
+
/>
|
|
28
|
+
<Tool
|
|
29
|
+
Name="VCCustomBuildTool"
|
|
30
|
+
/>
|
|
31
|
+
<Tool
|
|
32
|
+
Name="VCXMLDataGeneratorTool"
|
|
33
|
+
/>
|
|
34
|
+
<Tool
|
|
35
|
+
Name="VCWebServiceProxyGeneratorTool"
|
|
36
|
+
/>
|
|
37
|
+
<Tool
|
|
38
|
+
Name="VCMIDLTool"
|
|
39
|
+
/>
|
|
40
|
+
<Tool
|
|
41
|
+
Name="VCCLCompilerTool"
|
|
42
|
+
Optimization="0"
|
|
43
|
+
AdditionalIncludeDirectories="..\..\ext\sundown\src"
|
|
44
|
+
MinimalRebuild="true"
|
|
45
|
+
BasicRuntimeChecks="3"
|
|
46
|
+
RuntimeLibrary="3"
|
|
47
|
+
WarningLevel="3"
|
|
48
|
+
DebugInformationFormat="4"
|
|
49
|
+
/>
|
|
50
|
+
<Tool
|
|
51
|
+
Name="VCManagedResourceCompilerTool"
|
|
52
|
+
/>
|
|
53
|
+
<Tool
|
|
54
|
+
Name="VCResourceCompilerTool"
|
|
55
|
+
/>
|
|
56
|
+
<Tool
|
|
57
|
+
Name="VCPreLinkEventTool"
|
|
58
|
+
/>
|
|
59
|
+
<Tool
|
|
60
|
+
Name="VCLibrarianTool"
|
|
61
|
+
/>
|
|
62
|
+
<Tool
|
|
63
|
+
Name="VCALinkTool"
|
|
64
|
+
/>
|
|
65
|
+
<Tool
|
|
66
|
+
Name="VCXDCMakeTool"
|
|
67
|
+
/>
|
|
68
|
+
<Tool
|
|
69
|
+
Name="VCBscMakeTool"
|
|
70
|
+
/>
|
|
71
|
+
<Tool
|
|
72
|
+
Name="VCFxCopTool"
|
|
73
|
+
/>
|
|
74
|
+
<Tool
|
|
75
|
+
Name="VCPostBuildEventTool"
|
|
76
|
+
/>
|
|
77
|
+
</Configuration>
|
|
78
|
+
<Configuration
|
|
79
|
+
Name="Release|Win32"
|
|
80
|
+
OutputDirectory="..\..\build\release"
|
|
81
|
+
IntermediateDirectory="..\..\build\data\markdown\release"
|
|
82
|
+
ConfigurationType="4"
|
|
83
|
+
CharacterSet="2"
|
|
84
|
+
WholeProgramOptimization="1"
|
|
85
|
+
>
|
|
86
|
+
<Tool
|
|
87
|
+
Name="VCPreBuildEventTool"
|
|
88
|
+
/>
|
|
89
|
+
<Tool
|
|
90
|
+
Name="VCCustomBuildTool"
|
|
91
|
+
/>
|
|
92
|
+
<Tool
|
|
93
|
+
Name="VCXMLDataGeneratorTool"
|
|
94
|
+
/>
|
|
95
|
+
<Tool
|
|
96
|
+
Name="VCWebServiceProxyGeneratorTool"
|
|
97
|
+
/>
|
|
98
|
+
<Tool
|
|
99
|
+
Name="VCMIDLTool"
|
|
100
|
+
/>
|
|
101
|
+
<Tool
|
|
102
|
+
Name="VCCLCompilerTool"
|
|
103
|
+
Optimization="2"
|
|
104
|
+
EnableIntrinsicFunctions="true"
|
|
105
|
+
AdditionalIncludeDirectories="..\..\ext\sundown\src"
|
|
106
|
+
RuntimeLibrary="2"
|
|
107
|
+
EnableFunctionLevelLinking="true"
|
|
108
|
+
WarningLevel="3"
|
|
109
|
+
DebugInformationFormat="3"
|
|
110
|
+
/>
|
|
111
|
+
<Tool
|
|
112
|
+
Name="VCManagedResourceCompilerTool"
|
|
113
|
+
/>
|
|
114
|
+
<Tool
|
|
115
|
+
Name="VCResourceCompilerTool"
|
|
116
|
+
/>
|
|
117
|
+
<Tool
|
|
118
|
+
Name="VCPreLinkEventTool"
|
|
119
|
+
/>
|
|
120
|
+
<Tool
|
|
121
|
+
Name="VCLibrarianTool"
|
|
122
|
+
/>
|
|
123
|
+
<Tool
|
|
124
|
+
Name="VCALinkTool"
|
|
125
|
+
/>
|
|
126
|
+
<Tool
|
|
127
|
+
Name="VCXDCMakeTool"
|
|
128
|
+
/>
|
|
129
|
+
<Tool
|
|
130
|
+
Name="VCBscMakeTool"
|
|
131
|
+
/>
|
|
132
|
+
<Tool
|
|
133
|
+
Name="VCFxCopTool"
|
|
134
|
+
/>
|
|
135
|
+
<Tool
|
|
136
|
+
Name="VCPostBuildEventTool"
|
|
137
|
+
/>
|
|
138
|
+
</Configuration>
|
|
139
|
+
</Configurations>
|
|
140
|
+
<References>
|
|
141
|
+
</References>
|
|
142
|
+
<Files>
|
|
143
|
+
<Filter
|
|
144
|
+
Name="Source Files"
|
|
145
|
+
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
|
146
|
+
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
|
147
|
+
>
|
|
148
|
+
<File
|
|
149
|
+
RelativePath="..\..\src\ByteBuffer.cc"
|
|
150
|
+
>
|
|
151
|
+
</File>
|
|
152
|
+
<File
|
|
153
|
+
RelativePath="..\..\src\MarkdownNode.cc"
|
|
154
|
+
>
|
|
155
|
+
</File>
|
|
156
|
+
<File
|
|
157
|
+
RelativePath="..\..\src\MarkdownParser.cc"
|
|
158
|
+
>
|
|
159
|
+
</File>
|
|
160
|
+
</Filter>
|
|
161
|
+
<Filter
|
|
162
|
+
Name="Header Files"
|
|
163
|
+
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
|
164
|
+
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
|
165
|
+
>
|
|
166
|
+
<File
|
|
167
|
+
RelativePath="..\..\src\ByteBuffer.h"
|
|
168
|
+
>
|
|
169
|
+
</File>
|
|
170
|
+
<File
|
|
171
|
+
RelativePath="..\..\src\MarkdownNode.h"
|
|
172
|
+
>
|
|
173
|
+
</File>
|
|
174
|
+
<File
|
|
175
|
+
RelativePath="..\..\src\MarkdownParser.h"
|
|
176
|
+
>
|
|
177
|
+
</File>
|
|
178
|
+
</Filter>
|
|
179
|
+
<Filter
|
|
180
|
+
Name="Resource Files"
|
|
181
|
+
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
|
182
|
+
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
|
183
|
+
>
|
|
184
|
+
</Filter>
|
|
185
|
+
</Files>
|
|
186
|
+
<Globals>
|
|
187
|
+
</Globals>
|
|
188
|
+
</VisualStudioProject>
|