spoofax_helloworld/trans/pp.str

50 lines
1.3 KiB
Plaintext

module pp
imports
libstratego-gpp
libspoofax/sdf/pp
libspoofax/editor/refactoring/-
pp/spoofax_helloworld-parenthesize
pp/spoofax_helloworld-pp
rules
editor-format:
(node, _, ast, path, project-path) -> (filename, result)
with
ext := <get-extension> path
; filename := <guarantee-extension(|$[pp.[ext]])> path
; result := <pp-debug> node
rules
pp-spoofax_helloworld-string =
parenthesize-spoofax_helloworld
; prettyprint-spoofax_helloworld-start-symbols
; !V([], <id>)
; box2text-string(|120)
pp-partial-spoofax_helloworld-string =
parenthesize-spoofax_helloworld
; prettyprint-spoofax_helloworld
; !V([], <id>)
; box2text-string(|120)
pp-partial-spoofax_helloworld-string(|sort) =
parenthesize-spoofax_helloworld
; prettyprint-spoofax_helloworld(|sort)
; !V([], <id>)
; box2text-string(|120)
pp-debug :
ast -> result
with
result := <pp-spoofax_helloworld-string> ast
<+ <bottomup(try(not(is-string); not(is-list); not(pp-spoofax_helloworld-string); debug(!"cannot pp ")))> ast
; result := ""
rules
construct-textual-change = construct-textual-change(pp-partial-spoofax_helloworld-string, parenthesize, override-reconstruction, resugar)