refactor: merge io.c file I/O and module resolution functions into vm.c

Remove the separate io.c and io.h source files, inlining their static helper functions (readFile, wrenFilePath, readModule, setRootDirectory) directly into vm.c. This frees io.c as a dedicated built-in module slot and eliminates the cross-file dependency on io.h from main.c, test/api/main.c, and the Xcode/make build systems.
This commit is contained in:
Bob Nystrom
2015-09-14 05:29:47 +00:00
parent 34bcc6bd2d
commit f12581a674
7 changed files with 100 additions and 140 deletions
+1 -2
View File
@@ -153,8 +153,7 @@ lib/lib$(WREN).$(SHARED_EXT): $(VM_OBJECTS)
# Test executable.
$(BUILD_DIR)/test/$(WREN): $(TEST_OBJECTS) $(MODULE_OBJECTS) $(VM_OBJECTS) \
$(BUILD_DIR)/cli/io.o $(BUILD_DIR)/cli/modules.o $(BUILD_DIR)/cli/vm.o \
$(LIBUV)
$(BUILD_DIR)/cli/modules.o $(BUILD_DIR)/cli/vm.o $(LIBUV)
@ printf "%10s %-30s %s\n" $(CC) $@ "$(C_OPTIONS)"
@ mkdir -p $(BUILD_DIR)/test
@ $(CC) $(CFLAGS) $^ -o $@ -lm $(LIBUV_LIBS)