Skip to content

Syntax Checking for Embedded SQL Broken by Continued Literal #462

@BrianGodsend

Description

@BrianGodsend

When editing a SQLRPGLE source member, the syntax checker is incorrectly flagging lines with "Variable name casing does not match definition." errors. This appears to happen when the embedded SQL contains a literal value that is continued on the next line using the "+" continuation character. Also note the use of a host variable on the line before the continued literal.

For example, the following source has the lines indicated with <-Variable... incorrectly flagged in error:

**FREE
dcl-s ucPath       Varchar(256);
dcl-s stmLib       Char(10);
dcl-s stmFile      Char(10);
dcl-s stmMbr       Char(10);
dcl-s stmType      Char(10);

ucPath = %upper('/a/path/to/a/source/stream/file/mylib/QRPGLESRC/JUNKBUG.SQLRPGLE');
exec sql
    SELECT
    CHAR(IFNULL(REGEXP_SUBSTR(:ucPath,
    '/([A-Z$#@][A-Z0-9$#@_.]{0,9})/([A-Z$#@][A-Z0-9$#@_.]{0,9})+
    /([A-Z$#@][A-Z0-9$#@_.]{0,9}?)(\.([A-Z$#@][A-Z0-9$#@_]{0,9}))?$'
    , 1, 1, '', 1), ''), 10) lib
    ,CHAR(IFNULL(REGEXP_SUBSTR(:ucPath,
    '/([A-Z$#@][A-Z0-9$#@_.]{0,9})+                                                    <-Variable...
    /([A-Z$#@][A-Z0-9$#@_.]{0,9}?)(\.([A-Z$#@][A-Z0-9$#@_]{0,9}))?$'
    , 1, 1, '', 1), ''), 10) file
    ,CHAR(IFNULL(REGEXP_SUBSTR(:ucPath,                                                <-Variable...
    '/([A-Z$#@][A-Z0-9$#@_.]{0,9}?)(\.([A-Z$#@][A-Z0-9$#@_]{0,9}))?$'
    , 1, 1, '', 1), ''), 10) mbr
    ,CHAR(IFNULL(REGEXP_SUBSTR(:ucPath,                                                <-Variable...
    '/([A-Z$#@][A-Z0-9$#@_.]{0,9}?)(\.([A-Z$#@][A-Z0-9$#@_]{0,9}))?$'                  <-Variable...
    , 1, 1, '', 3), ''), 10) mbrtype
    INTO :stmLib, :stmFile, :stmMbr, :stmType
    FROM sysibm.sysdummy1 a;

snd-msg 'Library:=/' + %trim(stmLib) + '/'
    + '  File:=/' + %trim(stmFile) + '/'
    + '  Member:=/' + %trim(stmMbr) + '/'
    + '  Type:=/' + %trim(stmType) + '/';

*inLR = *ON;
return;

Context Version
Code for IBM i version 2.17.0
Visual Studio Code version 1.104.0
Operating System win32_x64
Active extensions
.NET Install Tool (vscode-dotnet-runtime): 2.3.7
Atlassian: Jira & Bitbucket (atlascode): 3.8.15
COBOL (cobol): 25.9.10
Code for IBM i Walkthroughs (vscode-ibmi-walkthroughs): 0.5.0
Configuration Editing (configuration-editing): 1.0.0
Db2 for IBM i (vscode-db2i): 1.15.1
Dev Containers (remote-containers): 0.427.0
ESLint (vscode-eslint): 3.0.16
Emmet (emmet): 1.0.0
Error Lens (errorlens): 3.26.0
Extension Authoring (extension-editing): 1.0.0
Git (git): 1.0.0
Git Base (git-base): 1.0.0
GitHub (github): 0.0.1
GitHub Authentication (github-authentication): 0.0.2
GitHub Pull Requests (vscode-pull-request-github): 0.118.0
GitLens — Git supercharged (gitlens): 17.4.1
HTML CSS Support (vscode-html-css): 2.0.13
IBM i Debug (ibmidebug): 3.0.0
IBM i Project Explorer (vscode-ibmi-projectexplorer): 2.12.3
JSON Language Features (json-language-features): 1.0.0
Merge Conflict (merge-conflict): 1.0.0
NPM support for VS Code (npm): 1.0.1
Node Debug Auto-attach (debug-auto-launch): 1.0.0
Nx Console (angular-console): 18.67.0
Path Intellisense (path-intellisense): 2.10.0
Prettier - Code formatter (prettier-vscode): 11.0.0
RPGLE (vscode-rpgle): 0.33.2
Reload (reload): 0.0.7
Source Orbit (vscode-sourceorbit): 1.4.1
TODO Highlight (vscode-todo-highlight): 1.0.5
Todo Tree (todo-tree): 0.0.226
TypeScript and JavaScript Language Features (typescript-language-features): 1.0.0
WSL (remote-wsl): 0.104.1
YAML (vscode-yaml): 1.18.0

Remote system
Setting Value
IBM i OS V7R4M0
Tech Refresh 7
CCSID Origin 37
Runtime CCSID 37
Default CCSID 37
SSHD CCSID ?
cqsh true
SQL Enabled
Source dates Disabled

Enabled features

/QOpenSys/pkgs/bin /usr/bin /QSYS.lib/ILEDITOR.lib /QSYS.LIB /QIBM/ProdData/IBMiDebugService/bin /QOpenSys/QIBM/ProdData/JavaVM/jdk80
bash attr GETNEWLIBL.PGM QZDFMDB2.PGM startDebugService.sh 64bit
chsh iconv
find setccsid
git uname
grep
ls
md5sum
sort
stat
tar
tn5250
Shell env
BUILDLIB=QGPL
CURLIB=QGPL
PASE_USRGRP_LIMITED=N
PATH=/QOpenSys/pkgs/bin:/QOpenSys/usr/bin:/usr/ccs/bin:/QOpenSys/usr/bin/X11:/usr/sbin:.:/usr/bin:/QOpenSys/usr/bin:/usr/bin
SHELL=/QOpenSys/pkgs/bin/bash
SHLVL=1
TZ=<EST>5<EDT>,M3.2.0,M11.1.0
_=/QOpenSys/pkgs/bin/env
Variants
{
  "american": "#@$",
  "local": "#@$",
  "qsysNameRegex": {}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions