fostr/trans/analysis.str

54 lines
1.6 KiB
Plaintext
Raw Normal View History

module analysis
imports
statixruntime
statix/api
pp
injections/-
libspoofax/term/origin
desugar
rules // Analysis
// single-file analysis
editor-analyze = stx-editor-analyze(pre-analyze, post-analyze|"statics", "programOk")
// see docs/implementation.md for details on how to switch to multi-file analysis
// multi-file analysis
// editor-analyze = stx-editor-analyze(pre-analyze, post-analyze|"statics", "projectOk", "fileOk")
pre-analyze = desugar-fostr
; origin-track-forced(explicate-injections-fostr-Start)
post-analyze = origin-track-forced(implicate-injections-fostr-Start)
rules // Editor Services
editor-resolve = stx-editor-resolve
editor-hover = stx-editor-hover
rules // Debugging
// Prints the abstract syntax ATerm of a selection.
debug-show-aterm: (sel, _, _, path, projp) -> (filename, result)
with filename := <guarantee-extension(|"aterm")> path
; result := sel
// Prints the desugared abstract syntax ATerm of a selection.
debug-desugar-fostr: (sel, _, _, path, projp) -> (filename, result)
with filename := <guarantee-extension(|"desugared.aterm")> path
; result := <desugar-fostr> sel
// Prints the pre-analyzed abstract syntax ATerm of a selection.
debug-show-pre-analyzed: (sel, _, _, path, projp) -> (filename, result)
with filename := <guarantee-extension(|"pre-analyzed.aterm")> path
; result := <pre-analyze> sel
// Prints the analyzed annotated abstract syntax ATerm of a selection.
debug-show-analyzed: (sel, _, _, path, projp) -> (filename, result)
with filename := <guarantee-extension(|"analyzed.aterm")> path
; result := sel