diff options
author | Markus Heidelberg <markus.heidelberg@web.de> | 2015-01-11 09:04:00 +1100 |
---|---|---|
committer | Markus Heidelberg <markus.heidelberg@web.de> | 2015-01-11 09:04:00 +1100 |
commit | 683c68c04540c42b0b22de78da9c046b98ad50e2 (patch) | |
tree | 8d7daf95b255579c050ee42fa7fe0e9a28eaa485 /lexers/LexHex.cxx | |
parent | 52156dcd3465f5db9734b0e8ca8d726eae60c9f2 (diff) | |
download | scintilla-mirror-683c68c04540c42b0b22de78da9c046b98ad50e2.tar.gz |
LexHex: add a new state for garbage data after the record
IHex and Srec just set to the DEFAULT state before, TEHex used the
SCE_HEX_DATA_UNKNOWN state for garbage data, which is not the actual intention
for this state.
Diffstat (limited to 'lexers/LexHex.cxx')
-rw-r--r-- | lexers/LexHex.cxx | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/lexers/LexHex.cxx b/lexers/LexHex.cxx index 935b026d2..c0ffa0cbe 100644 --- a/lexers/LexHex.cxx +++ b/lexers/LexHex.cxx @@ -95,6 +95,9 @@ * * - States in parentheses in the upper format descriptions indicate that they * should not appear in a valid hex file. + * + * - State SCE_HEX_GARBAGE means garbage data after the intended end of the + * record, the line is too long then. This state is used in all lexers. */ #include <stdlib.h> @@ -692,8 +695,9 @@ static void ColouriseSrecDoc(unsigned int startPos, int length, int initStyle, W case SCE_HEX_CHECKSUM: case SCE_HEX_CHECKSUM_WRONG: - // record finished - sc.SetState(SCE_HEX_DEFAULT); + case SCE_HEX_GARBAGE: + // record finished or line too long + sc.SetState(SCE_HEX_GARBAGE); ForwardWithinLine(sc); break; } @@ -802,8 +806,9 @@ static void ColouriseIHexDoc(unsigned int startPos, int length, int initStyle, W case SCE_HEX_CHECKSUM: case SCE_HEX_CHECKSUM_WRONG: - // record finished - sc.SetState(SCE_HEX_DEFAULT); + case SCE_HEX_GARBAGE: + // record finished or line too long + sc.SetState(SCE_HEX_GARBAGE); ForwardWithinLine(sc); break; } @@ -946,10 +951,9 @@ static void ColouriseTEHexDoc(unsigned int startPos, int length, int initStyle, case SCE_HEX_DATA_ODD: case SCE_HEX_DATA_EVEN: - case SCE_HEX_DATA_UNKNOWN: - - // line too long - sc.SetState(SCE_HEX_DATA_UNKNOWN); + case SCE_HEX_GARBAGE: + // record finished or line too long + sc.SetState(SCE_HEX_GARBAGE); ForwardWithinLine(sc); break; } |