Skip to content

Commit ee4ad0a

Browse files
authored
Fix MySQL lexer single comment render error (#1214)
fixes #1213 Removing the mandatory space after `--` allowed the regex to correctly parse the inline comments and avoid matching actual code on empty `--` After (using `chromad --csrf-key=moo`): <img height="450" alt="image" src="https://github.com/user-attachments/assets/9cde3149-f9bb-4c4c-922c-396f47fb9c45" /> new regex matches the `sql.xml` single comment pattern https://github.com/alecthomas/chroma/blob/17e5911b080afc465735539d861fab10e3646dcb/lexers/embedded/sql.xml#L15 I followed the instructions on AGENTS.md for running the project, since I'm never developed with go language, am not familiar with the environment and I couldn't find a build/run instructions elsewhere (since the project seems simple to run, I guess it was not needed).
1 parent b160804 commit ee4ad0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lexers/embedded/mysql.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<rule pattern="\s+">
3939
<token type="TextWhitespace"/>
4040
</rule>
41-
<rule pattern="(#|--\s+).*\n?">
41+
<rule pattern="(#|--).*\n?">
4242
<token type="CommentSingle"/>
4343
</rule>
4444
<rule pattern="/\*">

0 commit comments

Comments
 (0)