init commit again
This commit is contained in:
52
IBAF-Editor/trans/pp.str
Normal file
52
IBAF-Editor/trans/pp.str
Normal file
@@ -0,0 +1,52 @@
|
||||
module pp
|
||||
|
||||
imports
|
||||
libstratego-lib
|
||||
|
||||
imports
|
||||
|
||||
libstratego-gpp
|
||||
libspoofax/sdf/pp
|
||||
libspoofax/editor/refactoring/-
|
||||
pp/IBAF-parenthesize
|
||||
pp/IBAF-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-IBAF-string =
|
||||
parenthesize-IBAF
|
||||
; prettyprint-IBAF-start-symbols
|
||||
; !V([], <id>)
|
||||
; box2text-string(|120)
|
||||
|
||||
pp-partial-IBAF-string =
|
||||
parenthesize-IBAF
|
||||
; prettyprint-IBAF
|
||||
; !V([], <id>)
|
||||
; box2text-string(|120)
|
||||
|
||||
pp-partial-IBAF-string(|sort) =
|
||||
parenthesize-IBAF
|
||||
; prettyprint-IBAF(|sort)
|
||||
; !V([], <id>)
|
||||
; box2text-string(|120)
|
||||
|
||||
pp-debug :
|
||||
ast -> result
|
||||
with
|
||||
result := <pp-IBAF-string> ast
|
||||
<+ <bottomup(try(not(is-string); not(is-list); not(pp-IBAF-string); debug(!"cannot pp ")))> ast
|
||||
; result := ""
|
||||
|
||||
rules
|
||||
|
||||
construct-textual-change = construct-textual-change(pp-partial-IBAF-string, parenthesize, override-reconstruction, resugar)
|
||||
Reference in New Issue
Block a user