This file format contains binary data in text form, often used in embedded development. Since there is no formatting, it is hard to read without syntax highlighting. Attached are patches for Scintilla and SciTE and an example file, where the first section is valid and the second section contains errors (unknown type, wrong byte count, wrong checksum).
I plan to add a lexer for a similar file format called "Intel HEX" and thought of doing it in the same .cxx file to share some helper functions. Are the filenames (LexSrec srec.properties) ok in this case or should they be changed to something general?
Patch for Scintilla
Patch for SciTE
Basing the names on 'Hex' may help users unfamiliar with the area like me. If 'Srec' or similar is more familiar to practitioners in the field then they probably should get priority.
There is one warning: in ColouriseSrecDoc, the WordList *[] argument is not used so the name (keywordLists) should be omitted.
I'm not sure about the best word for a general name for this type of files, probably 'Hex' is quite good, so I have renamed the files accordingly and removed the variable name of the unused argument.
At the company most of my colleagues say 'hex file' for Intel Hex and 'mot file' for Motorola S-Record, derived from the file extension. We don't have a general name for this, but that doesn't mean anything.
Last edit: Markus Heidelberg 2014-12-08
Committed as [4f3805] and [07645f].
Related
Commit: [07645f]
Commit: [4f3805]
Extended for using state SCE_HEX_RECTYPE_UNKNOWN in Motorola S-Record and Intel HEX lexers. I hope it is OK to reuse an existing ticket, but I didn't want to split the Intel HEX adaption into a separate patch, so this part is a bit unrelated to the original feature request.
Another extension for S-Record: smarter highlighting considering the required data field size for specific records.
Is this feature stable? If not then it should be pulled out until it is.
Yes, it is stable. These are no error fixes, but minor enhancements which I didn't consider from the beginning.
SCE_HEX_RECTYPE_UNKNOWN has been introduced for Tektronix extended HEX by user danselmi and has now been adopted for S-Record and Intel HEX.
Committed as [fc431c], [9c8e1c], [bd582e], and [7b03dc].
Please use separate issues for future changes.
Related
Commit: [7b03dc]
Commit: [bd582e]
Commit: [9c8e1c]
Commit: [fc431c]