Skip to content

Commit 03a2cd0

Browse files
committed
FIX: ) not allowed as a first character in tag
resolves: Oldes/Rebol-issues#1317
1 parent 1a17068 commit 03a2cd0

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/core/l-scan.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@
11471147
return -TOKEN_WORD;
11481148

11491149
case LEX_SPECIAL_LESSER:
1150-
if (IS_LEX_ANY_SPACE(cp[1]) || cp[1] == ']' || cp[1] == 0) return TOKEN_WORD; // CES.9121 Was LEX_DELIMIT - changed for </tag>
1150+
if (IS_LEX_ANY_SPACE(cp[1]) || cp[1] == ']' || cp[1] == ')' || cp[1] == 0) return TOKEN_WORD; // CES.9121 Was LEX_DELIMIT - changed for </tag>
11511151

11521152
if (IS_LEX_DELIMIT(cp[2]) && (cp[1] == '>' || cp[1] == '=' || cp[1] == '<')) {
11531153
return TOKEN_WORD; // common cases: <> <= <<

src/tests/units/lexer-test.r3

+10-2
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,15 @@ Rebol [
429429
b/1 = <a<b b>
430430
b/2 = '>
431431
]
432-
432+
--test-- "issue-1317"
433+
;@@ https://github.com/Oldes/Rebol-issues/issues/1317
434+
--assert '< = transcode/one/error "<]>"
435+
--assert '< = transcode/one/error "<)>"
436+
--assert <a> = transcode/one/error "<a>"
437+
--assert [<] = transcode/one/error "[<]"
438+
--assert block? try [load "[(<)]"]
439+
--assert error? try [load "<)>"]
440+
--assert error? try [load "<]>"]
433441

434442
===end-group===
435443

@@ -646,7 +654,7 @@ Rebol [
646654
--test-- "NULLs inside loaded string"
647655
;@@ https://github.com/Oldes/Rebol3/commit/6f59240d7d4379a50fec29c4e74290ad61ba73ba
648656
out: ""
649-
--assert try/except [
657+
--assert try/with [
650658
;- using CALL as it could be reproduced only when the internal buffer is being extended durring load
651659
data: make string! 40000
652660
insert/dup data "ABCD" 10000

0 commit comments

Comments
 (0)