Skip to content

Commit 450875e

Browse files
Copilotjackfirth
andcommitted
Simplify check-suite-analysis by using reysntax-analyze-for-properties-only
Instead of reimplementing the analysis logic with error handling and #lang racket checks, delegate to the existing reysntax-analyze-for- properties-only function which already handles all these cases. - Replaced custom analysis logic with call to reysntax-analyze-for-properties-only - Removed unnecessary resyntax/private/analysis import - Simplified implementation while maintaining same functionality Co-authored-by: jackfirth <[email protected]>
1 parent 1077e55 commit 450875e

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

test/private/rackunit.rkt

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
rebellion/type/tuple
3535
resyntax
3636
resyntax/base
37-
resyntax/private/analysis
3837
resyntax/private/analyzer
3938
resyntax/private/logger
4039
resyntax/private/refactoring-result
@@ -263,23 +262,9 @@
263262
(define program-src (string-source (code-block-raw-string program)))
264263
(define-values (call-with-logs-captured build-logs-info) (make-log-capture-utilities))
265264

266-
(define (skip e)
267-
(log-resyntax-error
268-
"skipping analysis\n encountered an error during macro expansion\n error:\n~a"
269-
(string-indent (exn-message e) #:amount 3))
270-
(syntax-property-bundle))
271-
272265
(define actual-props
273266
(call-with-logs-captured
274-
(λ ()
275-
(define full-source (source->string program-src))
276-
(if (string-prefix? full-source "#lang racket")
277-
(with-handlers ([exn:fail:syntax? skip]
278-
[exn:fail:filesystem:missing-module? skip]
279-
[exn:fail:contract:variable? skip])
280-
(source-code-analysis-added-syntax-properties
281-
(source-analyze program-src #:analyzers (refactoring-suite-analyzers suite))))
282-
(syntax-property-bundle)))))
267+
(λ () (reysntax-analyze-for-properties-only program-src #:suite suite))))
283268

284269
(define target-src (string-source (string-trim (code-block-raw-string target))))
285270
(define context-src-list

0 commit comments

Comments
 (0)