Skip to content

Commit c4527e8

Browse files
committed
fix: C++ comments after #include
Fixes #841
1 parent 40542a6 commit c4527e8

File tree

7 files changed

+426
-421
lines changed

7 files changed

+426
-421
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ tokentype_string.go: types.go
1313
go generate
1414

1515
chromad:
16-
rm -f chromad
16+
rm -rf build
1717
esbuild --bundle cmd/chromad/static/index.js --minify --outfile=cmd/chromad/static/index.min.js
1818
esbuild --bundle cmd/chromad/static/index.css --minify --outfile=cmd/chromad/static/index.min.css
19-
(export CGOENABLED=0 ; cd ./cmd/chromad && go build -ldflags="-X 'main.version=$(VERSION)'" -o ../../chromad .)
19+
(export CGOENABLED=0 ; cd ./cmd/chromad && go build -ldflags="-X 'main.version=$(VERSION)'" -o ../../build/chromad .)
2020

21-
upload: chromad
22-
scp chromad root@swapoff.org: && \
21+
upload: build/chromad
22+
scp build/chromad root@swapoff.org: && \
2323
ssh root@swapoff.org 'install -m755 ./chromad /srv/http/swapoff.org/bin && service chromad restart'

bin/.svu-1.11.0.pkg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hermit

bin/svu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.svu-1.11.0.pkg

lexers/embedded/c++.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
</rule>
8585
</state>
8686
<state name="macro">
87-
<rule pattern="(include)(\s*(?:/[*].*?[*]/\s*)?)([^\n]+)">
87+
<rule pattern="(include)(\s+)(&quot;[^&quot;]+?&quot;|&lt;[^&gt;]+?&gt;)">
8888
<bygroups>
8989
<token type="CommentPreproc"/>
9090
<token type="Text"/>

lexers/testdata/cpp.actual

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "a"
2-
#include <b>
1+
#include "a" // comment
2+
#include <b> // comment
33

44
[[nodiscard]] void foo() noexcept;
55
void foo();

lexers/testdata/cpp.expected

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
{"type":"CommentPreproc","value":"#include"},
33
{"type":"Text","value":" "},
44
{"type":"CommentPreprocFile","value":"\"a\""},
5-
{"type":"CommentPreproc","value":"\n#include"},
5+
{"type":"CommentPreproc","value":" "},
6+
{"type":"CommentSingle","value":"// comment\n"},
7+
{"type":"CommentPreproc","value":"#include"},
68
{"type":"Text","value":" "},
79
{"type":"CommentPreprocFile","value":"\u003cb\u003e"},
8-
{"type":"CommentPreproc","value":"\n"},
10+
{"type":"CommentPreproc","value":" "},
11+
{"type":"CommentSingle","value":"// comment\n"},
912
{"type":"Text","value":"\n"},
1013
{"type":"NameAttribute","value":"[[nodiscard]]"},
1114
{"type":"Text","value":" "},

0 commit comments

Comments
 (0)