|
35 | 35 |
|
36 | 36 | ---@param source parser.object? |
37 | 37 | ---@return boolean |
38 | | -local function isConditionFilter(source) |
39 | | - if not source or not source.parent then |
40 | | - return false |
41 | | - end |
42 | | - local parent = source.parent |
43 | | - if parent.type ~= 'ifblock' |
44 | | - and parent.type ~= 'elseifblock' |
45 | | - and parent.type ~= 'while' |
46 | | - and parent.type ~= 'repeat' then |
47 | | - return false |
48 | | - end |
49 | | - return parent.filter == source |
50 | | -end |
51 | | - |
52 | 38 | ---@param source parser.object? |
53 | 39 | ---@param uri uri |
54 | 40 | ---@param callback fun(result: diag.result) |
@@ -92,23 +78,10 @@ return function (uri, callback) |
92 | 78 | and source.filter.type == 'binary' |
93 | 79 | and source.filter.op |
94 | 80 | and (source.filter.op.type == 'and' or source.filter.op.type == 'or') then |
| 81 | + checkExpression(source.filter[1], uri, callback) |
| 82 | + checkExpression(source.filter[2], uri, callback) |
95 | 83 | return |
96 | 84 | end |
97 | 85 | checkExpression(source.filter, uri, callback) |
98 | 86 | end) |
99 | | - |
100 | | - ---@async |
101 | | - guide.eachSourceType(state.ast, 'binary', function (source) |
102 | | - await.delay() |
103 | | - local op = source.op and source.op.type |
104 | | - if op ~= 'and' and op ~= 'or' then |
105 | | - return |
106 | | - end |
107 | | - if isConditionFilter(source) then |
108 | | - checkExpression(source[1], uri, callback) |
109 | | - checkExpression(source[2], uri, callback) |
110 | | - return |
111 | | - end |
112 | | - checkExpression(source[1], uri, callback) |
113 | | - end) |
114 | 87 | end |
0 commit comments