File tree 3 files changed +12
-3
lines changed
3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ scan: ; Used by scanner. Keep in sync with Value_Types in scan.h file!
50
50
"issue"
51
51
"tag"
52
52
"path"
53
+ "ref"
53
54
"refine"
54
55
"construct"
55
56
"map"
Original file line number Diff line number Diff line change 997
997
scan_state -> begin -- ;
998
998
type = TOKEN_REFINE ;
999
999
// Fast easy case:
1000
- if (ONLY_LEX_FLAG (flags , LEX_SPECIAL_WORD )) return type ;
1000
+ if (ONLY_LEX_FLAG (flags , LEX_SPECIAL_WORD ))
1001
+ return type ;
1002
+ if (* (scan_state -> end - 1 ) == ':' )
1003
+ return - type ;
1001
1004
goto scanword ;
1002
1005
}
1003
1006
if (* cp == '<' || * cp == '>' ) {
1414
1417
np = Skip_Left_Arrow (cp );
1415
1418
if (!np ) return - type ;
1416
1419
scan_state -> end = np ;
1417
- return type ;
1418
1420
}
1419
1421
else {
1420
1422
np = Skip_Right_Arrow (cp );
1421
1423
if (!np ) return - type ;
1422
1424
scan_state -> end = np ;
1423
- return type ;
1424
1425
}
1426
+ if (type == TOKEN_REFINE && (* (scan_state -> end - 1 )) == ':' )
1427
+ type = - type ;
1428
+ return type ;
1425
1429
}
1426
1430
1427
1431
Original file line number Diff line number Diff line change @@ -153,6 +153,10 @@ Rebol [
153
153
--assert all [error? e: try [load {%a^^ b} ] e/id = 'invalid]
154
154
--assert all [error? e: try [load {%a^^ } ] e/id = 'invalid]
155
155
156
+ --test-- "Invalid refine"
157
+ ;@@ https://github.com/Oldes/Rebol-issues/issues/2281
158
+ --assert all [error? e: try [load {/a:} ] e/id = 'invalid]
159
+
156
160
===end-group===
157
161
158
162
You can’t perform that action at this time.
0 commit comments