The parser throws an IndexOutOfBoundsException in the units.mixml language.

Configuration:

  • Parse table generator: java (sdf2table: java)
  • Version: 2.4.0-SNAPSHOT (currently: 20171026-103626)

Steps to reproduce:

  1. Build the units.mixml language

  2. Copy the following contents into a .mixml file:

    do if "/" then let Eb = ![type] @0[bool] in @-3[![module :[type]]] @996[(bool | (![type] | int)|![module [type]]|int)] ; let module Oy : [data :![type :#]:#] in "" < (false : bool) < true < true < fn Sr:bool -> true else in link Ck : link Yk'5J_g : [module [module :[type]]:![type]] seals [type :#] with let Tr'5H_c'1Q_g'7S_l = [type bool -> string] in !new new new [type] [] (true ++ true,false)[] @89514[(int | int -> int)]
    
  3. Observe the error in the console:

    18:22 | ERROR | o.m.s.e.e.EditorUpdateJob      - Failed to update editor for eclipse:///org.metaborg.lang.mixml/x.mixml
    java.lang.IndexOutOfBoundsException: No token at offset 220
    	at org.spoofax.jsglr.client.imploder.Tokenizer.getTokenAtOffset(Tokenizer.java:127) ~[na:na]
    	at org.metaborg.spoofax.core.syntax.JSGLRParseErrorHandler.reportBadToken(JSGLRParseErrorHandler.java:176) ~[org.metaborg.spoofax.core_2.4.0.20171026-103626-master.jar:na]
    	at org.metaborg.spoofax.core.syntax.JSGLRParseErrorHandler.processFatalException(JSGLRParseErrorHandler.java:148) ~[org.metaborg.spoofax.core_2.4.0.20171026-103626-master.jar:na]
    	at org.metaborg.spoofax.core.syntax.JSGLRParseErrorHandler.reportSkippedRegion(JSGLRParseErrorHandler.java:107) ~[org.metaborg.spoofax.core_2.4.0.20171026-103626-master.jar:na]
    	at org.metaborg.spoofax.core.syntax.JSGLRParseErrorHandler.gatherNonFatalErrors(JSGLRParseErrorHandler.java:72) ~[org.metaborg.spoofax.core_2.4.0.20171026-103626-master.jar:na]
    	at org.metaborg.spoofax.core.syntax.JSGLR1I.parse(JSGLR1I.java:78) ~[org.metaborg.spoofax.core_2.4.0.20171026-103626-master.jar:na]
    	at org.metaborg.spoofax.core.syntax.JSGLRParseService.parse(JSGLRParseService.java:114) ~[org.metaborg.spoofax.core_2.4.0.20171026-103626-master.jar:na]
    	at org.metaborg.spoofax.core.syntax.JSGLRParseService.parse(JSGLRParseService.java:1) ~[org.metaborg.spoofax.core_2.4.0.20171026-103626-master.jar:na]
    	at org.metaborg.core.syntax.SyntaxService.parse(SyntaxService.java:38) ~[org.metaborg.core_2.4.0.20171026-103626-master.jar:na]
    	at org.metaborg.spoofax.eclipse.editor.EditorUpdateJob.parse(EditorUpdateJob.java:307) ~[org.metaborg.spoofax.eclipse_2.4.0.20171026-103626-master.jar:na]
    	at org.metaborg.spoofax.eclipse.editor.EditorUpdateJob.update(EditorUpdateJob.java:222) ~[org.metaborg.spoofax.eclipse_2.4.0.20171026-103626-master.jar:na]
    	at org.metaborg.spoofax.eclipse.editor.EditorUpdateJob.run(EditorUpdateJob.java:144) ~[org.metaborg.spoofax.eclipse_2.4.0.20171026-103626-master.jar:na]
    	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56) [org.eclipse.core.jobs_3.9.1.v20170714-0547.jar:na]
    
Submitted by Martijn on 13 November 2017 at 18:30

On 15 November 2017 at 22:19 Martijn commented:

If found the same problem in the stratego.typed language. Configuration is the same as above (i.e. Java parse table generator, Spoofax 2.4.0-SNAPSHOT-20171026-103626).

In the file foo.str:

module foo

strategies

  internal U(|) =
    /  \ /* proceed W(h : x) =
    some( \ a /* id; 1 { id } < 1 + id )

On the console:

22:12 | ERROR | o.m.s.e.e.EditorUpdateJob      - Failed to update editor for eclipse:///org.metaborg.meta.lang.stratego.typed/x.stratego
java.lang.IndexOutOfBoundsException: No token at offset 112
	at org.spoofax.jsglr.client.imploder.Tokenizer.getTokenAtOffset(Tokenizer.java:127) ~[na:na]
	at org.spoofax.jsglr.client.imploder.AbstractTokenizer.makeAdjunct(AbstractTokenizer.java:370) ~[na:na]
	at org.spoofax.jsglr.client.imploder.AbstractTokenizer.makeAdjunct(AbstractTokenizer.java:362) ~[na:na]
	at org.spoofax.jsglr.client.imploder.AbstractTokenizer.makeErrorAdjunctBackwards(AbstractTokenizer.java:351) ~[na:na]
	at org.spoofax.jsglr.client.imploder.AbstractTokenizer.makeErrorAdjunct(AbstractTokenizer.java:306) ~[na:na]
	at org.spoofax.jsglr.client.imploder.AbstractTokenizer.getErrorTokenOrAdjunct(AbstractTokenizer.java:300) ~[na:na]
	at org.metaborg.spoofax.core.syntax.JSGLRParseErrorHandler.reportErrorNearOffset(JSGLRParseErrorHandler.java:185) ~[org.metaborg.spoofax.core_2.4.0.20171026-103626-master.jar:na]
	at org.metaborg.spoofax.core.syntax.JSGLRParseErrorHandler.reportBadToken(JSGLRParseErrorHandler.java:180) ~[org.metaborg.spoofax.core_2.4.0.20171026-103626-master.jar:na]
	at org.metaborg.spoofax.core.syntax.JSGLRParseErrorHandler.processFatalException(JSGLRParseErrorHandler.java:148) ~[org.metaborg.spoofax.core_2.4.0.20171026-103626-master.jar:na]
	at org.metaborg.spoofax.core.syntax.JSGLRParseErrorHandler.reportSkippedRegion(JSGLRParseErrorHandler.java:107) ~[org.metaborg.spoofax.core_2.4.0.20171026-103626-master.jar:na]
	at org.metaborg.spoofax.core.syntax.JSGLRParseErrorHandler.gatherNonFatalErrors(JSGLRParseErrorHandler.java:72) ~[org.metaborg.spoofax.core_2.4.0.20171026-103626-master.jar:na]
	at org.metaborg.spoofax.core.syntax.JSGLR1I.parse(JSGLR1I.java:78) ~[org.metaborg.spoofax.core_2.4.0.20171026-103626-master.jar:na]
	at org.metaborg.spoofax.core.syntax.JSGLRParseService.parse(JSGLRParseService.java:114) ~[org.metaborg.spoofax.core_2.4.0.20171026-103626-master.jar:na]
	at org.metaborg.spoofax.core.syntax.JSGLRParseService.parse(JSGLRParseService.java:1) ~[org.metaborg.spoofax.core_2.4.0.20171026-103626-master.jar:na]
	at org.metaborg.core.syntax.SyntaxService.parse(SyntaxService.java:38) ~[org.metaborg.core_2.4.0.20171026-103626-master.jar:na]
	at org.metaborg.spoofax.eclipse.editor.EditorUpdateJob.parse(EditorUpdateJob.java:307) ~[org.metaborg.spoofax.eclipse_2.4.0.20171026-103626-master.jar:na]
	at org.metaborg.spoofax.eclipse.editor.EditorUpdateJob.update(EditorUpdateJob.java:222) ~[org.metaborg.spoofax.eclipse_2.4.0.20171026-103626-master.jar:na]
	at org.metaborg.spoofax.eclipse.editor.EditorUpdateJob.run(EditorUpdateJob.java:144) ~[org.metaborg.spoofax.eclipse_2.4.0.20171026-103626-master.jar:na]
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56) [org.eclipse.core.jobs_3.9.1.v20170714-0547.jar:na]

Log in to post comments