Skip to content

Commit 2aa6c68

Browse files
committed
FEAT: Allow direct conversion from tag! to word! (if it has valid chars)
resolves: Oldes/Rebol-wishes#2
1 parent 08bdedf commit 2aa6c68

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/core/t-word.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
return R_ARG2;
9999
}
100100
else {
101-
if (IS_STRING(arg) || IS_REF(arg)) {
101+
if (IS_STRING(arg) || IS_REF(arg) || IS_TAG(arg)) {
102102
REBYTE *bp;
103103
REBCNT len;
104104
// Set sym. Rest is set below.

src/tests/units/word-test.r3

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ Rebol [
2020
--assert 1 = length? to-word to-string to-char 126
2121
--assert 1 = length? to-word to-string to-char 128
2222

23+
--test-- "Word from tag"
24+
;@@ https://github.com/Oldes/Rebol-wishes/issues/2
25+
--assert 'a = to word! <a>
26+
--assert error? try [to word! <a b>]
27+
2328
===end-group===
2429

2530
===start-group=== "word compare"

0 commit comments

Comments
 (0)