Opened 16 years ago

Last modified 11 years ago

#259 closed defect

Parsing Failure at ends of files — at Version 5

Reported by: Graham Dutton Owned by: Graham Dutton
Priority: major Milestone:
Component: 1:pg-eclipse Keywords:
Cc:

Description (last modified by Graham Dutton)

Parsing a file with no trailing whitespace fails.

For example: TestLcl.thy in test repository fails at the final lines. PG parses the final two lines:

 end
end

as a single unit:

 end[newline]en

(where [newline] is an actual newline), discarding the final character.

A functionally identical file TestLocale.thy with trailing whitespace will not exhibit this behaviour.

Change History (6)

comment:1 Changed 16 years ago by Graham Dutton

This of course results in broken prover interaction:

PGIP:

<pgip tag="PG-Eclipse" class="pa" id="/grape//6129632130384117" seq="107"><closetheory>end
en</closetheory></pgip>

Response:

Outer syntax error: command expected,
but identifier en was found

comment:2 Changed 16 years ago by Graham Dutton

Description: modified (diff)
Owner: changed from David Aspinall to Graham Dutton
Status: newassigned

Actually appears to be an out-by-one error: can recreate on any thy file by trimming all trailing whitespace.

Changed 16 years ago by Graham Dutton

a partial solution: the line in question

comment:3 Changed 16 years ago by Graham Dutton

this fixes the bug but creates another.

comment:4 Changed 16 years ago by Graham Dutton

Description: modified (diff)
Summary: Parsing Failure on TestLcl.thyParsing Failure at ends of files

comment:5 Changed 16 years ago by Graham Dutton

Description: modified (diff)

After much investigation, I'm now convinced that attached fix is the right thing, but it results in Processed region being set to '0' when the last line of the document is parsed. Investigating.

Note: See TracTickets for help on using tickets.