Skip to content

Commit

Permalink
CHANGE: construct not converting lit-word! and lit-path! to `wo…
Browse files Browse the repository at this point in the history
…rd!` and `path!`

resolves: Oldes/Rebol-issues#2502
related to: Oldes/Rebol-issues#651
  • Loading branch information
Oldes committed May 17, 2024
1 parent 8ee60c8 commit 2ed680c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions make/rebol3.nest
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ config: [ ;- this is list of configuration (optional) defines
;FORCE_ANSI_ESC_EMULATION_ON_WINDOWS ; would not try to use MS' built-in VIRTUAL_TERMINAL_PROCESSING
;EXCLUDE_VECTOR_MATH ; don't include vector math support (like: 3 * #[vector! integer! 8 3 [1 2 3]]); Used in t-vector.c file
;WRITE_ANY_VALUE_TO_CLIPBOARD ; https://github.com/Oldes/Rebol-issues/issues/1619
;CONSTRUCT_LIT_WORD_AS_WORD ; https://github.com/Oldes/Rebol-issues/issues/2502

;SERIES_LABELS ; used for special debug purposes
;SHOW_SIZEOFS ; for debugging ports to some new systems
Expand Down
3 changes: 3 additions & 0 deletions src/core/c-do.c
Original file line number Diff line number Diff line change
Expand Up @@ -1678,6 +1678,8 @@ x*/ static REBINT Do_Args_Light(REBVAL *func, REBVAL *path, REBSER *block, REBCN
VAL_SET(temp, REB_WORD);
}
}
#ifdef CONSTRUCT_LIT_WORD_AS_WORD
//https://github.com/Oldes/Rebol-issues/issues/2502
else if (IS_LIT_WORD(value)) {
*temp = *value;
VAL_SET(temp, REB_WORD);
Expand All @@ -1686,6 +1688,7 @@ x*/ static REBINT Do_Args_Light(REBVAL *func, REBVAL *path, REBSER *block, REBCN
*temp = *value;
VAL_SET(temp, REB_PATH);
}
#endif
else if (VAL_TYPE(value) >= REB_NONE) { // all valid values
*temp = *value;
}
Expand Down
7 changes: 5 additions & 2 deletions src/tests/units/object-test.r3
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ Rebol [

--test-- "construct"
;@@ https://github.com/Oldes/Rebol-issues/issues/651
;@@ https://github.com/Oldes/Rebol-issues/issues/2502
--assert logic? get in construct [a: true] 'a
--assert logic? get in construct [a: false] 'a
--assert logic? get in construct [a: on] 'a
Expand All @@ -256,9 +257,11 @@ Rebol [
--assert none? get in construct [a: none] 'a
--assert none? get/any in construct head insert tail [a:]() 'a
--assert word? get in construct [a: b] 'a
--assert word? get in construct [a: 'b] 'a
--assert lit-word? get in construct [a: 'b] 'a
--assert get-word? get in construct [a: :b] 'a
--assert path? get in construct [a: b/c] 'a
--assert path? get in construct [a: 'b/c] 'a
--assert lit-path? get in construct [a: 'b/c] 'a
--assert get-path? get in construct [a: :b/c] 'a

--test-- "construct/only"
;@@ https://github.com/Oldes/Rebol-issues/issues/687
Expand Down

0 comments on commit 2ed680c

Please sign in to comment.