aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexHex.cxx
diff options
context:
space:
mode:
authorMarkus Heidelberg <markus.heidelberg@web.de>2015-01-11 09:04:00 +1100
committerMarkus Heidelberg <markus.heidelberg@web.de>2015-01-11 09:04:00 +1100
commit6b703450e0115cf796c393103d427ad846549826 (patch)
tree4256087fc1d41ea5c54f4fbd0f90987e24306c37 /lexers/LexHex.cxx
parentc1a5024e918549125607067b940c923c23370ffd (diff)
downloadscintilla-mirror-6b703450e0115cf796c393103d427ad846549826.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.cxx20
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;
}