pyscripter / SynEdit

SynEdit is a syntax highlighting edit control, not based on the Windows common controls.
26 stars 11 forks source link

TSynSQLSyn and slashes "/////" are not parsed correctly #91

Closed dados closed 4 months ago

dados commented 4 months ago

The last slash is parsed as Symbol but the others in front are not parsed at all. It seems that sqlNexus handles / but else is missing for other dialects. See possible solutution near the bottom of the procedure

procedure TSynSQLSyn.SlashProc;
begin
  Inc(Run);
  case fLine[Run] of
    '*':
      begin
        if (SQLDialect = sqlMySql) and (fLine[Run + 1] = '!') then
        begin
          fRange := rsConditionalComment;
          fTokenID := tkConditionalComment;
        end
        else
        begin
          fRange := rsComment;
          fTokenID := tkComment;
        end;
        repeat
          Inc(Run);
          if (fLine[Run] = '*') and (fLine[Run + 1] = '/') then begin
            fRange := rsUnknown;
            Inc(Run, 2);
            break;
          end;
        until IsLineEnd(Run);
      end;
    '=':
      begin
        Inc(Run);
        fTokenID := tkSymbol;
      end;
    '/':
      begin
        if (SQLDialect = sqlNexus)  then
        begin
          fTokenID := tkComment;
          repeat
            Inc(Run);
          until IsLineEnd(Run);
        end else 
          fTokenID := tkSymbol;   <-- This code should be added
      end
    else
      fTokenID := tkSymbol;
  end;
end;
pyscripter commented 4 months ago

Thanks. Could you please submit a PR for this?

pyscripter commented 4 months ago

Never mind. I committed the change.