Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid AST shape error when using strings for brackets #109

Closed
MeAmAnUsername opened this issue Feb 4, 2022 · 1 comment
Closed

Invalid AST shape error when using strings for brackets #109

MeAmAnUsername opened this issue Feb 4, 2022 · 1 comment
Labels
C-Bug Category: bug. Not working as expected

Comments

@MeAmAnUsername
Copy link

Summary

Giving strings to the bracket option in bracket-symbols section of spoofaxc.cfg results in an 'invalid AST shape' error

What you did

Added the following section to my spoofaxc.cfg file:

bracket-symbols {
  bracket = "(" * ")"
}

Note: it should be characters, i.e. using single quotes: bracket = '(' * ')'

What you expected to happen

It works, or shows an error in the editor.

What actually happened

An error dialog pops up with the error "Invalid AST shape".

Context

  • Spoofax version: 0.16.17
  • Operating system & version: MacOS 10.14.6 (18G9323)
  • Java version (if applicable): built-in
  • Eclipse version (if applicable): 4.22.0.20211202-1200

Additional information

Full stacktrace:

mb.aterm.common.InvalidAstShapeException: BUG: invalid AST shape, expected Char application in AST: String("\"(\""{TermIndex("eclipse-resource##/pie.lang/spoofaxc.cfg",38)}){TermIndex("eclipse-resource##/pie.lang/spoofaxc.cfg",39)}
	at mb.cfg.convert.Parts.toJavaChar(Parts.java:385)
	at mb.cfg.convert.CfgAstToObject.lambda$convert$27(CfgAstToObject.java:328)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	at mb.cfg.convert.Parts.forAll(Parts.java:189)
	at mb.cfg.convert.CfgAstToObject.lambda$convert$28(CfgAstToObject.java:327)
	at mb.common.option.Option.ifSome(Option.java:72)
	at mb.cfg.convert.CfgAstToObject.convert(CfgAstToObject.java:326)
	at mb.cfg.task.CfgToObject.toOutput(CfgToObject.java:159)
	at mb.cfg.task.CfgToObject.lambda$exec$0(CfgToObject.java:136)
	at mb.common.option.Option.mapOrElse(Option.java:137)
	at mb.common.result.Result.flatMap(Result.java:417)
	at mb.cfg.task.CfgToObject.lambda$exec$1(CfgToObject.java:136)
	at mb.common.option.Option.mapOrElse(Option.java:137)
	at mb.common.result.Result.flatMap(Result.java:417)
	at mb.cfg.task.CfgToObject.exec(CfgToObject.java:134)
	at mb.cfg.task.CfgToObject.exec(CfgToObject.java:26)
	at mb.pie.api.Task.exec(Task.java:56)
	at mb.pie.runtime.exec.TaskExecutor.execInternal(TaskExecutor.java:130)
	at mb.pie.runtime.exec.TaskExecutor.exec(TaskExecutor.java:87)
	at mb.pie.runtime.exec.BottomUpRunner.exec(BottomUpRunner.java:419)
	at mb.pie.runtime.exec.BottomUpRunner.execAndSchedule(BottomUpRunner.java:132)
	at mb.pie.runtime.exec.BottomUpRunner.execScheduled(BottomUpRunner.java:119)
	at mb.pie.runtime.exec.BottomUpRunner.requireInitial(BottomUpRunner.java:82)
	at mb.pie.runtime.MixedSessionImpl.lambda$updateAffectedBy$0(MixedSessionImpl.java:72)
	at mb.pie.runtime.SessionImpl.handleException(SessionImpl.java:227)
	at mb.pie.runtime.MixedSessionImpl.updateAffectedBy(MixedSessionImpl.java:72)
	at mb.spoofax.eclipse.pie.PieRunner.updateAffectedBy(PieRunner.java:505)
	at mb.spoofax.eclipse.pie.PieRunner.addOrUpdateEditor(PieRunner.java:142)
	at mb.spoofax.eclipse.editor.EditorUpdateJob.update(EditorUpdateJob.java:112)
	at mb.spoofax.eclipse.editor.EditorUpdateJob.run(EditorUpdateJob.java:79)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
@MeAmAnUsername MeAmAnUsername added the C-Bug Category: bug. Not working as expected label Feb 4, 2022
@Gohla
Copy link
Member

Gohla commented May 18, 2022

Fixed by 8f68232

@Gohla Gohla closed this as completed May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Bug Category: bug. Not working as expected
Projects
None yet
Development

No branches or pull requests

2 participants