Skip to content

Commit

Permalink
repair detection of align(l|w) in VAR (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
ironsheep committed May 9, 2024
1 parent 3397eb7 commit 0218d4c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
8 changes: 7 additions & 1 deletion spin2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,17 @@ Possible next additions:
- Add new-file templates as Snippets
- Add additional Snippets as the community identifies them

## [2.2.17] 2024-05-??

Update P2 Only

- BUGFIX: parsing repair detection of alignl/alignw in VAR Issue(#9)

## [2.2.16] 2024-04-14

Update P2 Only

- BUGFIX: Syntax: add missing bytefit/wordfit recodnition in DAT blocks (#6)
- BUGFIX: Syntax: add missing bytefit/wordfit recognition in DAT blocks (#6)
- BUGFIX: Semantic: repair handling of {Spin2_v??} built-in method name support
- BUGFIX: File access issues on Windows (11?) repaired
- Cleaned up the code-fold detection... now handling ORG* forms better
Expand Down
11 changes: 11 additions & 0 deletions spin2/TEST_LANG_SERVER/spin2/240509-fixes.spin2
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
' reported issue #9
CON

MAX_PATH = 4

VAR
alignl
long repeatkey,repeatnext

alignl
byte curdir[MAX_PATH+1],tmppath[MAX_PATH+1]
6 changes: 3 additions & 3 deletions spin2/server/src/parser/spin2.documentSemanticParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class Spin2DocumentSemanticParser {

private bLogStarted: boolean = false;
// adjust following true/false to show specific parsing debug
private isDebugLogEnabled: boolean = false; // WARNING (REMOVE BEFORE FLIGHT)- change to 'false' - disable before commit
private isDebugLogEnabled: boolean = true; // WARNING (REMOVE BEFORE FLIGHT)- change to 'false' - disable before commit
private showSpinCode: boolean = true;
private showPreProc: boolean = true;
private showCON: boolean = true;
Expand Down Expand Up @@ -2048,7 +2048,7 @@ export class Spin2DocumentSemanticParser {
this._logVAR(` -- GLBL GetVarDecl adjust longVarName:[${newName}] -> [${tempParts[0]}]`);
newName = tempParts[0];
}
if (newName.charAt(0).match(/[a-zA-Z_]/)) {
if (newName.charAt(0).match(/[a-zA-Z_]/) && !this.parseUtils.isAlignType(newName)) {
this._logVAR(` -- GLBL GetVarDecl w/type newName=[${newName}]`);
const nameOffset = line.indexOf(newName, currentOffset); // FIXME: UNDONE, do we have to dial this in?
const referenceDetails: RememberedToken | undefined = this.semanticFindings.getGlobalToken(newName);
Expand Down Expand Up @@ -2080,7 +2080,7 @@ export class Spin2DocumentSemanticParser {
this._logVAR(` -- GLBL GetVarDecl adjust longVarName:[${longVarName}] -> [${tempParts[0]}]`);
longVarName = tempParts[0];
}
if (longVarName.charAt(0).match(/[a-zA-Z_]/)) {
if (longVarName.charAt(0).match(/[a-zA-Z_]/) && !this.parseUtils.isAlignType(longVarName)) {
this._logVAR(` -- GLBL GetVarDecl w/o type newName=[${longVarName}]`);
const nameOffset = line.indexOf(longVarName, currentOffset); // FIXME: UNDONE, do we have to dial this in?
const referenceDetails: RememberedToken | undefined = this.semanticFindings.getGlobalToken(longVarName);
Expand Down

0 comments on commit 0218d4c

Please sign in to comment.