Hi!<br><br>The parser function in my library is exposed to user which hides internally preprocessing &amp; parsing. <br>When parser error ocurr the coordinates are in preprocessed text, but library function user deserves to know coordinates in original text.<br>
<br>Following is my application flow (simplified):<br><br>{- User exposed library function -}<br>parseLDIF :: String -&gt; Either ParseError LDIF<br>parseLDIF xs = myParser $ myPreprocessor xs<br><br>{- Expects the preprocessed input -}<br>
myParser :: String -&gt; Either ParseError LDIF<br><br>{- Remove comments and unwarp lines; No new text added only removed -}<br>myPreprocessor :: String -&gt; String<br><br>My approach I&#39;m going to implement is to keep information what myProcessor did on text (some kind of journal of preprocessing).<br>
In the case of error this journal will be used for original text coordinates calculation.<br><br>myPreprocessor :: String -&gt; (String,[PreprocessorOperation])<br><br>Anyway, I have feeling that I&#39;m doing something very wrong... reason for this email.<br>
What is the common approach to transform error coordinates from preprocessed to original text ?<br>Is that common to separate preprocessing &amp; parsing phase ?<br><br>Thanks,<br>Rado<br>