Using the following in a Spoofax project:

  fix-path: path -> <string-replace(|"\\","/")> path
  
  editor-analyze:
    (ast, path, projectpath) -> (ast-desugared, errors, warnings, notes)
    with
      where(!""; debug)
    ; editor-init
    ; fullpath := <try(fix-path)> $[[projectpath]/[path]]
        ; (...more code...)

the following error occurred:

stratego.jvm.helper:
	[java] Main (7.28 secs)
	[java] Main: rewriting failed, trace:
	[java] 	main_0_0
	[java] 	main_strj_0_0
	[java] 	log_timed_1_2
	[java] 	xtc_input_1_0
	[java] 	xtc_temp_files_1_0
	[java] 	restore_always_2_0
	[java] 	strj_or_die_0_0
	[java] 	strj_0_0
	[java] 	dr_scope_all_verbose_1_0
	[java] 	dr_scope_1_1
	[java] 	strc_front_end_0_0
	[java] 	log_timed_1_2
	[java] 	strc_pack_stratego_trm_0_0
	[java] 	pack_stratego_trm_0_1
	[java] 	pack_stratego_0_1
	[java] 	graph_nodes_undef_3_0
	[java] 	for_3_0
	[java] 	while_not_2_0
	[java] 	GnNext_3_0
	[java] 	pack_stratego_parse_stratego_0_0
	[java] 	pack_stratego_parse_stratego_0_0
	[java] 	pack_include_pathname_0_0
	[java] 	pack_parse_stratego_0_0
	[java] 	parse_stratego_trm_0_1
	[java] 	ps_parse_module_trm_0_0
	[java] 	implode_asfix_0_0
	[java] 	implode_asfix_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplNamedCons_1_0
	[java] 	map_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplConsConc_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplConsIns_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplNamedCons_1_0
	[java] 	map_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplConsConc_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplConsConc_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplConsConc_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplConsConc_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplConsConc_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplConsConc_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplConsConc_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplConsConc_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplConsIns_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplNamedCons_1_0
	[java] 	map_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplNamedCons_1_0
	[java] 	map_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplConsIns_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplNamedCons_1_0
	[java] 	map_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplNamedCons_1_0
	[java] 	map_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplNamedCons_1_0
	[java] 	map_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplNamedCons_1_0
	[java] 	map_1_0
	[java] 	ReplCons_1_0
	[java] 	ReplNamedCons_1_0
	[java] 	map_1_0
	[java] 	AddIndentPadding_0_1
	[java] 	asfix_yield_appl_chars_0_0
	[java] 	asfix_yield_acc_1_1
	[java] 	is_int_0_0
	[java] [ Main | critical ] Internal error: with clause failed unexpectedly in rule 'AddIndentPadding'
	[java]            AddPadding(App(Call(SVar("try"),[CallNoArgs(SVar("fix-path"))]),AddPadding(NoAnnoList(AddPadding(StringQuotation1(AddPadding(""{PaddingId("o_25545")}){PaddingContext(appl(prod([],lex(parameterized-sort("Padding",[sort("StrategoHost")])),attrs([term(indentpadding)])),[]){PaddingId("o_25545")})},AddPadding(Conc(AddPadding(Conc(AddPadding([AddPadding(StringEscape1(AddPadding(""{PaddingId("p_25545")}){PaddingContext(appl(prod([],lex(parameterized-sort("Padding",[sort("StrategoHost")])),attrs([term(indentpadding)])),[]){PaddingId("p_25545")})},Var("projectpath")))]),[QStr("/")])),AddPadding([AddPadding(StringEscape1(AddPadding(""{PaddingId("q_25545")}){PaddingContext(appl(prod([],lex(parameterized-sort("Padding",[sort("StrategoHost")])),attrs([term(indentpadding)])),[]){PaddingId("q_25545")})},Var("path")))])))))))))
Submitted by Nathan Bruning on 27 May 2010 at 22:04

On 28 May 2010 at 10:02 Lennart Kats commented:

I can’t seem to reproduce this problem? Could you post the full file that’s causing it?

I tried the following:


$ str ’module foo strategies
fix-path: path -> <string-replace(|“\”,“/”)> path

editor-analyze:
(ast, path, projectpath) -> (ast-desugared, errors, warnings, notes)
with
where(!""; debug)
; editor-init
; fullpath := <try(fix-path)> $[[projectpath]/[path]]

(Using jsglr and implode-asfix also seems to work.)


On 28 May 2010 at 11:57 Nathan Bruning commented:

See this zipped project.
The particular line is in trans/webdsl_editor.str.

Compiler version is strc-java-0.17.9pre20796.


On 16 June 2010 at 10:17 Lennart Kats commented:

I just found something that could cause this: asfix-implode-appl fails if there’s ambiguous branches. I fixed this in r21013. It should also report a more complete stack trace and offending asfix tree now if asfix-implode-appl would fail again.

Log in to post comments