Merge branch 'master' into libuv

# Conflicts:
#	project/xcode/wren.xcodeproj/project.pbxproj
#	script/wren.mk
#	src/cli/main.c
#	src/cli/vm.c
#	src/cli/vm.h
#	test/api/main.c
This commit is contained in:
Bob Nystrom
2015-08-28 23:13:56 -07:00
66 changed files with 1042 additions and 487 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ BENCHMARK("binary_trees", """stretch tree of depth 13 check: -1
32 trees of depth 12 check: -32
long lived tree of depth 12 check: -1""")
BENCHMARK("delta_blue", "7032700")
BENCHMARK("delta_blue", "14065400")
BENCHMARK("fib", r"""317811
317811
+9 -2
View File
@@ -14,6 +14,13 @@ from datetime import datetime
import markdown
# Match a "## " style header. We require a space after "#" to avoid
# accidentally matching "#include" in code samples.
MARKDOWN_HEADER = re.compile(r'#+ ')
# Clean up a header to be a valid URL.
FORMAT_ANCHOR = re.compile(r'\.|\?|!|:|/|\*')
with codecs.open("doc/site/template.html", encoding="utf-8") as f:
template = f.read()
@@ -70,13 +77,13 @@ def format_file(path, skip_up_to_date):
else:
print(' '.join(["UNKNOWN COMMAND:", command, args]))
elif stripped.startswith('#'):
elif MARKDOWN_HEADER.match(stripped):
# Add anchors to the headers.
index = stripped.find(" ")
headertype = stripped[:index]
header = stripped[index:].strip()
anchor = header.lower().replace(' ', '-')
anchor = re.compile(r'\.|\?|!|:|/|\*').sub('', anchor)
anchor = FORMAT_ANCHOR.sub('', anchor)
contents += indentation + headertype
contents += '{1} <a href="#{0}" name="{0}" class="header-anchor">#</a>\n'.format(anchor, header)
+5 -1
View File
@@ -43,7 +43,11 @@ for source_path in files:
num_docs += 1
continue
if (line.strip() == ""):
stripped = line.strip()
# Don't count { or } lines since Wren's coding style puts them on their
# own lines but they don't add anything meaningful to the length of the
# program.
if (stripped == "" or stripped == "{" or stripped == "}"):
num_empty += 1
continue
+4 -2
View File
@@ -28,7 +28,9 @@ MODULE_SOURCES := $(wildcard src/module/*.c)
VM_HEADERS := $(wildcard src/vm/*.h)
VM_SOURCES := $(wildcard src/vm/*.c)
TEST_SOURCES := $(shell find test/api -name '*.c')
TEST_HEADERS := $(wildcard test/api/*.h)
TEST_SOURCES := $(wildcard test/api/*.c)
BUILD_DIR := build
C_WARNINGS := -Wall -Wextra -Werror -Wno-unused-parameter
@@ -177,7 +179,7 @@ $(BUILD_DIR)/vm/%.o: src/vm/%.c $(VM_HEADERS)
@ $(CC) -c $(CFLAGS) -Isrc/include -o $@ $(FILE_FLAG) $<
# Test object files.
$(BUILD_DIR)/test/%.o: test/api/%.c $(MODULE_HEADERS) $(VM_HEADERS) $(LIBUV)
$(BUILD_DIR)/test/%.o: test/api/%.c $(MODULE_HEADERS) $(VM_HEADERS) $(TEST_HEADERS) $(LIBUV)
@ printf "%10s %-30s %s\n" $(CC) $< "$(C_OPTIONS)"
@ mkdir -p $(dir $@)
@ $(CC) -c $(CFLAGS) $(CLI_FLAGS) -o $@ $(FILE_FLAG) $<