diff --git a/spin2/CHANGELOG.md b/spin2/CHANGELOG.md index 635f20b..9b758fe 100644 --- a/spin2/CHANGELOG.md +++ b/spin2/CHANGELOG.md @@ -16,6 +16,46 @@ Possible next additions: - Add new-file templates as Snippets - Add additional Snippets as the community identifies them +## [1.0.0] 2021-03-18 + +The Official Release of Semantic Highlighting + +In this release we clean things up a bit more, we deliver unknown name hightlighted in brighter red, and **herein** we report on the state of testing against various code-sets. + +**NOTE:** _with this new **unknown names** coloring feature we were able to find two files that shouldn't compile due to undefined symbols but actually do compile. The findings are being reported to Chip. The author of the files confirmed that the two files are missing symbols._ + +Semantic Adjustments: + +- NEW FEATURE! **Unknown names** in the file are now hightlighted with noticable bright red +- BUGFIX: pasm - repaired variable/label hightlight when short names +- BUGFIX: by default the compiler treats the first lines in file as being in CON, this highlighter does now as well. +- BUGFIX: recognize round(), float(), and trunc() in DAT, CON and PUB/PRI +- BUGFIX: built-in constants should now be colored correctly + +Syntax Adjustments: + +- BUGFIX: adjusted built-in symbol recognition, now independent of case +- BUGFIX: added missing, newly added to PNut, `DEBUG_*` variables + +### - Known Issues w/v1.0.0 + +- debug() statements that don't use double-quoted strings currently can't be parsed +- Syntax highlight of DAT section sometimes fails... RES and FIT not colored correctly +- Semantic highlight: the 'modification' attribute is being over-applied, should use more than := as test!!!! +- *I'm sure there are more issues...* + +### REPORT: Source code shipped with PNut + +- **LIMITATIONs**: all highlighting is working with the exception of: + - FILE `Spin2_interpreter.spin2` - breaks the syntax highlighter, but the sematic highlighter works. + - (meaning pasm instruction names, built-in names, conditions, etc. are not highlighted) + - All files with debug() statements that don't use double-quoted strings can't be parsed correctly + +### REPORT: Source code shipped in P2 OBEX + +- For all P2 Obex files, highlighting is working with the exception of: + - FILE `Parktransformation.spin2` I'm checking the Chip as to why this is. + ## [0.3.4] 2021-03-17 5th Release of Semantic Highlighting @@ -38,6 +78,7 @@ Syntax Adjustments: ### - Known Issues w/v0.3.4 +- debug() statements that don't use double-quoted strings just can't be parsed - Pasm: doesn't recognize round(), float(), and trunc() as pasm operand - Incorrectly colors **built-in** constants (should be own color) - Syntax highlight of DAT section sometimes fails... RES and FIT not colored correctly @@ -45,7 +86,6 @@ Syntax Adjustments: - Semantic highlight: the 'modification' attribute should use more than := as test!!!! - *I'm sure there are more issues...* - ## [0.3.3] 2021-03-16 4th Release of Semantic Highlighting @@ -87,6 +127,7 @@ Syntax Adjustments: - BUGFIX adjusted pub/pri to allow space before open paren ### - Known Issues w/v0.3.3 + - Pasm: doesn't recognize round(), float(), and trunc() as pasm operand - Spin: Badly handles strings (should be ignoring contents of them) - Incorrectly colors **built-in** constants (should be own color) @@ -97,6 +138,7 @@ Syntax Adjustments: - *I'm sure there are more issues...* ## [0.3.2] 2021-03-12 + 3rd Release of Semantic Highlighting This represents an overall improvement in parsing when there is less whitespace between things @@ -128,8 +170,8 @@ Syntax Fixes: - Semantic highlight: the 'modification' attribute should use more than := as test!!!! - *I'm sure there are more issues...* - ## [0.3.1] 2021-03-09 + 2nd Release of Semantic Highlighting ### - What's new @@ -173,6 +215,7 @@ Syntax Fixes: ## [0.3.0] 2021-03-07 + Preview Release of Semantic Highlighting - Spin2: Initial Semantic Highlighting support (partial: Spin only, no Pasm) diff --git a/spin2/TEST/jm_test.spin2 b/spin2/TEST/jm_test.spin2 index 9d27a2e..da14c69 100644 --- a/spin2/TEST/jm_test.spin2 +++ b/spin2/TEST/jm_test.spin2 @@ -1,3 +1,7 @@ +con + +SBUS_RX = 1 + obj sbus : "sbus.spin2" diff --git a/spin2/TEST/test-file-003.spin2 b/spin2/TEST/test-file-003.spin2 index 02080a5..49855f8 100644 --- a/spin2/TEST/test-file-003.spin2 +++ b/spin2/TEST/test-file-003.spin2 @@ -32,15 +32,15 @@ DAT _xinfreq _xtlfreq - + ' alignment ALIGNL ALIGNW BYTE - WORD - LONG - + WORD + LONG + BYTE name[23] ' assembly start @@ -155,7 +155,7 @@ DAT DRVRND DRVZ ENCOD - EXECF   + EXECF FBLOCK FGE FGES @@ -177,8 +177,8 @@ DAT GETPTR GETQX GETQY - GETRND   - GETRND           + GETRND + GETRND GETSCP GETWORD GETWORD @@ -369,7 +369,7 @@ DAT SHR SIGNX SKIP - SKIPF   + SKIPF SPLITB SPLITW STALLI @@ -440,61 +440,63 @@ DAT ' flag write controls WC | WZ | WCZ XORC | XORZ - ORC | ORZ - ANDC | ANDZ + ORC | ORZ + ANDC | ANDZ ' instruction conditionals - _RET_         - IF_NC_AND_NZ  - IF_NZ_AND_NC  - IF_A          - IF_00 - IF_NC_AND_Z   - IF_Z_AND_NC   - IF_01         - IF_NC         - IF_AE         - IF_0X         - IF_C_AND_NZ   - IF_NZ_AND_C   - IF_10         - IF_NZ         - IF_NE         - IF_X0         - IF_C_NE_Z     - IF_Z_NE_C     - IF_DIFF       - IF_NC_OR_NZ   - IF_NZ_OR_NC   - IF_NOT_11     - IF_C_AND_Z    - IF_Z_AND_C    - IF_11         - IF_C_EQ_Z     - IF_Z_EQ_C     - IF_SAME       - IF_Z          - IF_E          - IF_X1         - IF_NC_OR_Z    - IF_Z_OR_NC    - IF_NOT_10     - IF_C          - IF_B          - IF_1X         - IF_C_OR_NZ    - IF_NZ_OR_C    - IF_NOT_01     - IF_C_OR_Z     - IF_Z_OR_C     - IF_BE         - IF_NOT_00     + _RET_         + IF_NC_AND_NZ  + IF_NZ_AND_NC  + IF_A          + IF_00 + IF_NC_AND_Z   + IF_Z_AND_NC   + IF_01         + IF_NC         + IF_AE         + IF_0X         + IF_C_AND_NZ   + IF_NZ_AND_C   + IF_10         + IF_NZ         + IF_NE         + IF_X0         + IF_C_NE_Z     + IF_Z_NE_C     + IF_DIFF       + IF_NC_OR_NZ   + IF_NZ_OR_NC   + IF_NOT_11     + IF_C_AND_Z    + IF_Z_AND_C    + IF_11         + IF_C_EQ_Z     + IF_Z_EQ_C     + IF_SAME       + IF_Z          + IF_E          + IF_X1         + IF_NC_OR_Z    + IF_Z_OR_NC    + IF_NOT_10     + IF_C          + IF_B          + IF_1X         + IF_C_OR_NZ    + IF_NZ_OR_C    + IF_NOT_01     + IF_C_OR_Z     + IF_Z_OR_C     + IF_BE         + IF_NOT_00     FIT DAT { instructions by group } ORG + ORGH + ORGF CALL ' Branch CALL ' Branch CALLA ' Branch @@ -532,7 +534,7 @@ DAT { instructions by group } SKIP    ' Branch SKIPF   ' Branch - + TJF ' Branch TJNF ' Branch TJNS ' Branch @@ -1001,7 +1003,7 @@ DAT { instructions by group } P_TT_10 P_TT_11 P_USB_PAIR - + ' symbols that are used to setup streamers X_16P_2DAC8_WFWORD X_16P_4DAC4_WFWORD @@ -1112,4 +1114,4 @@ CON { license } OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================================================================= -}} \ No newline at end of file +}} diff --git a/spin2/TEST/test-file-004.spin2 b/spin2/TEST/test-file-004.spin2 index 5997a5a..80743f0 100644 --- a/spin2/TEST/test-file-004.spin2 +++ b/spin2/TEST/test-file-004.spin2 @@ -194,7 +194,81 @@ PUB allnamedOperators() ROUND TRUNC - +PUB allDebugMethods() + ' conditionals + IF + IFNOT + ' String Output * + ZSTR + LSTR + ' Unsigned Decimal + UDEC + UDEC_BYTE + UDEC_WORD + UDEC_LONG + UDEC_REG_ARRAY + UDEC_BYTE_ARRAY + UDEC_WORD_ARRAY + UDEC_LONG_ARRAY + ' Signed Decimal + SDEC + SDEC_BYTE + SDEC_WORD + SDEC_LONG + SDEC_REG_ARRAY + SDEC_BYTE_ARRAY + SDEC_WORD_ARRAY + SDEC_LONG_ARRAY + ' Hexadecimal Output, unsigned * + UHEX + UHEX_BYTE + UHEX_WORD + UHEX_LONG + UHEX_REG_ARRAY + UHEX_BYTE_ARRAY + UHEX_WORD_ARRAY + UHEX_LONG_ARRAY + ' Hexadecimal Output, signed * + SHEX + SHEX_BYTE + SHEX_WORD + SHEX_LONG + SHEX_REG_ARRAY + SHEX_BYTE_ARRAY + SHEX_WORD_ARRAY + SHEX_LONG_ARRAY + ' Binary Output, unsigned * + UBIN + UBIN_BYTE + UBIN_WORD + UBIN_LONG + UBIN_REG_ARRAY + UBIN_BYTE_ARRAY + UBIN_WORD_ARRAY + UBIN_LONG_ARRAY + ' Binary Output, signed * + SBIN + SBIN_BYTE + SBIN_WORD + SBIN_LONG + SBIN_REG_ARRAY + SBIN_BYTE_ARRAY + SBIN_WORD_ARRAY + SBIN_LONG_ARRAY + ' DEBUG constants + DEBUG_COGS + DEBUG_DELAY + DEBUG_PIN + DEBUG_BAUD + DEBUG_TIMESTAMP + DEBUG_LOG_SIZE + DEBUG_LEFT + DEBUG_TOP + DEBUG_WIDTH + DEBUG_HEIGHT + DEBUG_DISPLAY_LEFT + DEBUG_DISPLAY_TOP + DEBUG_WINDOWS_OFF PUB allFlowControl() ABORT @@ -214,6 +288,7 @@ PUB allFlowControl() TO UNTIL WHILE + RETURN PUB allSmartPinAliases() diff --git a/spin2/package.json b/spin2/package.json index f519d57..70e668d 100644 --- a/spin2/package.json +++ b/spin2/package.json @@ -3,7 +3,7 @@ "displayName": "Spin2", "description": "Spin2/Pasm2 Syntax/Semantic Highlighting w/Code Outline support", "icon": "images/Propeller.ico", - "version": "0.3.4", + "version": "1.0.0", "publisher": "IronSheepProductionsLLC", "repository": { "type": "git", diff --git a/spin2/src/spin2.extension.ts b/spin2/src/spin2.extension.ts index 78f9144..8d8d29c 100644 --- a/spin2/src/spin2.extension.ts +++ b/spin2/src/spin2.extension.ts @@ -218,7 +218,7 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke private _parseText(text: string): IParsedToken[] { // parse our entire file const lines = text.split(/\r\n|\r|\n/); - let currState: eParseState = eParseState.Unknown; + let currState: eParseState = eParseState.inCon; // compiler defaults to CON at start let priorState: eParseState = currState let prePasmState: eParseState = currState @@ -242,14 +242,14 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke for (let i = 0; i < lines.length; i++) { const line = lines[i]; const trimmedLine = line.trim(); - const trimmedNonCOmmentLine = this._getNonCommentLineRemainder(0, line); + const trimmedNonCommentLine = this._getNonCommentLineRemainder(0, line); const sectionStatus = this._isSectionStartLine(line); if (currState == eParseState.inMultiLineComment) { // in multi-line non-doc-comment, hunt for end '}' to exit let closingOffset = line.indexOf('}'); if (closingOffset != -1) { // have close, comment ended - currState = eParseState.inNothing; + currState = priorState; } // DO NOTHING Let Syntax hightlighting do this continue; @@ -259,7 +259,7 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke let closingOffset = line.indexOf('}}'); if (closingOffset != -1) { // have close, comment ended - currState = eParseState.inNothing; + currState = priorState; } // DO NOTHING Let Syntax hightlighting do this continue; @@ -270,39 +270,41 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke // ID the remainder of the line if (currState == eParseState.inPub || currState == eParseState.inPri) { // process method signature - if (trimmedNonCOmmentLine.length > 3) { + if (trimmedNonCommentLine.length > 3) { this._getPUB_PRI_Name(3, line) } } else if (currState == eParseState.inCon) { // process a constant line - if (trimmedNonCOmmentLine.length > 3) { + if (trimmedNonCommentLine.length > 3) { this._getCON_Declaration(3, line) } } else if (currState == eParseState.inDat) { // process a data line - //this._logPASM('- ('+ i + 1 +'): pre-scan DAT line trimmedLine=[' + trimmedLine + ']'); - if (trimmedNonCOmmentLine.length > 6) { - if (trimmedLine.toUpperCase().includes("ORG")) { // ORG, ORGF, ORGH - this._logPASM('- (' + i + 1 + '): pre-scan DAT line trimmedLine=[' + trimmedLine + '] now Dat PASM'); - prePasmState = currState; - currState = eParseState.inDatPasm; - // and ignore rest of this line - continue; + if (trimmedNonCommentLine.length > 6) { + if (trimmedNonCommentLine.toUpperCase().includes("ORG")) { // ORG, ORGF, ORGH + const nonStringLine: string = this._removeQuotedStrings(trimmedNonCommentLine); + if (nonStringLine.toUpperCase().includes("ORG")) { + this._logPASM('- (' + i + 1 + '): pre-scan DAT line trimmedLine=[' + trimmedLine + '] now Dat PASM'); + prePasmState = currState; + currState = eParseState.inDatPasm; + // and ignore rest of this line + continue; + } } } this._getDAT_Declaration(0, line) } else if (currState == eParseState.inObj) { // process a constant line - if (trimmedNonCOmmentLine.length > 3) { + if (trimmedNonCommentLine.length > 3) { this._getOBJ_Declaration(3, line) } } else if (currState == eParseState.inVar) { // process a constant line - if (trimmedNonCOmmentLine.length > 3) { + if (trimmedNonCommentLine.length > 3) { this._getVAR_Declaration(3, line) } } @@ -356,11 +358,14 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke if (trimmedLine.length > 0) { if (trimmedLine.length > 6) { if (trimmedLine.toUpperCase().includes("ORG")) { // ORG, ORGF, ORGH - this._logPASM('- (' + i + 1 + '): pre-scan DAT line trimmedLine=[' + trimmedLine + '] now Dat PASM'); - prePasmState = currState; - currState = eParseState.inDatPasm; - // and ignore rest of this line - continue; + const nonStringLine: string = this._removeQuotedStrings(trimmedLine); + if (nonStringLine.toUpperCase().includes("ORG")) { + this._logPASM('- (' + i + 1 + '): pre-scan DAT line trimmedLine=[' + trimmedLine + '] now Dat PASM'); + prePasmState = currState; + currState = eParseState.inDatPasm; + // and ignore rest of this line + continue; + } } } this._getDAT_Declaration(0, line) @@ -427,7 +432,7 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke // // Final PASS to identify all name references // - currState = eParseState.Unknown; // reset for 2nd pass + currState = eParseState.inCon; // reset for 2nd pass - compiler defaults to CON at start priorState = currState; // reset for 2nd pass prePasmState = currState; // same @@ -494,7 +499,12 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke if (line.length > 3) { if (trimmedLine.length > 6) { const nonCommentLineRemainder: string = this._getNonCommentLineRemainder(0, trimmedLine); - const orgOffset: number = nonCommentLineRemainder.toUpperCase().indexOf("ORG"); // ORG, ORGF, ORGH + let orgOffset: number = nonCommentLineRemainder.toUpperCase().indexOf("ORG"); // ORG, ORGF, ORGH + if (orgOffset != -1) { + // let's double check this is NOT in quoted string + const nonStringLine: string = this._removeQuotedStrings(nonCommentLineRemainder); + orgOffset = nonStringLine.toUpperCase().indexOf("ORG"); // ORG, ORGF, ORGH + } if (orgOffset != -1) { this._logPASM('- (' + i + 1 + '): scan DAT line nonCommentLineRemainder=[' + nonCommentLineRemainder + ']'); @@ -591,7 +601,12 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke if (trimmedLine.length > 0) { this._logDAT('- process DAT line(' + i + 1 + '): trimmedLine=[' + trimmedLine + ']'); const nonCommentLineRemainder: string = this._getNonCommentLineRemainder(0, trimmedLine); - const orgOffset: number = nonCommentLineRemainder.toUpperCase().indexOf("ORG"); // ORG, ORGF, ORGH + let orgOffset: number = nonCommentLineRemainder.toUpperCase().indexOf("ORG"); // ORG, ORGF, ORGH + if (orgOffset != -1) { + // let's double check this is NOT in quoted string + const nonStringLine: string = this._removeQuotedStrings(nonCommentLineRemainder); + orgOffset = nonStringLine.toUpperCase().indexOf("ORG"); // ORG, ORGF, ORGH + } if (orgOffset != -1) { // process remainder of ORG line const nonCommentOffset = line.indexOf(nonCommentLineRemainder, 0); @@ -1023,7 +1038,7 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke }); } else { - if (!this._isSpinReservedWord(namePart)) { + if (!this._isSpinReservedWord(namePart) && !this._isBuiltinReservedWord(namePart) && !this._iDebugMethod(namePart)) { this._logCON(' -- CON MISSING name=[' + namePart + ']'); tokenSet.push({ line: lineNumber, @@ -1236,7 +1251,7 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke }); } else { - if (!this._isPasmReservedWord(namePart) && !this._isPasmInstruction(namePart) && !this._isDatNFileStorageType(namePart)) { + if (!this._isPasmReservedWord(namePart) && !this._isPasmInstruction(namePart) && !this._isDatNFileStorageType(namePart) && !this._isBuiltinReservedWord(namePart)) { if (showDebug) { this._logMessage(' -- DAT MISSING name=[' + namePart + ']'); } @@ -1281,6 +1296,7 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke // get line parts - we only care about first one const inLinePasmRHSStr = this._getNonCommentLineRemainder(currentOffset, line); const lineParts: string[] = this._getNonWhitePasmLineParts(inLinePasmRHSStr); + currentOffset = line.indexOf(inLinePasmRHSStr, currentOffset); this._logPASM(' -- reportDATPasmDecl lineParts=[' + lineParts + ']'); // handle name in 1 column const isDataDeclarationLine: boolean = (lineParts.length > 1 && (this._isDatStorageType(lineParts[1]) || this._isDatStorageType(lineParts[0]))); @@ -1307,7 +1323,7 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke haveLabel = true; } else { - if (!this._isPasmReservedWord(labelName) && !this._isPasmInstruction(labelName)) { + if (!this._isPasmReservedWord(labelName) && !this._isPasmInstruction(labelName) && !this._isBuiltinReservedWord(labelName)) { // FIXME: UNDONE maybe we shouldn't have this code? // hrmf... no global type???? this should be a lebel const labelType: string = (isDataDeclarationLine) ? 'variable' : 'label'; @@ -1333,15 +1349,17 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke argumentOffset++; minNonLabelParts++; } - if (lineParts[argumentOffset].toUpperCase().startsWith("IF_")) { + if (lineParts[argumentOffset].toUpperCase().startsWith("IF_") || lineParts[argumentOffset].toUpperCase().startsWith("_RET_")) { // skip our conditional argumentOffset++; minNonLabelParts++; } if (lineParts.length > minNonLabelParts) { // have at least instruction name - currentOffset = line.indexOf(lineParts[minNonLabelParts - 1], currentOffset) + lineParts[minNonLabelParts - 1].length + 1; - this._logPASM(' -- DAT PASM setup namePart=[' + lineParts[minNonLabelParts - 1] + '], currentOffset=(' + currentOffset + ')'); + const likelyInstructionName: string = lineParts[minNonLabelParts - 1]; + currentOffset = line.indexOf(likelyInstructionName, currentOffset); + this._logPASM(' -- DAT PASM likelyInstructionName=[' + likelyInstructionName + '], currentOffset=(' + currentOffset + ')'); + currentOffset += likelyInstructionName.length + 1; for (let index = minNonLabelParts; index < lineParts.length; index++) { let argumentName = lineParts[index].replace(/[@#]/, ''); if (argumentName.length < 1) { @@ -1391,7 +1409,7 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke }); } else { - if (!this._isPasmReservedWord(namePart) && !this._isPasmInstruction(namePart)) { + if (!this._isPasmReservedWord(namePart) && !this._isPasmInstruction(namePart) && !this._isBuiltinReservedWord(namePart)) { this._logPASM(' -- DAT Pasm MISSING name=[' + namePart + '](' + nameOffset + 1 + ')'); tokenSet.push({ line: lineNumber, @@ -1418,7 +1436,7 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke }); } } - currentOffset = nameOffset + currArgumentLen + 1; + currentOffset += currArgumentLen + 1; } } } @@ -1592,11 +1610,50 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke // have name similar to scratch[12]? if (localName.includes('[')) { // yes remove array suffix - let localNameParts: string[] = localName.split('['); + const lineInfo: IFilteredStrings = this._getNonWhiteSpinLineParts(localName); + let localNameParts: string[] = lineInfo.lineParts localName = localNameParts[0]; + for (let index = 1; index < localNameParts.length; index++) { + const namedIndexPart = localNameParts[index]; + const nameOffset = line.indexOf(namedIndexPart, currentOffset); + if (namedIndexPart.substr(0, 1).match(/[a-zA-Z_]/)) { + let referenceDetails: IRememberedToken | undefined = undefined; + if (this._isLocalToken(namedIndexPart)) { + referenceDetails = this._getLocalToken(namedIndexPart); + this._logSPIN(' -- FOUND local name=[' + namedIndexPart + ']'); + } + else if (this._isGlobalToken(namedIndexPart)) { + referenceDetails = this._getGlobalToken(namedIndexPart); + this._logSPIN(' -- FOUND global name=[' + namedIndexPart + ']'); + } + if (referenceDetails != undefined) { + this._logSPIN(' -- lcl-idx variableName=[' + namedIndexPart + '](' + nameOffset + 1 + ')'); + tokenSet.push({ + line: lineNumber, + startCharacter: nameOffset, + length: namedIndexPart.length, + tokenType: referenceDetails.tokenType, + tokenModifiers: referenceDetails.tokenModifiers + }); + } + else { + if (!this._isSpinReservedWord(namedIndexPart) && !this._isBuiltinReservedWord(namedIndexPart) && !this._iDebugMethod(namedIndexPart)) { + // we don't have name registered so just mark it + this._logSPIN(' -- SPIN MISSING varname=[' + namedIndexPart + '](' + nameOffset + 1 + ')'); + tokenSet.push({ + line: lineNumber, + startCharacter: nameOffset, + length: namedIndexPart.length, + tokenType: 'variable', + tokenModifiers: ['missingDeclaration'] + }); + } + } + } + } } const nameOffset = line.indexOf(localName, localVariableOffset); - this._logSPIN(' -- localName=[' + localName + '](' + nameOffset + ')'); + this._logSPIN(' -- localName=[' + localName + '](' + nameOffset + + ')'); if (index == nameParts.length - 1) { // have name tokenSet.push({ @@ -1653,15 +1710,16 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke // have line assigning value to variable(s) // ------------------------------------------- const possibleVariableName = line.substr(currentOffset, assignmentOffset - currentOffset).trim() + this._logSPIN(' -- LHS: possibleVariableName=[' + possibleVariableName + ']'); let varNameList: string[] = [possibleVariableName] if (possibleVariableName.includes(",")) { varNameList = possibleVariableName.split(','); } - else if (possibleVariableName.includes(" ")) { + if (possibleVariableName.includes(" ")) { const lineInfo: IFilteredStrings = this._getNonWhiteSpinLineParts(possibleVariableName); varNameList = lineInfo.lineParts; } - this._logSPIN(' -- Spin: varNameList=[' + varNameList + ']'); + this._logSPIN(' -- LHS: varNameList=[' + varNameList + ']'); for (let index = 0; index < varNameList.length; index++) { const variableName: string = varNameList[index]; const variableNameLen: number = variableName.length; @@ -1670,7 +1728,7 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke // NOTE2 this handles code: result.byte[3] := {value} P2 OBEX: jm_apa102c.spin2 (139) // have complex target name, parse in loop const variableNameParts: string[] = variableName.split(/[ \t\[\]\+\-\(\)\<\>]/); - this._logSPIN(' -- Spin: [] variableNameParts=[' + variableNameParts + ']'); + this._logSPIN(' -- LHS: [] variableNameParts=[' + variableNameParts + ']'); let haveModification: boolean = false; for (let index = 0; index < variableNameParts.length; index++) { let variableNamePart = variableNameParts[index].replace('@', ''); @@ -1735,9 +1793,9 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke }); } else { - if (!this._isSpinReservedWord(variableNamePart)) { + if (!this._isSpinReservedWord(variableNamePart) && !this._isBuiltinReservedWord(variableNamePart) && !this._iDebugMethod(variableNamePart)) { // we don't have name registered so just mark it - this._logSPIN(' -- SPIN MISSING name=[' + variableNamePart + '](' + nameOffset + 1 + ')'); + this._logSPIN(' -- SPIN MISSING varname=[' + variableNamePart + '](' + nameOffset + 1 + ')'); tokenSet.push({ line: lineNumber, startCharacter: nameOffset, @@ -1753,11 +1811,29 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke } else { // have simple target name, no [] - const cleanedVariableName: string = variableName.replace(/[ \t\(\)]/, ''); + let cleanedVariableName: string = variableName.replace(/[ \t\(\)]/, ''); const nameOffset = line.indexOf(cleanedVariableName, currentOffset); if (cleanedVariableName.substr(0, 1).match(/[a-zA-Z_]/) && !this._isStorageType(cleanedVariableName)) { this._logSPIN(' -- SPIN cleanedVariableName=[' + cleanedVariableName + '](' + nameOffset + 1 + ')'); - let referenceDetails: IRememberedToken | undefined = undefined; + if (cleanedVariableName.includes('.')) { + const varNameParts: string[] = cleanedVariableName.split('.'); + if (this._isDatStorageType(varNameParts[1])) { + cleanedVariableName = varNameParts[0]; // just use first part of name + /* + // FIXME: UNDONE mark storage part correctly, yes, out-of-order + const nameOffset: number = line.indexOf(varNameParts[1]); + this._logSPIN(' -- SPIN storageType=[' + varNameParts[1] + '](' + nameOffset + 1 + ')'); + tokenSet.push({ + line: lineNumber, + startCharacter: nameOffset, + length: varNameParts[1].length, + tokenType: 'storageType', + tokenModifiers: [] + }); + */ + } + } + let referenceDetails: IRememberedToken | undefined = undefined; if (this._isLocalToken(cleanedVariableName)) { referenceDetails = this._getLocalToken(cleanedVariableName); this._logSPIN(' -- FOUND local name=[' + cleanedVariableName + ']'); @@ -1790,8 +1866,8 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke } else { // we don't have name registered so just mark it - if (!this._isSpinReservedWord(cleanedVariableName)) { - this._logSPIN(' -- SPIN MISSING name=[' + cleanedVariableName + '](' + nameOffset + 1 + ')'); + if (!this._isSpinReservedWord(cleanedVariableName) && !this._isBuiltinReservedWord(cleanedVariableName) && !this._iDebugMethod(cleanedVariableName)) { + this._logSPIN(' -- SPIN MISSING cln name=[' + cleanedVariableName + '](' + nameOffset + 1 + ')'); tokenSet.push({ line: lineNumber, startCharacter: nameOffset, @@ -1805,10 +1881,11 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke } currentOffset += variableNameLen + 1; } + currentOffset = assignmentOffset + 2; } - const assignmentRHSStr = this._getNonCommentLineRemainder(currentOffset, line); - const preCleanAssignmentRHSStr = assignmentRHSStr.replace('..', ' '); - currentOffset = line.indexOf(assignmentRHSStr); + const assignmentRHSStr: string = this._getNonCommentLineRemainder(currentOffset, line); + currentOffset = line.indexOf(assignmentRHSStr, currentOffset); + const preCleanAssignmentRHSStr = this._getNonInlineCommentLine(assignmentRHSStr).replace('..', ' '); this._logSPIN(' -- assignmentRHSStr=[' + assignmentRHSStr + ']'); const lineInfo: IFilteredStrings = this._getNonWhiteSpinLineParts(preCleanAssignmentRHSStr); let possNames: string[] = lineInfo.lineParts; @@ -1876,14 +1953,13 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke tokenModifiers: [] }); } - /* - else if (!this._isSpinReservedWord(namePart)) { + else if (!this._isSpinReservedWord(namePart) && !this._isBuiltinReservedWord(namePart) && !this._iDebugMethod(namePart)) { // NO DEBUG FOR ELSE, most of spin control elements come through here! //else { // this._logSPIN(' -- UNKNOWN?? name=[' + namePart + '] - name-get-breakage??'); //} - this._logSPIN(' -- SPIN MISSING name=[' + namePart + ']'); + this._logSPIN(' -- SPIN MISSING rhs name=[' + namePart + ']'); tokenSet.push({ line: lineNumber, startCharacter: nameOffset, @@ -1891,9 +1967,7 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke tokenType: 'variable', tokenModifiers: ['missingDeclaration'] }); - } - */ } if (possibleNameSet.length > 1) { // we have .constant namespace suffix @@ -2042,7 +2116,7 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke } else { // we don't have name registered so just mark it - if (!this._isSpinReservedWord(namePart)) { + if (!this._isSpinReservedWord(namePart) && !this._isBuiltinReservedWord(namePart) && !this._iDebugMethod(namePart)) { this._logPASM(' -- SPIN Pasm MISSING name=[' + namePart + ']'); tokenSet.push({ line: lineNumber, @@ -2142,7 +2216,7 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke } else { // we don't have name registered so just mark it - if (!this._isSpinReservedWord(nameReference)) { + if (!this._isSpinReservedWord(nameReference) && !this._isBuiltinReservedWord(nameReference) && !this._iDebugMethod(nameReference)) { this._logOBJ(' -- OBJ MISSING name=[' + nameReference + ']'); tokenSet.push({ line: lineNumber, @@ -2237,7 +2311,7 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke } else { // we don't have name registered so just mark it - if (!this._isSpinReservedWord(namePart)) { + if (!this._isSpinReservedWord(namePart) && !this._isBuiltinReservedWord(namePart) && !this._iDebugMethod(namePart)) { this._logVAR(' -- VAR MISSING name=[' + namePart + ']'); tokenSet.push({ line: lineNumber, @@ -2289,6 +2363,7 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke return tokenSet; } + /* private _possiblyMarkBrokenSingleLineComment(lineNumber: number, startingOffset: number, line: string): IParsedToken[] { // // this is an override to fix the lack of the syntax parser to recognize single line comments when there is more than one ' marker in the line. @@ -2322,6 +2397,7 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke } return tokenSet; } + */ private spin2log: any = undefined; // adjust following true/false to show specific parsing debug @@ -2332,7 +2408,7 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke private showDAT: boolean = true; private showVAR: boolean = true; private showPasmCode: boolean = true; - private showState: boolean = false; + private showState: boolean = true; private _logState(message: string): void { @@ -2425,6 +2501,37 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke }; } + private _getNonInlineCommentLine(line: string): string { + // NEW remove {comment} and {{comment}} single-line elements too + let nonInlineCommentStr: string = line; + // TODO: UNDONE make this into loop to find all single line {} or {{}} comments + const startDoubleBraceOffset: number = nonInlineCommentStr.indexOf('{{'); + if (startDoubleBraceOffset != -1) { + const endDoubleBraceOffset: number = nonInlineCommentStr.indexOf('}}', startDoubleBraceOffset + 2); + if (endDoubleBraceOffset != -1) { + // remove this comment + const badElement = nonInlineCommentStr.substr(startDoubleBraceOffset, endDoubleBraceOffset - startDoubleBraceOffset + 1); + //this._logMessage(' -- badElement=[' + badElement + ']'); + nonInlineCommentStr = nonInlineCommentStr.replace(badElement, ' '.repeat(badElement.length)); + } + } + const startSingleBraceOffset: number = nonInlineCommentStr.indexOf('{'); + if (startSingleBraceOffset != -1) { + const endSingleBraceOffset: number = nonInlineCommentStr.indexOf('}', startSingleBraceOffset + 1); + if (endSingleBraceOffset != -1) { + // remove this comment + const badElement = nonInlineCommentStr.substr(startSingleBraceOffset, endSingleBraceOffset - startSingleBraceOffset + 1); + //this._logMessage(' -- badElement=[' + badElement + ']'); + nonInlineCommentStr = nonInlineCommentStr.replace(badElement, ' '.repeat(badElement.length)); + } + } + if (nonInlineCommentStr.length != line.length) { + this._logMessage(' -- NIC line [' + line + ']'); + this._logMessage(' -- [' + nonInlineCommentStr + ']'); + } + return nonInlineCommentStr; + } + private _getNonCommentLineRemainder(startingOffset: number, line: string): string { let nonCommentRHSStr: string = line; // TODO: UNDONE make this into loop to find first ' not in string @@ -2437,14 +2544,8 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke // have single quote, is it within quoted string? const startDoubleQuoteOffset: number = line.indexOf('"', currentOffset); if (startDoubleQuoteOffset != -1) { - if (startDoubleQuoteOffset < beginCommentOffset) { - // yes is within... find end of quoted string, then find next - const endDoubleQuoteOffset: number = line.indexOf('"', startDoubleQuoteOffset + 1); - if (endDoubleQuoteOffset != -1) { - // have end of quoted string, find comment after - beginCommentOffset = line.indexOf("'", endDoubleQuoteOffset + 1); - } - } + const nonStringLine: string = this._removeQuotedStrings(line); + beginCommentOffset = nonStringLine.indexOf("'", currentOffset); } } if (beginCommentOffset === -1) { @@ -2464,6 +2565,10 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke } } } + //if (line.substr(startingOffset).length != nonCommentRHSStr.length) { + // this._logMessage(' -- NCLR line [' + line.substr(startingOffset) + ']'); + // this._logMessage(' -- [' + nonCommentRHSStr + ']'); + //} return nonCommentRHSStr; } @@ -2633,16 +2738,99 @@ class Spin2DocumentSemanticTokensProvider implements vscode.DocumentSemanticToke } return desiredToken } + private _isBuiltinReservedWord(name: string): boolean { + // streamer constants, smart-pin constants + const builtinNamesOfNote: string[] = [ + // streamer names + 'x_16p_2dac8_wfword', 'x_16p_4dac4_wfword', 'x_1adc8_0p_1dac8_wfbyte', 'x_1adc8_8p_2dac8_wfword', + 'x_1p_1dac1_wfbyte', 'x_2adc8_0p_2dac8_wfword', 'x_2adc8_16p_4dac8_wflong', 'x_2p_1dac2_wfbyte', + 'x_2p_2dac1_wfbyte', 'x_32p_4dac8_wflong', 'x_4adc8_0p_4dac8_wflong', 'x_4p_1dac4_wfbyte', + 'x_4p_2dac2_wfbyte', 'x_4p_4dac1_wf_byte', 'x_8p_1dac8_wfbyte', 'x_8p_2dac4_wfbyte', + 'x_8p_4dac2_wfbyte', 'x_alt_off', 'x_alt_on', 'x_dacs_0n0_0n0', 'x_dacs_0n0_x_x', 'x_dacs_0_0_0_0', + 'x_dacs_0_0_x_x', 'x_dacs_0_x_x_x', 'x_dacs_1n1_0n0', 'x_dacs_1_0_1_0', 'x_dacs_1_0_x_x', + 'x_dacs_3_2_1_0', 'x_dacs_off', 'x_dacs_x_0_x_x', 'x_dacs_x_x_0n0', 'x_dacs_x_x_0_0', + 'x_dacs_x_x_0_x', 'x_dacs_x_x_1_0', 'x_dacs_x_x_x_0', 'x_dds_goertzel_sinc1', 'x_dds_goertzel_sinc2', + 'x_imm_16x2_1dac2', 'x_imm_16x2_2dac1', 'x_imm_16x2_lut', 'x_imm_1x32_4dac8', 'x_imm_2x16_2dac8', + 'x_imm_2x16_4dac4', 'x_imm_32x1_1dac1', 'x_imm_32x1_lut', 'x_imm_4x8_1dac8', 'x_imm_4x8_2dac4', + 'x_imm_4x8_4dac2', 'x_imm_4x8_lut', 'x_imm_8x4_1dac4', 'x_imm_8x4_2dac2', 'x_imm_8x4_4dac1', + 'x_imm_8x4_lut', 'x_pins_off', 'x_pins_on', 'x_rfbyte_1p_1dac1', 'x_rfbyte_2p_1dac2', + 'x_rfbyte_2p_2dac1', 'x_rfbyte_4p_1dac4', 'x_rfbyte_4p_2dac2', 'x_rfbyte_4p_4dac1', 'x_rfbyte_8p_1dac8', + 'x_rfbyte_8p_2dac4', 'x_rfbyte_8p_4dac2', 'x_rfbyte_luma8', 'x_rfbyte_rgb8', 'x_rfbyte_rgbi8', + 'x_rflong_16x2_lut', 'x_rflong_32p_4dac8', 'x_rflong_32x1_lut', 'x_rflong_4x8_lut', 'x_rflong_8x4_lut', + 'x_rflong_rgb24', 'x_rfword_16p_2dac8', 'x_rfword_16p_4dac4', 'x_rfword_rgb16', 'x_write_off', 'x_write_on', + // smart pin names + 'p_adc', 'p_adc_100x', 'p_adc_10x', 'p_adc_1x', 'p_adc_30x', 'p_adc_3x', 'p_adc_ext', 'p_adc_float', + 'p_adc_gio', 'p_adc_scope', 'p_adc_vio', 'p_async_io', 'p_async_rx', 'p_async_tx', 'p_bitdac', + 'p_channel', 'p_compare_ab', 'p_compare_ab_fb', 'p_counter_highs', 'p_counter_periods', + 'p_counter_ticks', 'p_count_highs', 'p_count_rises', 'p_dac_124r_3v', 'p_dac_600r_2v', + 'p_dac_75r_2v', 'p_dac_990r_3v', 'p_dac_dither_pwm', 'p_dac_dither_rnd', 'p_dac_noise', + 'p_events_ticks', 'p_high_100ua', 'p_high_10ua', 'p_high_150k', 'p_high_15k', 'p_high_1k5', + 'p_high_1ma', 'p_high_fast', 'p_high_float', 'p_high_ticks', 'p_invert_a', 'p_invert_b', + 'p_invert_in', 'p_invert_output', 'p_level_a', 'p_level_a_fbn', 'p_level_a_fbp', 'p_local_a', + 'p_local_b', 'p_logic_a', 'p_logic_a_fb', 'p_logic_b_fb', 'p_low_100ua', 'p_low_10ua', 'p_low_150k', + 'p_low_15k', 'p_low_1k5', 'p_low_1ma', 'p_low_fast', 'p_low_float', 'p_minus1_a', 'p_minus1_b', + 'p_minus2_a', 'p_minus2_b', 'p_minus3_a', 'p_minus3_b', 'p_nco_duty', 'p_nco_freq', 'p_normal', 'p_oe', + 'p_outbit_a', 'p_outbit_b', 'p_periods_highs', 'p_periods_ticks', 'p_plus1_a', 'p_plus1_b', + 'p_plus2_a', 'p_plus2_b', 'p_plus3_a', 'p_plus3_b', 'p_pulse', 'p_pwm_sawtooth', 'p_pwm_smps', + 'p_pwm_triangle', 'p_quadrature', 'p_reg_down', 'p_reg_up', 'p_repository', 'p_schmitt_a', + 'p_schmitt_a_fb', 'p_schmitt_b_fb', 'p_state_ticks', 'p_sync_io', 'p_sync_rx', 'p_sync_tx', + 'p_transition', 'p_true_a', 'p_true_b', 'p_true_in', 'p_true_output', 'p_tt_00', 'p_tt_01', + 'p_tt_10', 'p_tt_11', 'p_usb_pair', + // event names + 'event_atn', 'event_ct1', 'event_ct2', 'event_ct3', 'event_fbw', 'event_int', 'event_pat', + 'event_qmt', 'event_se1', 'event_se2', 'event_se3', 'event_se4', 'event_xfi', 'event_xmt', + 'event_xrl', 'event_xro', + // debug() support + 'debug_cogs', 'debug_delay', 'debug_pin', 'debug_baud', 'debug_timestamp', 'debug_log_size', + 'debug_left', 'debug_top', 'debug_width', 'debug_height', 'debug_display_left', + 'debug_display_top', 'debug_windows_off', 'debug', 'dly', 'ifnot', 'if', + // + 'pr0', 'pr1', 'pr2', 'pr3', 'pr4', 'pr5', 'pr6', 'pr7', 'ijmp1', 'ijmp2', 'ijmp3', 'iret1', + 'iret2', 'iret3', 'pa', 'pb', 'ptra', 'ptrb', 'dira', 'dirb', 'outa', 'outb', 'ina', 'inb', + ]; + const reservedStatus: boolean = (builtinNamesOfNote.indexOf(name.toLowerCase()) != -1); + return reservedStatus; + } + + private _iDebugMethod(name: string): boolean { + const debugMethodOfNote: string[] = [ + 'zstr', 'lstr', 'udec', 'udec_byte', 'udec_word', 'udec_long', 'udec_reg_array', 'udec_byte_array', + 'udec_word_array', 'udec_long_array', 'sdec', 'sdec_byte', 'sdec_word', 'sdec_long', 'sdec_reg_array', + 'sdec_byte_array', 'sdec_word_array', 'sdec_long_array', 'uhex', 'uhex_byte', 'uhex_word', + 'uhex_long', 'uhex_reg_array', 'uhex_byte_array', 'uhex_word_array', 'uhex_long_array', 'shex', + 'shex_byte', 'shex_word', 'shex_long', 'shex_reg_array', 'shex_byte_array', 'shex_word_array', + 'shex_long_array', 'ubin', 'ubin_byte', 'ubin_word', 'ubin_long', 'ubin_reg_array', + 'ubin_byte_array', 'ubin_word_array', 'ubin_long_array', 'sbin', 'sbin_byte', 'sbin_word', + 'sbin_long', 'sbin_reg_array', 'sbin_byte_array', 'sbin_word_array', 'sbin_long_array' + ]; + const searchName: string = (name.endsWith('_')) ? name.substr(0, name.length - 1) : name; + const reservedStatus: boolean = (debugMethodOfNote.indexOf(searchName.toLowerCase()) != -1); + return reservedStatus; + } + private _isSpinReservedWord(name: string): boolean { const spinInstructionsOfNote: string[] = [ - 'send', 'addpins', 'reg', 'float', 'round', 'trunc', - 'clkmode', 'clkfreq', 'lookdown', 'send', + 'reg', 'float', 'round', 'trunc', + 'clkmode', 'clkfreq', 'varbase', 'clkmode_', 'clkfreq_', 'if', 'ifnot', 'elseif', 'elseifnot', 'else', 'while', 'repeat', 'until', 'from', 'to', 'step', 'next', 'quit', - 'case', 'case_fast', 'other', - 'true', 'false' - + 'case', 'case_fast', 'other', 'abort', 'return', + 'true', 'false', 'posx', 'negx', + // + 'newcog', 'cogexec', 'hubexec', 'cogexec_new', 'hubexec_new', 'cogexec_new_pair', 'hubexec_new_pair', + // + 'abs', 'encod', 'decod', 'bmask', 'ones', 'sqrt', 'qlog', 'qexp', 'sar', 'ror', 'rol', 'rev', 'zerox', + 'signx', 'sca', 'scas', 'frac', 'not', 'fieldoperations', 'addbits', 'addpins', 'and', 'or', 'xor', + // + 'akpin', 'bytefill', 'bytemove', 'call', 'clkset', 'cogatn', 'cogchk', 'cogid', 'coginit', 'cogspin', + 'cogstop', 'getct', 'getregs', 'getrnd', 'getsec', 'hubset', 'lockchk', 'locknew', 'lockrel', + 'lockret', 'locktry', 'longfill', 'longmove', 'lookdown', 'lookdownz', 'lookup', 'lookupz', + 'muldiv64', 'pinclear', 'pinf', 'pinfloat', 'pinh', 'pinhigh', 'pinl', 'pinlow', 'pinr', 'pinread', + 'pinstart', 'pint', 'pintoggle', 'pinw', 'pinwrite', 'pollatn', + 'pollct', 'polxy', 'rdpin', 'regexec', 'regload', 'rotxy', 'rqpin', 'send', 'setregs', 'strcomp', + 'string', 'strsize', 'waitatn', 'waitct', 'waitms', 'waitus', 'wordfill', 'wordmove', 'wrpin', + 'wxpin', 'wypin', 'xypol' ]; const reservedStatus: boolean = (spinInstructionsOfNote.indexOf(name.toLowerCase()) != -1); return reservedStatus; diff --git a/spin2/syntaxes/spin2.tmLanguage.YAML-tmLanguage b/spin2/syntaxes/spin2.tmLanguage.YAML-tmLanguage index 89ef193..0bd1179 100644 --- a/spin2/syntaxes/spin2.tmLanguage.YAML-tmLanguage +++ b/spin2/syntaxes/spin2.tmLanguage.YAML-tmLanguage @@ -135,7 +135,7 @@ repository: - include: '#pasm_language' - - match: '(?i)^(\w+)\b' + match: '^(\w+)\b' captures: '1': {name: variable.name.dat.spin2} - @@ -159,7 +159,7 @@ repository: ]} debug_functions: name: support.function.debug.methods.spin2 - match: '(?i)\b((S|U)(DEC|HEX|BIN)(_BYTE|_LONG|_WORD|_REG_ARRAY|_BYTE_ARRAY|_LONG_ARRAY|_WORD_ARRAY)?(_)?|ZSTR(_)?|LSTR(_)?|debug|DEBUG_(ENABLE|DELAY|PIN|TIMESTAMP)|DLY)\b' + match: '(?i)\b((S|U)(DEC|HEX|BIN)(_BYTE|_LONG|_WORD|_REG_ARRAY|_BYTE_ARRAY|_LONG_ARRAY|_WORD_ARRAY)?(_)?|ZSTR(_)?|LSTR(_)?|debug|DEBUG_(BAUD|COGS|DELAY|DISPLAY_LEFT|DISPLAY_TOP|ENABLE|HEIGHT|LEFT|LOG_SIZE|PIN|TIMESTAMP|TOP|WIDTH|WINDOWS_OFF)|DLY)\b' decimal_number: name: constant.numeric.decimal.spin2 patterns: @@ -258,10 +258,11 @@ repository: include: '#pasm_field_operations' - include: '#pasm_only_instructions' - + - + include: '#pasm_float_operators' pasm_storage_alignment: name: storage.modifier.spin2 - match: '(?i)\bALIGN(W|L)\b' + match: '(?i)\b(ALIGN(W|L))\b' pasm_language_elements: name: meta.block.pasm.elements.spin2 patterns: @@ -374,6 +375,8 @@ repository: include: '#pasm_language_elements' - include: '#pasm_field_operations' + - + include: '#pasm_float_operators' private_block: name: meta.block.private.spin2 begin: '(?i)^(PRI)\s+(\w+)\s*\((?:(.*))?\)(?:\s*\:\s*(\w+))?' @@ -421,6 +424,9 @@ repository: con_float_operators: name: keyword.operator.float.spin2 match: '(?i)\b(FLOAT|ROUND|TRUNC)\b' + pasm_float_operators: + name: keyword.operator.float.spin2 + match: '(?i)\b(FLOAT|ROUND|TRUNC)\b' spin_language_tiny: name: meta.block.spin.language.spin2 patterns: @@ -493,7 +499,7 @@ repository: match: '(?i)\bNEWCOG\b' - name: constant.language.clkset.spin2 - match: '\b(clkmode_|clkfreq_)\b' + match: '(?i)\b(clkmode_|clkfreq_)\b' - name: keyword.operator.unary.spin2 match: '(?i)\b(!!|NOT|!|-|ABS|ENCOD|DECOD|BMASK|ONES|SQRT|QLOG|QEXP|REG|AND)\b' @@ -505,61 +511,61 @@ repository: patterns: - name: constant.language.smartpins.spin2 - match: '\b(P_ADC|P_ADC_(100X|10X|1X|30X|3X|EXT|FLOAT|GIO|SCOPE|VIO)|P_ASYNC_(IO|RX|TX)|P_COMPARE_(AB|AB_FB))\b' + match: '(?i)\b(P_ADC|P_ADC_(100X|10X|1X|30X|3X|EXT|FLOAT|GIO|SCOPE|VIO)|P_ASYNC_(IO|RX|TX)|P_COMPARE_(AB|AB_FB))\b' - name: constant.language.smartpins.spin2 - match: '\b(P_COUNTER_(HIGHS|PERIODS|TICKS)|P_DAC_(124R_3V|600R_2V|75R_2V|990R_3V|DITHER_PWM|DITHER_RND|NOISE))\b' + match: '(?i)\b(P_COUNTER_(HIGHS|PERIODS|TICKS)|P_DAC_(124R_3V|600R_2V|75R_2V|990R_3V|DITHER_PWM|DITHER_RND|NOISE))\b' - name: constant.language.smartpins.spin2 - match: '\b(P_HIGH_(100UA|10UA|150K|15K|1K5|1MA|FAST|FLOAT|TICKS)|P_COUNT_(HIGHS|RISES)|P_INVERT_(A|B|IN|OUTPUT))\b' + match: '(?i)\b(P_HIGH_(100UA|10UA|150K|15K|1K5|1MA|FAST|FLOAT|TICKS)|P_COUNT_(HIGHS|RISES)|P_INVERT_(A|B|IN|OUTPUT))\b' - name: constant.language.smartpins.spin2 - match: '\b(P_LEVEL_A|P_LEVEL_A_(FBN|FBP)|P_LOCAL_(A|B)|P_LOGIC_(A|A_FB|B_FB)|P_LOW_(100UA|10UA|150K|15K|1K5|1MA|FAST|FLOAT))\b' + match: '(?i)\b(P_LEVEL_A|P_LEVEL_A_(FBN|FBP)|P_LOCAL_(A|B)|P_LOGIC_(A|A_FB|B_FB)|P_LOW_(100UA|10UA|150K|15K|1K5|1MA|FAST|FLOAT))\b' - name: constant.language.smartpins.spin2 - match: '\b(P_(BITDAC|CHANNEL|EVENTS_TICKS|NORMAL|OE|PULSE|QUADRATURE|REPOSITORY|STATE_TICKS|TRANSITION|TRUE_OUTPUT|USB_PAIR))\b' + match: '(?i)\b(P_(BITDAC|CHANNEL|EVENTS_TICKS|NORMAL|OE|PULSE|QUADRATURE|REPOSITORY|STATE_TICKS|TRANSITION|TRUE_OUTPUT|USB_PAIR))\b' - name: constant.language.smartpins.spin2 - match: '\b(P_OUTBIT_(A|B)|P_PERIODS_(HIGHS|TICKS)|P_PLUS(1|2|3)_(A|B)|P_PWM_(SAWTOOTH|SMPS|TRIANGLE)|P_REG_(DOWN|UP))\b' + match: '(?i)\b(P_OUTBIT_(A|B)|P_PERIODS_(HIGHS|TICKS)|P_PLUS(1|2|3)_(A|B)|P_PWM_(SAWTOOTH|SMPS|TRIANGLE)|P_REG_(DOWN|UP))\b' - name: constant.language.smartpins.spin2 - match: '\b(P_SCHMITT_(A|A_FB|B_FB)|P_SYNC_(IO|RX|TX)|P_TRUE_(A|B|IN)|P_TT_(0|1)(0|1)|P_MINUS(1|2|3)_(A|B)|P_NCO_(DUTY|FREQ))\b' + match: '(?i)\b(P_SCHMITT_(A|A_FB|B_FB)|P_SYNC_(IO|RX|TX)|P_TRUE_(A|B|IN)|P_TT_(0|1)(0|1)|P_MINUS(1|2|3)_(A|B)|P_NCO_(DUTY|FREQ))\b' streamer_constants: name: meta.block.spin.language.spin2 patterns: - name: constant.language.streamer.spin2 - match: '\b(X_WRITE_(ON|OFF)|X_ALT_(ON|OFF)|X_PINS_(ON|OFF))\b' + match: '(?i)\b(X_WRITE_(ON|OFF)|X_ALT_(ON|OFF)|X_PINS_(ON|OFF))\b' - name: constant.language.streamer.spin2 - match: '\b(X_16P_2DAC8_WFWORD|X_16P_4DAC4_WFWORD|X_1ADC8_0P_1DAC8_WFBYTE|X_1ADC8_8P_2DAC8_WFWORD|X_1P_1DAC1_WFBYTE|X_2ADC8_0P_2DAC8_WFWORD)\b' + match: '(?i)\b(X_16P_2DAC8_WFWORD|X_16P_4DAC4_WFWORD|X_1ADC8_0P_1DAC8_WFBYTE|X_1ADC8_8P_2DAC8_WFWORD|X_1P_1DAC1_WFBYTE|X_2ADC8_0P_2DAC8_WFWORD)\b' - name: constant.language.streamer.spin2 - match: '\b(X_2ADC8_16P_4DAC8_WFLONG|X_2P_1DAC2_WFBYTE|X_2P_2DAC1_WFBYTE|X_32P_4DAC8_WFLONG|X_4ADC8_0P_4DAC8_WFLONG|X_4P_1DAC4_WFBYTE)\b' + match: '(?i)\b(X_2ADC8_16P_4DAC8_WFLONG|X_2P_1DAC2_WFBYTE|X_2P_2DAC1_WFBYTE|X_32P_4DAC8_WFLONG|X_4ADC8_0P_4DAC8_WFLONG|X_4P_1DAC4_WFBYTE)\b' - name: constant.language.streamer.spin2 - match: '\b(X_4P_2DAC2_WFBYTE|X_4P_4DAC1_WF_BYTE|X_8P_1DAC8_WFBYTE|X_8P_2DAC4_WFBYTE|X_8P_4DAC2_WFBYTE|X_DACS_0N0_0N0|X_DACS_0N0_X_X)\b' + match: '(?i)\b(X_4P_2DAC2_WFBYTE|X_4P_4DAC1_WF_BYTE|X_8P_1DAC8_WFBYTE|X_8P_2DAC4_WFBYTE|X_8P_4DAC2_WFBYTE|X_DACS_0N0_0N0|X_DACS_0N0_X_X)\b' - name: constant.language.streamer.spin2 - match: '\b(X_DACS_0_0_0_0|X_DACS_0_0_X_X|X_DACS_0_X_X_X|X_DACS_1N1_0N0|X_DACS_1_0_1_0|X_DACS_1_0_X_X|X_DACS_3_2_1_0|X_DACS_OFF|X_DACS_X_0_X_X)\b' + match: '(?i)\b(X_DACS_0_0_0_0|X_DACS_0_0_X_X|X_DACS_0_X_X_X|X_DACS_1N1_0N0|X_DACS_1_0_1_0|X_DACS_1_0_X_X|X_DACS_3_2_1_0|X_DACS_OFF|X_DACS_X_0_X_X)\b' - name: constant.language.streamer.spin2 - match: '\b(X_DACS_X_X_0N0|X_DACS_X_X_0_0|X_DACS_X_X_0_X|X_DACS_X_X_1_0|X_DACS_X_X_X_0|X_DDS_GOERTZEL_SINC1|X_DDS_GOERTZEL_SINC2|X_IMM_16X2_1DAC2)\b' + match: '(?i)\b(X_DACS_X_X_0N0|X_DACS_X_X_0_0|X_DACS_X_X_0_X|X_DACS_X_X_1_0|X_DACS_X_X_X_0|X_DDS_GOERTZEL_SINC1|X_DDS_GOERTZEL_SINC2|X_IMM_16X2_1DAC2)\b' - name: constant.language.streamer.spin2 - match: '\b(X_IMM_16X2_2DAC1|X_IMM_16X2_LUT|X_IMM_1X32_4DAC8|X_IMM_2X16_2DAC8|X_IMM_2X16_4DAC4|X_IMM_32X1_1DAC1|X_IMM_32X1_LUT|X_IMM_4X8_1DAC8)\b' + match: '(?i)\b(X_IMM_16X2_2DAC1|X_IMM_16X2_LUT|X_IMM_1X32_4DAC8|X_IMM_2X16_2DAC8|X_IMM_2X16_4DAC4|X_IMM_32X1_1DAC1|X_IMM_32X1_LUT|X_IMM_4X8_1DAC8)\b' - name: constant.language.streamer.spin2 - match: '\b(X_IMM_4X8_2DAC4|X_IMM_4X8_4DAC2|X_IMM_4X8_LUT|X_IMM_8X4_1DAC4|X_IMM_8X4_2DAC2|X_IMM_8X4_4DAC1|X_IMM_8X4_LUT|X_RFBYTE_1P_1DAC1)\b' + match: '(?i)\b(X_IMM_4X8_2DAC4|X_IMM_4X8_4DAC2|X_IMM_4X8_LUT|X_IMM_8X4_1DAC4|X_IMM_8X4_2DAC2|X_IMM_8X4_4DAC1|X_IMM_8X4_LUT|X_RFBYTE_1P_1DAC1)\b' - name: constant.language.streamer.spin2 - match: '\b(X_RFBYTE_2P_1DAC2|X_RFBYTE_2P_2DAC1|X_RFBYTE_4P_1DAC4|X_RFBYTE_4P_2DAC2|X_RFBYTE_4P_4DAC1|X_RFBYTE_8P_1DAC8|X_RFBYTE_8P_2DAC4)\b' + match: '(?i)\b(X_RFBYTE_2P_1DAC2|X_RFBYTE_2P_2DAC1|X_RFBYTE_4P_1DAC4|X_RFBYTE_4P_2DAC2|X_RFBYTE_4P_4DAC1|X_RFBYTE_8P_1DAC8|X_RFBYTE_8P_2DAC4)\b' - name: constant.language.streamer.spin2 - match: '\b(X_RFBYTE_8P_4DAC2|X_RFBYTE_LUMA8|X_RFBYTE_RGB8|X_RFBYTE_RGBI8|X_RFLONG_16X2_LUT|X_RFLONG_32P_4DAC8|X_RFLONG_32X1_LUT)\b' + match: '(?i)\b(X_RFBYTE_8P_4DAC2|X_RFBYTE_LUMA8|X_RFBYTE_RGB8|X_RFBYTE_RGBI8|X_RFLONG_16X2_LUT|X_RFLONG_32P_4DAC8|X_RFLONG_32X1_LUT)\b' - name: constant.language.streamer.spin2 - match: '\b(X_RFLONG_4X8_LUT|X_RFLONG_8X4_LUT|X_RFLONG_RGB24|X_RFWORD_16P_2DAC8|X_RFWORD_16P_4DAC4|X_RFWORD_RGB16)\b' + match: '(?i)\b(X_RFLONG_4X8_LUT|X_RFLONG_8X4_LUT|X_RFLONG_RGB24|X_RFWORD_16P_2DAC8|X_RFWORD_16P_4DAC4|X_RFWORD_RGB16)\b' string: name: string.quoted.double.spin2 begin: '"' diff --git a/spin2/syntaxes/spin2.tmLanguage.json b/spin2/syntaxes/spin2.tmLanguage.json index c074593..11674a0 100644 --- a/spin2/syntaxes/spin2.tmLanguage.json +++ b/spin2/syntaxes/spin2.tmLanguage.json @@ -202,7 +202,7 @@ "include": "#pasm_language" }, { - "match": "(?i)^(\\w+)\\b", + "match": "^(\\w+)\\b", "captures": { "1": { "name": "variable.name.dat.spin2" @@ -258,7 +258,7 @@ }, "debug_functions": { "name": "support.function.debug.methods.spin2", - "match": "(?i)\\b((S|U)(DEC|HEX|BIN)(_BYTE|_LONG|_WORD|_REG_ARRAY|_BYTE_ARRAY|_LONG_ARRAY|_WORD_ARRAY)?(_)?|ZSTR(_)?|LSTR(_)?|debug|DEBUG_(ENABLE|DELAY|PIN|TIMESTAMP)|DLY)\\b" + "match": "(?i)\\b((S|U)(DEC|HEX|BIN)(_BYTE|_LONG|_WORD|_REG_ARRAY|_BYTE_ARRAY|_LONG_ARRAY|_WORD_ARRAY)?(_)?|ZSTR(_)?|LSTR(_)?|debug|DEBUG_(BAUD|COGS|DELAY|DISPLAY_LEFT|DISPLAY_TOP|ENABLE|HEIGHT|LEFT|LOG_SIZE|PIN|TIMESTAMP|TOP|WIDTH|WINDOWS_OFF)|DLY)\\b" }, "decimal_number": { "name": "constant.numeric.decimal.spin2", @@ -414,12 +414,15 @@ }, { "include": "#pasm_only_instructions" + }, + { + "include": "#pasm_float_operators" } ] }, "pasm_storage_alignment": { "name": "storage.modifier.spin2", - "match": "(?i)\\bALIGN(W|L)\\b" + "match": "(?i)\\b(ALIGN(W|L))\\b" }, "pasm_language_elements": { "name": "meta.block.pasm.elements.spin2", @@ -575,6 +578,9 @@ }, { "include": "#pasm_field_operations" + }, + { + "include": "#pasm_float_operators" } ] }, @@ -647,6 +653,10 @@ "name": "keyword.operator.float.spin2", "match": "(?i)\\b(FLOAT|ROUND|TRUNC)\\b" }, + "pasm_float_operators": { + "name": "keyword.operator.float.spin2", + "match": "(?i)\\b(FLOAT|ROUND|TRUNC)\\b" + }, "spin_language_tiny": { "name": "meta.block.spin.language.spin2", "patterns": [ @@ -745,7 +755,7 @@ }, { "name": "constant.language.clkset.spin2", - "match": "\\b(clkmode_|clkfreq_)\\b" + "match": "(?i)\\b(clkmode_|clkfreq_)\\b" }, { "name": "keyword.operator.unary.spin2", @@ -762,31 +772,31 @@ "patterns": [ { "name": "constant.language.smartpins.spin2", - "match": "\\b(P_ADC|P_ADC_(100X|10X|1X|30X|3X|EXT|FLOAT|GIO|SCOPE|VIO)|P_ASYNC_(IO|RX|TX)|P_COMPARE_(AB|AB_FB))\\b" + "match": "(?i)\\b(P_ADC|P_ADC_(100X|10X|1X|30X|3X|EXT|FLOAT|GIO|SCOPE|VIO)|P_ASYNC_(IO|RX|TX)|P_COMPARE_(AB|AB_FB))\\b" }, { "name": "constant.language.smartpins.spin2", - "match": "\\b(P_COUNTER_(HIGHS|PERIODS|TICKS)|P_DAC_(124R_3V|600R_2V|75R_2V|990R_3V|DITHER_PWM|DITHER_RND|NOISE))\\b" + "match": "(?i)\\b(P_COUNTER_(HIGHS|PERIODS|TICKS)|P_DAC_(124R_3V|600R_2V|75R_2V|990R_3V|DITHER_PWM|DITHER_RND|NOISE))\\b" }, { "name": "constant.language.smartpins.spin2", - "match": "\\b(P_HIGH_(100UA|10UA|150K|15K|1K5|1MA|FAST|FLOAT|TICKS)|P_COUNT_(HIGHS|RISES)|P_INVERT_(A|B|IN|OUTPUT))\\b" + "match": "(?i)\\b(P_HIGH_(100UA|10UA|150K|15K|1K5|1MA|FAST|FLOAT|TICKS)|P_COUNT_(HIGHS|RISES)|P_INVERT_(A|B|IN|OUTPUT))\\b" }, { "name": "constant.language.smartpins.spin2", - "match": "\\b(P_LEVEL_A|P_LEVEL_A_(FBN|FBP)|P_LOCAL_(A|B)|P_LOGIC_(A|A_FB|B_FB)|P_LOW_(100UA|10UA|150K|15K|1K5|1MA|FAST|FLOAT))\\b" + "match": "(?i)\\b(P_LEVEL_A|P_LEVEL_A_(FBN|FBP)|P_LOCAL_(A|B)|P_LOGIC_(A|A_FB|B_FB)|P_LOW_(100UA|10UA|150K|15K|1K5|1MA|FAST|FLOAT))\\b" }, { "name": "constant.language.smartpins.spin2", - "match": "\\b(P_(BITDAC|CHANNEL|EVENTS_TICKS|NORMAL|OE|PULSE|QUADRATURE|REPOSITORY|STATE_TICKS|TRANSITION|TRUE_OUTPUT|USB_PAIR))\\b" + "match": "(?i)\\b(P_(BITDAC|CHANNEL|EVENTS_TICKS|NORMAL|OE|PULSE|QUADRATURE|REPOSITORY|STATE_TICKS|TRANSITION|TRUE_OUTPUT|USB_PAIR))\\b" }, { "name": "constant.language.smartpins.spin2", - "match": "\\b(P_OUTBIT_(A|B)|P_PERIODS_(HIGHS|TICKS)|P_PLUS(1|2|3)_(A|B)|P_PWM_(SAWTOOTH|SMPS|TRIANGLE)|P_REG_(DOWN|UP))\\b" + "match": "(?i)\\b(P_OUTBIT_(A|B)|P_PERIODS_(HIGHS|TICKS)|P_PLUS(1|2|3)_(A|B)|P_PWM_(SAWTOOTH|SMPS|TRIANGLE)|P_REG_(DOWN|UP))\\b" }, { "name": "constant.language.smartpins.spin2", - "match": "\\b(P_SCHMITT_(A|A_FB|B_FB)|P_SYNC_(IO|RX|TX)|P_TRUE_(A|B|IN)|P_TT_(0|1)(0|1)|P_MINUS(1|2|3)_(A|B)|P_NCO_(DUTY|FREQ))\\b" + "match": "(?i)\\b(P_SCHMITT_(A|A_FB|B_FB)|P_SYNC_(IO|RX|TX)|P_TRUE_(A|B|IN)|P_TT_(0|1)(0|1)|P_MINUS(1|2|3)_(A|B)|P_NCO_(DUTY|FREQ))\\b" } ] }, @@ -795,47 +805,47 @@ "patterns": [ { "name": "constant.language.streamer.spin2", - "match": "\\b(X_WRITE_(ON|OFF)|X_ALT_(ON|OFF)|X_PINS_(ON|OFF))\\b" + "match": "(?i)\\b(X_WRITE_(ON|OFF)|X_ALT_(ON|OFF)|X_PINS_(ON|OFF))\\b" }, { "name": "constant.language.streamer.spin2", - "match": "\\b(X_16P_2DAC8_WFWORD|X_16P_4DAC4_WFWORD|X_1ADC8_0P_1DAC8_WFBYTE|X_1ADC8_8P_2DAC8_WFWORD|X_1P_1DAC1_WFBYTE|X_2ADC8_0P_2DAC8_WFWORD)\\b" + "match": "(?i)\\b(X_16P_2DAC8_WFWORD|X_16P_4DAC4_WFWORD|X_1ADC8_0P_1DAC8_WFBYTE|X_1ADC8_8P_2DAC8_WFWORD|X_1P_1DAC1_WFBYTE|X_2ADC8_0P_2DAC8_WFWORD)\\b" }, { "name": "constant.language.streamer.spin2", - "match": "\\b(X_2ADC8_16P_4DAC8_WFLONG|X_2P_1DAC2_WFBYTE|X_2P_2DAC1_WFBYTE|X_32P_4DAC8_WFLONG|X_4ADC8_0P_4DAC8_WFLONG|X_4P_1DAC4_WFBYTE)\\b" + "match": "(?i)\\b(X_2ADC8_16P_4DAC8_WFLONG|X_2P_1DAC2_WFBYTE|X_2P_2DAC1_WFBYTE|X_32P_4DAC8_WFLONG|X_4ADC8_0P_4DAC8_WFLONG|X_4P_1DAC4_WFBYTE)\\b" }, { "name": "constant.language.streamer.spin2", - "match": "\\b(X_4P_2DAC2_WFBYTE|X_4P_4DAC1_WF_BYTE|X_8P_1DAC8_WFBYTE|X_8P_2DAC4_WFBYTE|X_8P_4DAC2_WFBYTE|X_DACS_0N0_0N0|X_DACS_0N0_X_X)\\b" + "match": "(?i)\\b(X_4P_2DAC2_WFBYTE|X_4P_4DAC1_WF_BYTE|X_8P_1DAC8_WFBYTE|X_8P_2DAC4_WFBYTE|X_8P_4DAC2_WFBYTE|X_DACS_0N0_0N0|X_DACS_0N0_X_X)\\b" }, { "name": "constant.language.streamer.spin2", - "match": "\\b(X_DACS_0_0_0_0|X_DACS_0_0_X_X|X_DACS_0_X_X_X|X_DACS_1N1_0N0|X_DACS_1_0_1_0|X_DACS_1_0_X_X|X_DACS_3_2_1_0|X_DACS_OFF|X_DACS_X_0_X_X)\\b" + "match": "(?i)\\b(X_DACS_0_0_0_0|X_DACS_0_0_X_X|X_DACS_0_X_X_X|X_DACS_1N1_0N0|X_DACS_1_0_1_0|X_DACS_1_0_X_X|X_DACS_3_2_1_0|X_DACS_OFF|X_DACS_X_0_X_X)\\b" }, { "name": "constant.language.streamer.spin2", - "match": "\\b(X_DACS_X_X_0N0|X_DACS_X_X_0_0|X_DACS_X_X_0_X|X_DACS_X_X_1_0|X_DACS_X_X_X_0|X_DDS_GOERTZEL_SINC1|X_DDS_GOERTZEL_SINC2|X_IMM_16X2_1DAC2)\\b" + "match": "(?i)\\b(X_DACS_X_X_0N0|X_DACS_X_X_0_0|X_DACS_X_X_0_X|X_DACS_X_X_1_0|X_DACS_X_X_X_0|X_DDS_GOERTZEL_SINC1|X_DDS_GOERTZEL_SINC2|X_IMM_16X2_1DAC2)\\b" }, { "name": "constant.language.streamer.spin2", - "match": "\\b(X_IMM_16X2_2DAC1|X_IMM_16X2_LUT|X_IMM_1X32_4DAC8|X_IMM_2X16_2DAC8|X_IMM_2X16_4DAC4|X_IMM_32X1_1DAC1|X_IMM_32X1_LUT|X_IMM_4X8_1DAC8)\\b" + "match": "(?i)\\b(X_IMM_16X2_2DAC1|X_IMM_16X2_LUT|X_IMM_1X32_4DAC8|X_IMM_2X16_2DAC8|X_IMM_2X16_4DAC4|X_IMM_32X1_1DAC1|X_IMM_32X1_LUT|X_IMM_4X8_1DAC8)\\b" }, { "name": "constant.language.streamer.spin2", - "match": "\\b(X_IMM_4X8_2DAC4|X_IMM_4X8_4DAC2|X_IMM_4X8_LUT|X_IMM_8X4_1DAC4|X_IMM_8X4_2DAC2|X_IMM_8X4_4DAC1|X_IMM_8X4_LUT|X_RFBYTE_1P_1DAC1)\\b" + "match": "(?i)\\b(X_IMM_4X8_2DAC4|X_IMM_4X8_4DAC2|X_IMM_4X8_LUT|X_IMM_8X4_1DAC4|X_IMM_8X4_2DAC2|X_IMM_8X4_4DAC1|X_IMM_8X4_LUT|X_RFBYTE_1P_1DAC1)\\b" }, { "name": "constant.language.streamer.spin2", - "match": "\\b(X_RFBYTE_2P_1DAC2|X_RFBYTE_2P_2DAC1|X_RFBYTE_4P_1DAC4|X_RFBYTE_4P_2DAC2|X_RFBYTE_4P_4DAC1|X_RFBYTE_8P_1DAC8|X_RFBYTE_8P_2DAC4)\\b" + "match": "(?i)\\b(X_RFBYTE_2P_1DAC2|X_RFBYTE_2P_2DAC1|X_RFBYTE_4P_1DAC4|X_RFBYTE_4P_2DAC2|X_RFBYTE_4P_4DAC1|X_RFBYTE_8P_1DAC8|X_RFBYTE_8P_2DAC4)\\b" }, { "name": "constant.language.streamer.spin2", - "match": "\\b(X_RFBYTE_8P_4DAC2|X_RFBYTE_LUMA8|X_RFBYTE_RGB8|X_RFBYTE_RGBI8|X_RFLONG_16X2_LUT|X_RFLONG_32P_4DAC8|X_RFLONG_32X1_LUT)\\b" + "match": "(?i)\\b(X_RFBYTE_8P_4DAC2|X_RFBYTE_LUMA8|X_RFBYTE_RGB8|X_RFBYTE_RGBI8|X_RFLONG_16X2_LUT|X_RFLONG_32P_4DAC8|X_RFLONG_32X1_LUT)\\b" }, { "name": "constant.language.streamer.spin2", - "match": "\\b(X_RFLONG_4X8_LUT|X_RFLONG_8X4_LUT|X_RFLONG_RGB24|X_RFWORD_16P_2DAC8|X_RFWORD_16P_4DAC4|X_RFWORD_RGB16)\\b" + "match": "(?i)\\b(X_RFLONG_4X8_LUT|X_RFLONG_8X4_LUT|X_RFLONG_RGB24|X_RFWORD_16P_2DAC8|X_RFWORD_16P_4DAC4|X_RFWORD_RGB16)\\b" } ] },