feat: add Alexander Roper to AUTHORS and expand embedding API documentation

- Add Alexander Roper to AUTHORS file with newline fix for Starbeamrainbowlabs entry
- Replace placeholder embedding API docs with full guide covering static/dynamic linking and source inclusion
- Update codebase line count from 5,000 to 7,000 lines in README and index
- Fix relative documentation links to absolute URLs in README
- Add CSS styling for preprocessor directive syntax highlighting
- Update Xcode project file references and CopyFiles build phase UUID
- Adjust delta_blue benchmark expected value from 7032700 to 14065400
- Improve markdown header detection regex in generate_docs.py to avoid matching #include
- Refactor metrics.py to exclude curly brace lines from code line counting
- Add TEST_HEADERS dependency to test object compilation in wren.mk
- Remove NULL parameter from runFile call in main.c
- Refactor vm.c to support WrenBindForeignClassFn callback and rename externalBindForeign to bindMethodFn
- Update vm.h to remove bindForeign parameter documentation and adjust runFile signature
This commit is contained in:
Bob Nystrom
2015-08-29 06:13:56 +00: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) $<