Skip to content

Commit

Permalink
add v44 built-in names
Browse files Browse the repository at this point in the history
  • Loading branch information
ironsheep committed Mar 13, 2024
1 parent 839cbf4 commit ec96e84
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spin2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ Possible next additions:
- Add new-file templates as Snippets
- Add additional Snippets as the community identifies them

## [2.2.15] 2024-01-11

Update P2 Only

- Add support for v44 new built-in method names

## [2.2.14] 2024-01-11

Update P1 & P2
Expand Down
31 changes: 31 additions & 0 deletions spin2/server/src/parser/spin2.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2287,6 +2287,29 @@ export class Spin2ParseUtils {
]
};

private _tableSpinEnhancements_v44: { [Identifier: string]: string[] } = {
// NOTE: this does NOT support signature help! (paramaters are not highlighted for signature help due to variant forms for string() being allowed)
byteswap: ['BYTESWAP(AddrA, AddrB, Count) : Match', 'Swap Count bytes of data starting at AddrA and AddrB.'],
wordswap: ['WORDSWAP(AddrA, AddrB, Count) : Match', 'Swap Count words of data starting at AddrA and AddrB.'],
longswap: ['LONGSWAP(AddrA, AddrB, Count) : Match', 'Swap Count longs of data starting at AddrA and AddrB.'],
bytecomp: [
'BYTECOMP(AddrA, AddrB, Count) : Match',
'Compare Count bytes of data starting at AddrA and AddrB, return -1 if match or 0 if mismatch.'
],
wordcomp: [
'WORDCOMP(AddrA, AddrB, Count) : Match',
'Compare Count words of data starting at AddrA and AddrB, return -1 if match or 0 if mismatch.'
],
longcomp: [
'LONGCOMP(AddrA, AddrB, Count) : Match',
'Compare Count longs of data starting at AddrA and AddrB, return -1 if match or 0 if mismatch.'
],
fill: ['FILL(StructA, ByteValue)', 'Fill StructA with ByteValue.'],
copy: ['COPY(StructA, StructB)', 'Copy contents of StructB into StructA.'],
swap: ['SWAP(StructA, StructB)', 'Swap contents of StructA and StructB.'],
comp: ['COMP(StructA, StructB) : Match', 'Compare contents of StructA and StructB, return -1 if match or 0 if mismatch.']
};

private _tableSpinIndexValueMethods: { [Identifier: string]: string[] } = {
// NOTE: this does NOT support signature help! (paramaters are not highlighted for signature help due to ':' being param separater)
lookup: [
Expand Down Expand Up @@ -2351,6 +2374,10 @@ export class Spin2ParseUtils {
if (!reservedStatus && this.requestedSpinVersion(43)) {
// if {Spin2_v43} or greater then also search this table
reservedStatus = nameKey in this._tableSpinEnhancements_v43;
if (!reservedStatus && this.requestedSpinVersion(44)) {
// if {Spin2_v44} or greater then also search this table
reservedStatus = nameKey in this._tableSpinEnhancements_v44;
}
}
}
}
Expand Down Expand Up @@ -2405,6 +2432,10 @@ export class Spin2ParseUtils {
// if {Spin2_v43} or greater then also search this table
desiredDocText.category = 'String Method';
protoWDescr = this._tableSpinEnhancements_v43[nameKey];
} else if (this.requestedSpinVersion(44) && nameKey in this._tableSpinEnhancements_v44) {
// if {Spin2_v44} or greater then also search this table
desiredDocText.category = 'String Method';
protoWDescr = this._tableSpinEnhancements_v44[nameKey];
} else if (nameKey in this._tableSpinIndexValueMethods) {
desiredDocText.category = 'Hub Method';
protoWDescr = this._tableSpinIndexValueMethods[nameKey];
Expand Down

0 comments on commit ec96e84

Please sign in to comment.