Opened 16 years ago
Last modified 11 years ago
#259 closed defect
Parsing Failure at ends of files — at Version 7
Reported by: | Graham Dutton | Owned by: | Graham Dutton |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | 1:pg-eclipse | Keywords: | |
Cc: |
Description (last modified by )
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 (9)
comment:1 Changed 16 years ago by
comment:2 Changed 16 years ago by
Description: | modified (diff) |
---|---|
Owner: | changed from David Aspinall to Graham Dutton |
Status: | new → assigned |
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
Attachment: | parser-parsetext-outbyone.patch added |
---|
a partial solution: the line in question
comment:4 Changed 16 years ago by
Description: | modified (diff) |
---|---|
Summary: | Parsing Failure on TestLcl.thy → Parsing Failure at ends of files |
comment:5 Changed 16 years ago by
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.
comment:6 Changed 15 years ago by
Milestone: | → PG-Eclipse-1.0.6 |
---|
Sounds like a separate problem since files without final CR were not being parsed before.
My diff corrects the termination check at the end of the loop (notice that real error was in calculation of length=endOffset-startOffset, which should be endOffset-startOffset+1).
Changed 15 years ago by
Attachment: | parser.patch added |
---|
comment:7 Changed 15 years ago by
Description: | modified (diff) |
---|
Yes, that is much more complete fix, and means that the fix I was working on for the subsequent issue now actually works... Commit on its way.
This of course results in broken prover interaction:
PGIP:
Response: