Front end for reading the CSV output from %SyntaxColor:Color. Instead of reading the stream directly and reconstructing the lines you can use a %SyntaxColorReader object and call its NextLine method.
To create a %SyntaxColorReader object you can pass a CSV stream to %New; alternatively you can call FromCode and it will call %SyntaxColor for you.
method AtEndGet() as
Create a %SyntaxColorReader over the given CSV stream
method ForgetNotedPosition() as
The AtEnd property can be used to check for the end of the reader over the CSV stream
classmethod FromCode(Code As
Forget the noted position
method GetInfoLine() as
Given a code stream, language, optional extra flags and/or symbols string for %SyntaxColor:Color
Return a %SyntaxColorReader over the resulting CSV and whether there were any coloring errors/warnings (anywhere in the document)
Return the info line, if any Not valid until AtEnd method NextErrorInfo(Output Description As
Return the next error info Not valid until AtEnd method NextLine(ByRef LineCSV As
method NotePosition() as
Return a structured list of coloring information about the current line of code represented by the CSV stream, advancing the stream. In general, a number of lines will be read from the CSV stream to make up one logical line corresponding to a line of the original code. CSV lines of the form "\n" determine logical line boundaries.
If the stream is at its end this method returns 0, otherwise 1.
If 1 is returned the ByRef parameters are set up from the stream items which were read :-
- LineCSV is set to a list of items, where each item is $LB(lang,terminal,code)
- ColoringErrors and ColoringWarnings are set to whether there were any coloring errors/warnings at all on the line
method RestoreNotedPosition() as
Note the current stream position, caller must call RestorePosition or ForgetPosition later.
method Rewind() as
Restore the noted position
method SkipLines(N As
Move back to the beginning of the stream
- not allowed if the position is noted
Move forward N lines - stops if end of file found first (doesn't report any error)