-
Notifications
You must be signed in to change notification settings - Fork 791
MySQL ` (backtick) highlighting #1551
Copy link
Copy link
Closed
Milestone
Description
Hello,
I am trying to highlighting everything between backticks exactly like in MySQL Workbench:

Code
This is my style and example sql
# -*- coding: utf-8 -*-
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Punctuation, Generic, Whitespace, Text, Literal, Punctuation
class WorkbenchStyle(Style):
styles = {
Whitespace: '#a89028',
Text: '#000000',
Punctuation: '#000000',
Comment.Single: '#0987cb',
Comment.Special: '#0987cb',
Comment.Multiline: '#0987cb',
Comment.Preproc: '#0987cb',
Number.Hex: '#cc6c00',
Number.Bin: '#cc6c00',
Number.Float: '#cc6c00',
Number.Integer: '#cc6c00',
Literal.Date: '#cc6c00',
String.Single: '#dd7a00',
String.Double: '#dd7a00',
String.Escape: '#dd7a00',
Name: '#993a3e', # <<<<<<<<<<<<<
Name.Variable: '#000000',
Name.Constant: 'bold #007FBF',
Name.Function: '#7d7d63',
Operator: '#000000',
Keyword: 'bold #007FBF',
Keyword.Type: 'bold #007FBF',
}SELECT MIN(date) FROM medw
WHERE afd = (SELECT anr FROM afd WHERE name = 'Verkoop\%');
/**
abc
\%
*/
-- abc
# lollll lol
create user bob@localhost identified by 'Secure1pass!';
SELECT * FROM abc GROUP BY a;
use bobdb;
PREPARE stmt1 FROM 'SELECT SQRT(POW(?,2) + POW(?,2)) AS hypotenuse';
SET @a = 3;
SET @b = 4; ?
EXECUTE stmt1 USING @a, @b;
SELECT * FROM abc WHERE x = ' %s a' OR a = 0xA111 or c = 0b0011
AND x IS NULL OR c = true
AND f = '1983-09-05 13:28:00' OR `xbc`.`a` >= 567;
'x'
SELECT /*+ MAX_EXECUTION_TIME(1000) */ * FROM t1
PROCEDURE
MAX_EXECUTION_TIME(3)
CREATE TABLE IF NOT EXISTS tasks (
task_id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255) NOT NULL,
start_date DATE,
due_date DATE,
status TINYINT NOT NULL,
priority TINYINT NOT NULL,
description TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=INNODB;I compile everything using
pygmentize -f html -l mysql -O style=workbench -O noclasses=True -o abc.html test.sql
My attempts at solving the issue
The problem is that Name: '#993a3e' makes everything red:

I Have tried solving it with noinherit, but alas
Backtick identification seems to be happening here, here or here. A solution would be appreciated
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels