Skip to content

Commit 4041489

Browse files
authored
fix: wrong token type (#5535)
1 parent 15f6be2 commit 4041489

File tree

3 files changed

+49
-16
lines changed

3 files changed

+49
-16
lines changed

demo/kitchen-sink/docs/erlang.erl

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@
1717
% Force the use of 'codeswitch/1' from the latest MODULE version
1818
end.
1919

20-
codeswitch(Sum) -> loop(Sum).
20+
codeswitch(Sum) -> loop(Sum).
21+
22+
% Print the data using the pretty print specifier
23+
io:format("Here is the data: ~p~n", [Data]).

src/mode/_test/tokens_erlang.json

+30
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,34 @@
163163
["variable.other.erlang","Sum"],
164164
["punctuation.definition.parameters.end.erlang",")"],
165165
["punctuation.terminator.function.erlang","."]
166+
],[
167+
"start",
168+
["text"," "]
169+
],[
170+
"start",
171+
["text"," "],
172+
["punctuation.definition.comment.erlang","% Print the data using the pretty print specifier"]
173+
],[
174+
"start",
175+
["text"," "],
176+
["entity.name.type.class.module.erlang","io"],
177+
["punctuation.separator.module-function.erlang",":"],
178+
["entity.name.function.erlang","format"],
179+
["punctuation.definition.parameters.begin.erlang","("],
180+
["punctuation.definition.string.begin.erlang","\""],
181+
["string.quoted.double.erlang","Here is the data: "],
182+
["punctuation.definition.erlang","~"],
183+
["constant.other.erlang","p"],
184+
["punctuation.definition.erlang","~"],
185+
["constant.other.erlang","n"],
186+
["punctuation.definition.string.end.erlang","\""],
187+
["punctuation.separator.parameters.erlang",","],
188+
["text"," "],
189+
["punctuation.definition.list.begin.erlang","["],
190+
["variable.other.erlang","Data"],
191+
["punctuation.definition.list.end.erlang","]"],
192+
["punctuation.definition.parameters.end.erlang",")"],
193+
["text","."]
194+
],[
195+
"start"
166196
]]

src/mode/erlang_highlight_rules.js

+15-15
Original file line numberDiff line numberDiff line change
@@ -789,23 +789,23 @@ var ErlangHighlightRules = function() {
789789
regex: '(\\\\)(?:([bdefnrstv\\\\\'"])|(\\^)([@-_])|([0-7]{1,3}))' },
790790
{ token: 'invalid.illegal.string.erlang', regex: '\\\\\\^?.?' },
791791
{ token:
792-
[ 'punctuation.definition.placeholder.erlang',
793-
'punctuation.separator.placeholder-parts.erlang',
794-
'constant.other.placeholder.erlang',
795-
'punctuation.separator.placeholder-parts.erlang',
796-
'punctuation.separator.placeholder-parts.erlang',
797-
'constant.other.placeholder.erlang',
798-
'punctuation.separator.placeholder-parts.erlang',
799-
'punctuation.separator.placeholder-parts.erlang',
800-
'punctuation.separator.placeholder-parts.erlang',
801-
'constant.other.placeholder.erlang',
802-
'constant.other.placeholder.erlang' ],
792+
[ 'punctuation.definition.erlang',
793+
'punctuation.separator.erlang',
794+
'constant.other.erlang',
795+
'punctuation.separator.erlang',
796+
'punctuation.separator.erlang',
797+
'constant.other.erlang',
798+
'punctuation.separator.erlang',
799+
'punctuation.separator.erlang',
800+
'punctuation.separator.erlang',
801+
'constant.other.erlang',
802+
'constant.other.erlang' ],
803803
regex: '(~)(?:((?:\\-)?)(\\d+)|(\\*))?(?:(\\.)(?:(\\d+)|(\\*)))?(?:(\\.)(?:(\\*)|(.)))?([~cfegswpWPBX#bx\\+ni])' },
804804
{ token:
805-
[ 'punctuation.definition.placeholder.erlang',
806-
'punctuation.separator.placeholder-parts.erlang',
807-
'constant.other.placeholder.erlang',
808-
'constant.other.placeholder.erlang' ],
805+
[ 'punctuation.definition.erlang',
806+
'punctuation.separator.erlang',
807+
'constant.other.erlang',
808+
'constant.other.erlang' ],
809809
regex: '(~)((?:\\*)?)((?:\\d+)?)([~du\\-#fsacl])' },
810810
{ token: 'invalid.illegal.string.erlang', regex: '~.?' },
811811
{ defaultToken: 'string.quoted.double.erlang' } ] } ],

0 commit comments

Comments
 (0)