diff options
author | Markus Heidelberg <markus.heidelberg@web.de> | 2015-01-11 09:01:01 +1100 |
---|---|---|
committer | Markus Heidelberg <markus.heidelberg@web.de> | 2015-01-11 09:01:01 +1100 |
commit | 90a95a24c2ad2ba32eba0e4c0548256eda1d22df (patch) | |
tree | 90b64ae4404bade6208e48fa31219ee65c91a962 | |
parent | e247100177263800514397b3053b624706e6e14e (diff) | |
download | scintilla-mirror-90a95a24c2ad2ba32eba0e4c0548256eda1d22df.tar.gz |
LexHex: rename Tektronix extended HEX lexer from "thex" to "tehex"
There exists a similar file format called "Textronix HEX", which would
be the better candidate for this short name.
-rw-r--r-- | include/SciLexer.h | 2 | ||||
-rw-r--r-- | include/Scintilla.iface | 6 | ||||
-rw-r--r-- | lexers/LexHex.cxx | 28 | ||||
-rw-r--r-- | src/Catalogue.cxx | 2 |
4 files changed, 19 insertions, 19 deletions
diff --git a/include/SciLexer.h b/include/SciLexer.h index acbe6ab8d..7c63a9de2 100644 --- a/include/SciLexer.h +++ b/include/SciLexer.h @@ -131,7 +131,7 @@ #define SCLEX_BIBTEX 116 #define SCLEX_SREC 117 #define SCLEX_IHEX 118 -#define SCLEX_THEX 119 +#define SCLEX_TEHEX 119 #define SCLEX_AUTOMATIC 1000 #define SCE_P_DEFAULT 0 #define SCE_P_COMMENTLINE 1 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index a51c2a31e..9c802cd3d 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -2721,7 +2721,7 @@ val SCLEX_REGISTRY=115 val SCLEX_BIBTEX=116 val SCLEX_SREC=117 val SCLEX_IHEX=118 -val SCLEX_THEX=119 +val SCLEX_TEHEX=119 # When a lexer specifies its language as SCLEX_AUTOMATIC it receives a # value assigned in sequence from SCLEX_AUTOMATIC+1. @@ -4572,8 +4572,8 @@ val SCE_HEX_CHECKSUM_WRONG=16 val SCE_HEX_RECTYPE_UNKNOWN=17 # Lexical state for SCLEX_IHEX (shared with Srec) lex IHex=SCLEX_IHEX SCE_HEX_ -# Lexical state for SCLEX_THEX (shared with Srec) -lex THex=SCLEX_THEX SCE_HEX_ +# Lexical state for SCLEX_TEHEX (shared with Srec) +lex TEHex=SCLEX_TEHEX SCE_HEX_ # Events diff --git a/lexers/LexHex.cxx b/lexers/LexHex.cxx index 5aa41dd8a..ec715a44e 100644 --- a/lexers/LexHex.cxx +++ b/lexers/LexHex.cxx @@ -142,10 +142,10 @@ static int GetIHexRequiredDataFieldSize(unsigned int recStartPos, Accessor &styl static int GetIHexChecksum(unsigned int recStartPos, Accessor &styler); static int CalcIHexChecksum(unsigned int recStartPos, Accessor &styler); -static int GetTHexDigitCount(unsigned int recStartPos, Accessor &styler); -static int CountTHexDigitCount(unsigned int recStartPos, Accessor &styler); -static int GetTHexChecksum(unsigned int recStartPos, Accessor &styler); -static int CalcTHexChecksum(unsigned int recStartPos, Accessor &styler); +static int GetTEHexDigitCount(unsigned int recStartPos, Accessor &styler); +static int CountTEHexDigitCount(unsigned int recStartPos, Accessor &styler); +static int GetTEHexChecksum(unsigned int recStartPos, Accessor &styler); +static int CalcTEHexChecksum(unsigned int recStartPos, Accessor &styler); static inline bool IsNewline(const int ch) { @@ -501,7 +501,7 @@ static int CalcIHexChecksum(unsigned int recStartPos, Accessor &styler) // Get the value of the "record length" field, it counts the number of digits in // the record excluding the percent. -static int GetTHexDigitCount(unsigned int recStartPos, Accessor &styler) +static int GetTEHexDigitCount(unsigned int recStartPos, Accessor &styler) { int val = GetHexaChar(recStartPos + 1, styler); if (val < 0) @@ -511,7 +511,7 @@ static int GetTHexDigitCount(unsigned int recStartPos, Accessor &styler) } // Count the number of digits in this record. Has to // be equal to the "record length" field value. -static int CountTHexDigitCount(unsigned int recStartPos, Accessor &styler) +static int CountTEHexDigitCount(unsigned int recStartPos, Accessor &styler) { unsigned int pos; @@ -524,7 +524,7 @@ static int CountTHexDigitCount(unsigned int recStartPos, Accessor &styler) return static_cast<int>(pos - (recStartPos+1)); } // Get the value of the "checksum" field. -static int GetTHexChecksum(unsigned int recStartPos, Accessor &styler) +static int GetTEHexChecksum(unsigned int recStartPos, Accessor &styler) { return GetHexaChar(recStartPos+4, styler); } @@ -546,7 +546,7 @@ static int GetHexaNibble(char hd) return hexValue; } // Calculate the checksum of the record (excluding the checksum field). -static int CalcTHexChecksum(unsigned int recStartPos, Accessor &styler) +static int CalcTEHexChecksum(unsigned int recStartPos, Accessor &styler) { unsigned int pos = recStartPos +1; unsigned int length = GetHexaChar(pos, styler); @@ -830,7 +830,7 @@ static void FoldIHexDoc(unsigned int startPos, int length, int, WordList *[], Ac } } -static void ColouriseTHexDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) +static void ColouriseTEHexDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { StyleContext sc(startPos, length, initStyle, styler); @@ -851,7 +851,7 @@ static void ColouriseTHexDoc(unsigned int startPos, int length, int initStyle, W recStartPos = sc.currentPos - 1; - if (GetTHexDigitCount(recStartPos, styler) == CountTHexDigitCount(recStartPos, styler)) { + if (GetTEHexDigitCount(recStartPos, styler) == CountTEHexDigitCount(recStartPos, styler)) { sc.SetState(SCE_HEX_BYTECOUNT); } else { sc.SetState(SCE_HEX_BYTECOUNT_WRONG); @@ -875,8 +875,8 @@ static void ColouriseTHexDoc(unsigned int startPos, int length, int initStyle, W case SCE_HEX_RECTYPE: case SCE_HEX_RECTYPE_UNKNOWN: recStartPos = sc.currentPos - 4; - cs1 = CalcTHexChecksum(recStartPos, styler); - cs2 = GetTHexChecksum(recStartPos, styler); + cs1 = CalcTEHexChecksum(recStartPos, styler); + cs2 = GetTEHexChecksum(recStartPos, styler); if (cs1 != cs2 || cs1 < 0 || cs2 < 0) { sc.SetState(SCE_HEX_CHECKSUM_WRONG); @@ -897,7 +897,7 @@ static void ColouriseTHexDoc(unsigned int startPos, int length, int initStyle, W case SCE_HEX_NOADDRESS: case SCE_HEX_DATAADDRESS: recStartPos = sc.currentPos - 15; - digitCount = GetTHexDigitCount(recStartPos, styler) - 14; + digitCount = GetTEHexDigitCount(recStartPos, styler) - 14; sc.SetState(SCE_HEX_DATA_ODD); @@ -932,4 +932,4 @@ static void ColouriseTHexDoc(unsigned int startPos, int length, int initStyle, W LexerModule lmSrec(SCLEX_SREC, ColouriseSrecDoc, "srec", 0, NULL); LexerModule lmIHex(SCLEX_IHEX, ColouriseIHexDoc, "ihex", FoldIHexDoc, NULL); -LexerModule lmTHex(SCLEX_THEX, ColouriseTHexDoc, "thex", 0, NULL); +LexerModule lmTEHex(SCLEX_TEHEX, ColouriseTEHexDoc, "tehex", 0, NULL); diff --git a/src/Catalogue.cxx b/src/Catalogue.cxx index 079246c90..b02a0108c 100644 --- a/src/Catalogue.cxx +++ b/src/Catalogue.cxx @@ -182,8 +182,8 @@ int Scintilla_LinkLexers() { LINK_LEXER(lmTAL); LINK_LEXER(lmTCL); LINK_LEXER(lmTCMD); + LINK_LEXER(lmTEHex); LINK_LEXER(lmTeX); - LINK_LEXER(lmTHex); LINK_LEXER(lmTxt2tags); LINK_LEXER(lmVB); LINK_LEXER(lmVBScript); |