Sometimes SDF3-symbolsorts AST contains Result(7561), making pretty-printing fail
This SDF3-symbolsorts syntax excerpt:
RecommendConfigStaticOrder.RecommendConfigStaticOrder = [ recommendStaticOrder [ID] { [RecommendUser] [RecommendItem] [RecommendValue] [RecommendAlgorithm] [RecommendNeighborAlg] [RecommendNeighborSize] [RecommendType] [RecommendSchedule] } ]
should be transformed into this AST for generating signatures:
OpDecl("RecommendConfigStaticOrder", FunType([ ConstType(SortNoArgs("ID")), ConstType(SortNoArgs("RecommendUser")), ConstType(SortNoArgs("RecommendItem")), ConstType(SortNoArgs("RecommendValue")), ConstType(SortNoArgs("RecommendAlgorithm")), ConstType(SortNoArgs("RecommendNeighborAlg")), ConstType(SortNoArgs("RecommendNeighborSize")), ConstType(SortNoArgs("RecommendType")), ConstType(SortNoArgs("RecommendSchedule")) ], ConstType(SortNoArgs("RecommendConfigStaticOrder"))))
but sometimes it results in this AST:
OpDecl("RecommendConfigStaticOrder", Result(7561))
making pretty-printing the signatures fail:
Internal error evaluating editor-save rewriting failed, trace: editor_save_0_0 generate_all_0_0 report_with_failure_0_1 report_failure_0_2 SRTS_EXT_fatal_err_0_2 org.spoofax.interpreter.core.InterpreterException: Exception during evaluation Caused by: org.spoofax.interpreter.core.InterpreterErrorExit: Internal error: with clause failed unexpectedly in 'generate-all' Caused by: org.strategoxt.lang.StrategoErrorExit: Internal error: with clause failed unexpectedly in 'generate-all'
Making a small change so the file can be saved again solves it most of the time.
Submitted by D. Pelsmaeker on 25 July 2014 at 11:01
Issue Log
In this case, try a Reset and Reanalyse.
@Gabriel: I was having this problem a while ago. To generate the signatures I need to get the analysed AST and sometimes it is not ready yet, so, instead of the result of a task, something likeOpDecl("RecommendConfigStaticOrder", Result(7561))
appear in the AST.
There’s no way around this currently, you have to manually wait for analysis to be finished before running any builders that require the analyzed AST.
See https://yellowgrass.org/issue/Spoofax/695, https://yellowgrass.org/issue/Spoofax/262, https://yellowgrass.org/issue/Spoofax/839. I’ll hopefully fix this during my internship :)
Log in to post comments