Skip to content

Commit dc05db5

Browse files
committed
1 parent 48eca7e commit dc05db5

File tree

5 files changed

+215
-37
lines changed

5 files changed

+215
-37
lines changed

src/main/c/yarp/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ FUZZ_OUTPUT_DIR = $(shell pwd)/fuzz/output
1111
SOEXT := $(shell ruby -e 'puts RbConfig::CONFIG["SOEXT"]')
1212

1313
CPPFLAGS := -Iinclude
14-
CFLAGS := -g -O2 -std=c99 -Wall -Werror -Wextra -Wpedantic -Wundef -Wconversion -fPIC -fvisibility=hidden $(EXTRA_CFLAGS)
14+
CFLAGS := -g -O2 -std=c99 -Wall -Werror -Wextra -Wpedantic -Wundef -Wconversion -Wno-missing-braces -fPIC -fvisibility=hidden
1515
CC := cc
1616
WASI_SDK_PATH := /opt/wasi-sdk
1717

@@ -22,15 +22,15 @@ STATIC_OBJECTS := $(subst src/,build/static/,$(SOURCES:.c=.o))
2222

2323
all: shared static
2424

25-
shared: build/librubyparser.$(SOEXT)
26-
static: build/librubyparser.a
25+
shared: build/libprism.$(SOEXT)
26+
static: build/libprism.a
2727
wasm: javascript/src/prism.wasm
2828

29-
build/librubyparser.$(SOEXT): $(SHARED_OBJECTS)
29+
build/libprism.$(SOEXT): $(SHARED_OBJECTS)
3030
$(ECHO) "linking $@"
3131
$(Q) $(CC) $(DEBUG_FLAGS) $(CFLAGS) -shared -o $@ $(SHARED_OBJECTS)
3232

33-
build/librubyparser.a: $(STATIC_OBJECTS)
33+
build/libprism.a: $(STATIC_OBJECTS)
3434
$(ECHO) "building $@"
3535
$(Q) $(AR) $(ARFLAGS) $@ $(STATIC_OBJECTS) $(Q1:0=>/dev/null)
3636

src/main/c/yarp/include/prism/diagnostic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ typedef enum {
231231
PM_ERR_UNARY_RECEIVER_TILDE,
232232
PM_ERR_UNDEF_ARGUMENT,
233233
PM_ERR_UNTIL_TERM,
234+
PM_ERR_VOID_EXPRESSION,
234235
PM_ERR_WHILE_TERM,
235236
PM_ERR_WRITE_TARGET_READONLY,
236237
PM_ERR_WRITE_TARGET_UNEXPECTED,

src/main/c/yarp/include/prism/parser.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,12 @@ struct pm_parser {
532532
size_t index;
533533
} lex_modes;
534534

535+
/**
536+
* The common_whitespace value from the most-recently-popped heredoc mode of the lexer, so we
537+
* can dedent the heredoc after popping the lex mode.
538+
*/
539+
size_t current_string_common_whitespace;
540+
535541
/** The pointer to the start of the source. */
536542
const uint8_t *start;
537543

src/main/c/yarp/src/diagnostic.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ static const char* const diagnostic_messages[PM_DIAGNOSTIC_ID_LEN] = {
244244
[PM_ERR_UNARY_RECEIVER_PLUS] = "Expected a receiver for unary `+`",
245245
[PM_ERR_UNARY_RECEIVER_TILDE] = "Expected a receiver for unary `~`",
246246
[PM_ERR_UNTIL_TERM] = "Expected an `end` to close the `until` statement",
247+
[PM_ERR_VOID_EXPRESSION] = "Unexpected void value expression",
247248
[PM_ERR_WHILE_TERM] = "Expected an `end` to close the `while` statement",
248249
[PM_ERR_WRITE_TARGET_READONLY] = "Immutable variable as a write target",
249250
[PM_ERR_WRITE_TARGET_UNEXPECTED] = "Unexpected write target",

0 commit comments

Comments
 (0)