mirror of
https://github.com/len0rd/personal-website.git
synced 2025-02-28 19:42:15 -05:00
fix dbc multi-line comment lexing
This commit is contained in:
parent
f87f46701b
commit
430bc0172a
11
conf.py
11
conf.py
|
@ -72,8 +72,9 @@ class CanbusDbcLexer(RegexLexer):
|
||||||
|
|
||||||
tokens = {
|
tokens = {
|
||||||
"root": [
|
"root": [
|
||||||
(r"[:\|\[\],\(\)]", token.Punctuation),
|
(r"[:\|\[\],\(\);f]", token.Punctuation),
|
||||||
(r"[\@\-\+]", token.Operator),
|
(r"[\@\-\+]", token.Operator),
|
||||||
|
(r'"[\S\s]*?"', token.String),
|
||||||
("CM_", token.Keyword, "comment"),
|
("CM_", token.Keyword, "comment"),
|
||||||
("SG_", token.Keyword, "signal"),
|
("SG_", token.Keyword, "signal"),
|
||||||
("BO_", token.Keyword, "msg"),
|
("BO_", token.Keyword, "msg"),
|
||||||
|
@ -133,19 +134,17 @@ class CanbusDbcLexer(RegexLexer):
|
||||||
],
|
],
|
||||||
"comment": [
|
"comment": [
|
||||||
(
|
(
|
||||||
r'(\s+)(BO_)(\s+)(\d+)(\s+)(".*?")(;)',
|
r'(\s+)(BO_)(\s+)(\d+)(\s+)',
|
||||||
bygroups(
|
bygroups(
|
||||||
token.Whitespace,
|
token.Whitespace,
|
||||||
token.Keyword,
|
token.Keyword,
|
||||||
token.Whitespace,
|
token.Whitespace,
|
||||||
token.Number,
|
token.Number,
|
||||||
token.Whitespace,
|
token.Whitespace,
|
||||||
token.String,
|
|
||||||
token.Punctuation,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
r'(\s+)(SG_)(\s+)(\d+)(\s+)(\w+)(\s+)(".*?")(;)',
|
r'(\s+)(SG_)(\s+)(\d+)(\s+)(\w+)(\s+)',
|
||||||
bygroups(
|
bygroups(
|
||||||
token.Whitespace,
|
token.Whitespace,
|
||||||
token.Keyword,
|
token.Keyword,
|
||||||
|
@ -154,8 +153,6 @@ class CanbusDbcLexer(RegexLexer):
|
||||||
token.Whitespace,
|
token.Whitespace,
|
||||||
token.Name,
|
token.Name,
|
||||||
token.Whitespace,
|
token.Whitespace,
|
||||||
token.String,
|
|
||||||
token.Punctuation,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in a new issue