Skip to content

Commit f090ae7

Browse files
committed
FEAT: upgrades lexer scripts after callback type argument change.
`type` value is now a datatype! when a type name is passed.
1 parent 05c9ce1 commit f090ae7

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

Scripts/lexer/count-types.red

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ context [
2525
[scan load error open close] ;-- exclude 'prescan event for faster processing
2626
switch event [
2727
scan open [ ;-- only counts scanned tokens and any-block! series
28-
unless pos: find list type [repend pos: tail list [type 0]]
28+
unless pos: find/only list type [repend pos: tail list [type 0]]
2929
pos/2: pos/2 + 1
3030
event = 'open ;-- return TRUE for OPEN event, so that nested containers
3131
] ;-- can be counted properly.

Scripts/lexer/load-commas.red

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ context [
2626
inp: head input
2727
switch event [
2828
scan [
29-
if type = 'float! [ ;-- catch the float literals with commas
29+
if type = float! [ ;-- catch the float literals with commas
3030
if pos: find/part at inp token/1 #"," at inp token/2 [
3131
pos/1: #" " ;-- replace the comma in float literal by a whitespace
3232
input: at inp token/1 ;-- reposition input to try loading the token again

Scripts/lexer/longest.red

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ context [
4444
[scan load open close]
4545
switch event [
4646
scan [
47-
either any [str?: type = 'string! attempt [find any-word! get type]][
47+
either any [str?: type = string! attempt [find any-word! type]][
4848
entry: pick [string word] str?
4949
if token/2 - token/1 > length? list/:entry [
5050
list/:entry: to-string copy/part head input token

Scripts/lexer/unique-words.red

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ context [
1919
return: [logic!] ;-- YES: continue to next lexing stage, NO: cancel current token lexing
2020
][
2121
[scan] ;-- only scan events
22-
if find [word! set-word! lit-word! get-word!] type [
22+
if all [datatype? type find any-word! type][
2323
token: copy/part head input token
2424
token: trim/with to-string token "':"
2525
list/:token: 1 + any [list/:token 0]

0 commit comments

Comments
 (0)