Skip to content

Commit 100d068

Browse files
committed
[GR-45043] Update to latest YARP
PullRequest: truffleruby/4059
2 parents 48eca7e + ffe39ce commit 100d068

File tree

8 files changed

+223
-50
lines changed

8 files changed

+223
-50
lines changed

mx.truffleruby/suite.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -219,31 +219,26 @@
219219
"ldflags": ["-pthread"],
220220
},
221221

222-
"org.prism.libyarp": {
222+
"org.prism.libprism": {
223223
"class": "YARPNativeProject",
224224
"dir": "src/main/c/yarp",
225225
# "makeTarget": "all-no-debug", # Can use this to build without asserts
226-
"results": ["build/librubyparser.a"],
227-
"buildEnv": {
228-
# system clang on macOS Mojave warns+errors for `mystruct s = { 0 };` when there are struct fields.
229-
# newer compiler do not warn for this.
230-
"EXTRA_CFLAGS": "-Wno-missing-braces",
231-
},
226+
"results": ["build/libprism.a"],
232227
"description": "YARP used as a static library"
233228
},
234229

235230
"org.truffleruby.yarp.bindings": {
236231
"dir": "src/main/c/yarp_bindings",
237232
"native": "shared_lib",
238-
"deliverable": "yarp",
233+
"deliverable": "yarpbindings",
239234
"buildDependencies": [
240-
"org.prism.libyarp", # librubyparser.a
235+
"org.prism.libprism", # libprism.a
241236
"org.prism", # for the generated JNI header file
242237
],
243238
"use_jdk_headers": True, # the generated JNI header includes jni.h
244-
"cflags": ["-g", "-Wall", "-Werror", "-pthread", "-I<path:org.prism.libyarp>/include"],
239+
"cflags": ["-g", "-Wall", "-Werror", "-pthread", "-I<path:org.prism.libprism>/include"],
245240
"ldflags": ["-pthread"],
246-
"ldlibs": ["<path:org.prism.libyarp>/build/librubyparser.a"],
241+
"ldlibs": ["<path:org.prism.libprism>/build/libprism.a"],
247242
"description": "JNI bindings for YARP"
248243
},
249244

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)