@@ -271,6 +271,7 @@ semantic: context [
271
271
]
272
272
273
273
add-include-file : function [ top [block! ] depth [integer! ]] [
274
+ unless top [exit]
274
275
if depth <= 0 [exit]
275
276
include-file : function [ file [file! ]] [
276
277
if all [
@@ -352,7 +353,7 @@ semantic: context [
352
353
]
353
354
write-log rejoin ["parse uri: " uri]
354
355
top: lexer/transcode code
355
- repend top ['uri uri 'ftype ftype]
356
+ repend top/1 ['uri uri 'ftype ftype]
356
357
add-source-to-table uri top
357
358
top
358
359
]
@@ -1654,20 +1655,18 @@ completion: context [
1654
1655
]
1655
1656
]
1656
1657
1657
- collect-word : function [ top [block! ] pc [block! ] system? [ logic! ] ] [
1658
+ collect-word : function [ top [block! ] pc [block! ]] [
1658
1659
result: make block! 4
1659
1660
word: to word! pc/1/expr/1
1660
1661
collect-word* pc word result no
1661
1662
sources: semantic/sources
1662
1663
forall sources [
1663
- if sources/1 <> top [
1664
- nsystem?: no
1665
- if all [
1666
- nsystem? = system?
1667
- nested: sources/1/1/nested
1668
- ][
1669
- collect-word* back tail nested word result no
1670
- ]
1664
+ if all [
1665
+ sources/1 <> top
1666
+ sources/1/1/ftype = top/1/ftype
1667
+ nested: sources/1/1/nested
1668
+ ][
1669
+ collect-word* back tail nested word result no
1671
1670
]
1672
1671
]
1673
1672
result
@@ -2060,7 +2059,7 @@ completion: context [
2060
2059
]
2061
2060
2062
2061
complete-word : function [ top [block! ] pc [block! ] comps [block! ]] [
2063
- system?: no
2062
+ system?: top /1/ftype = 'reds
2064
2063
system-completion-kind : function [ word [word! ]] [
2065
2064
type: type? /word get word
2066
2065
kind: case [
@@ -2119,7 +2118,7 @@ completion: context [
2119
2118
if empty? string: to string! to word! pc/1/expr/1 [
2120
2119
exit
2121
2120
]
2122
- result: collect-word top pc system?
2121
+ result: collect-word top pc
2123
2122
forall result [
2124
2123
rpc: result/1
2125
2124
top: rpc
@@ -2599,7 +2598,7 @@ completion: context [
2599
2598
specs
2600
2599
]
2601
2600
2602
- collect-path : function [ top [block! ] pc [block! ] path [block! ] *all? [logic! ] match? [logic! ] system? [ logic! ] ] [
2601
+ collect-path : function [ top [block! ] pc [block! ] path [block! ] *all? [logic! ] match? [logic! ]] [
2603
2602
specs: make block! 8
2604
2603
ret: collect-path* pc path *all? match?
2605
2604
if 0 < length? ret [
@@ -2608,25 +2607,22 @@ completion: context [
2608
2607
]
2609
2608
sources: semantic/sources
2610
2609
forall sources [
2611
- if sources/1 <> top [
2612
- nsystem?: no
2613
- if all [
2614
- nsystem? = system?
2615
- nested: sources/1/1/nested
2616
- ][
2617
- ret: collect-path* back tail nested path *all? match?
2618
- if 0 < length? ret [
2619
- append specs ret
2620
- unless *all? [return specs]
2621
- ]
2610
+ if all [
2611
+ sources/1 <> top
2612
+ sources/1/1/ftype = top/1/ftype
2613
+ nested: sources/1/1/nested
2614
+ ][
2615
+ ret: collect-path* back tail nested path *all? match?
2616
+ if 0 < length? ret [
2617
+ append specs ret
2618
+ unless *all? [return specs]
2622
2619
]
2623
2620
]
2624
2621
]
2625
2622
specs
2626
2623
]
2627
2624
2628
2625
complete-path : function [ top [block! ] pc [block! ] comps [block! ]] [
2629
- system?: no
2630
2626
complete-sys-path : function [] [
2631
2627
unless system-words/keyword? no fword [exit]
2632
2628
pure-path: to string! to path! path
@@ -2682,7 +2678,7 @@ completion: context [
2682
2678
fword: to word! paths/1
2683
2679
filter: to string! last paths
2684
2680
2685
- pcs: collect-path top pc paths no no system?
2681
+ pcs: collect-path top pc paths no no
2686
2682
forall pcs [
2687
2683
type: pcs/1/1
2688
2684
npc: pcs/1/2
@@ -2866,7 +2862,7 @@ completion: context [
2866
2862
]
2867
2863
2868
2864
resolve-word : function [ top [block! ] pc [block! ] string [string! ] itype [word! none! ]] [
2869
- system?: no
2865
+ system?: top /1/ftype = 'reds
2870
2866
resolve-word* : function [] [
2871
2867
if all [
2872
2868
set-word! = pc/1/type
@@ -3073,7 +3069,6 @@ completion: context [
3073
3069
]
3074
3070
3075
3071
hover-word* : function [ top [block! ] pc [block! ] word [word! ] *all? [logic! ]] [
3076
- system?: no
3077
3072
result: make block! 4
3078
3073
collect-word*/match? pc word result *all?
3079
3074
if all [
@@ -3082,19 +3077,17 @@ completion: context [
3082
3077
][return result]
3083
3078
sources: semantic/sources
3084
3079
forall sources [
3085
- if sources/1 <> top [
3086
- nsystem?: no
3080
+ if all [
3081
+ sources/1 <> top
3082
+ sources/1/1/ftype = top/1/ftype
3083
+ nested: sources/1/1/nested
3084
+ ][
3085
+ npc: back tail nested
3086
+ collect-word*/match? npc word result *all?
3087
3087
if all [
3088
- nsystem? = system?
3089
- nested: sources/1/1/nested
3090
- ][
3091
- npc: back tail nested
3092
- collect-word*/match? npc word result *all?
3093
- if all [
3094
- not *all?
3095
- 0 < length? result
3096
- ][return result]
3097
- ]
3088
+ not *all?
3089
+ 0 < length? result
3090
+ ][return result]
3098
3091
]
3099
3092
]
3100
3093
result
@@ -3116,8 +3109,7 @@ completion: context [
3116
3109
]
3117
3110
3118
3111
hover-path : function [ top [block! ] pc [block! ] path [block! ]] [
3119
- system?: no
3120
- result: collect-path top pc path no yes system?
3112
+ result: collect-path top pc path no yes
3121
3113
if 0 = length? result [return none]
3122
3114
pc: result/1/2
3123
3115
top: get-top pc
@@ -3210,8 +3202,7 @@ completion: context [
3210
3202
]
3211
3203
3212
3204
definition-path : function [ top [block! ] pc [block! ] path [block! ]] [
3213
- system?: no
3214
- result: collect-path top pc path yes yes system?
3205
+ result: collect-path top pc path yes yes
3215
3206
if 0 = length? result [return none]
3216
3207
ret: make block! 4
3217
3208
forall result [
0 commit comments