### Eclipse Workspace Patch 1.0
#P ed.inf.proofgeneral
RCS file: /disk/cvs/proofgen/eclipse/ed.inf.proofgeneral/src/ed/inf/proofgeneral/editor/lazyparser/Parser.java,v
retrieving revision 1.123
diff -u -r1.123 Parser.java
|
|
|
130 | 130 | String parseText = ""; |
131 | 131 | int results = 0; |
132 | 132 | int linestoAdd = 0; |
133 | | int endOffset; |
| 133 | int nextOffset; |
134 | 134 | try { |
135 | 135 | int endLine = doc.getLineOfOffset(startOffset+length-1); |
136 | 136 | do { |
137 | | endOffset = doc.getLineLength(endLine) + doc.getLineOffset(endLine) - 1; |
138 | | parseText = doc.getDesymbolised(startOffset, endOffset-startOffset); |
| 137 | nextOffset = doc.getLineLength(endLine) + doc.getLineOffset(endLine); |
| 138 | parseText = doc.getDesymbolised(startOffset, nextOffset-startOffset); |
139 | 139 | parseResult = parseText(parseText, doc, startOffset,monitor); |
140 | 140 | results = parseResultContentSize(parseResult); |
141 | 141 | |
… |
… |
|
150 | 150 | endLine = doc.getNumberOfLines() - 1; |
151 | 151 | } |
152 | 152 | } |
153 | | } while (results <= 1 && endOffset + 1 < doc.getLength()); |
| 153 | } while (results <= 1 && nextOffset < doc.getLength()); |
154 | 154 | } catch (BadLocationException badloc) { |
155 | 155 | // Shouldn't happen unless client called us incorrectly |
156 | 156 | throw new ParsingException("Bad location during parsing"); |
… |
… |
|
161 | 161 | try { |
162 | 162 | // TODO: perhaps this should be in a workspace runnable, to ensure |
163 | 163 | // thread safe access to document |
164 | | ProofScriptMarkers.cleanMarkers(doc,startOffset,endOffset-startOffset); // NB: removes all types of marker |
| 164 | ProofScriptMarkers.cleanMarkers(doc,startOffset,nextOffset-startOffset); // NB: removes all types of marker |
165 | 165 | linkParseresult(parseResult,doc,startOffset); |
166 | 166 | doc.recalculateFoldingStructure(); |
167 | 167 | } catch (UnparseableException x) { |