Skip to content

Commit

Permalink
fix: wrong token type (#5535)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkslanc committed Apr 26, 2024
1 parent 15f6be2 commit 4041489
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 16 deletions.
5 changes: 4 additions & 1 deletion demo/kitchen-sink/docs/erlang.erl
Expand Up @@ -17,4 +17,7 @@
% Force the use of 'codeswitch/1' from the latest MODULE version
end.

codeswitch(Sum) -> loop(Sum).
codeswitch(Sum) -> loop(Sum).

% Print the data using the pretty print specifier
io:format("Here is the data: ~p~n", [Data]).
30 changes: 30 additions & 0 deletions src/mode/_test/tokens_erlang.json
Expand Up @@ -163,4 +163,34 @@
["variable.other.erlang","Sum"],
["punctuation.definition.parameters.end.erlang",")"],
["punctuation.terminator.function.erlang","."]
],[
"start",
["text"," "]
],[
"start",
["text"," "],
["punctuation.definition.comment.erlang","% Print the data using the pretty print specifier"]
],[
"start",
["text"," "],
["entity.name.type.class.module.erlang","io"],
["punctuation.separator.module-function.erlang",":"],
["entity.name.function.erlang","format"],
["punctuation.definition.parameters.begin.erlang","("],
["punctuation.definition.string.begin.erlang","\""],
["string.quoted.double.erlang","Here is the data: "],
["punctuation.definition.erlang","~"],
["constant.other.erlang","p"],
["punctuation.definition.erlang","~"],
["constant.other.erlang","n"],
["punctuation.definition.string.end.erlang","\""],
["punctuation.separator.parameters.erlang",","],
["text"," "],
["punctuation.definition.list.begin.erlang","["],
["variable.other.erlang","Data"],
["punctuation.definition.list.end.erlang","]"],
["punctuation.definition.parameters.end.erlang",")"],
["text","."]
],[
"start"
]]
30 changes: 15 additions & 15 deletions src/mode/erlang_highlight_rules.js
Expand Up @@ -789,23 +789,23 @@ var ErlangHighlightRules = function() {
regex: '(\\\\)(?:([bdefnrstv\\\\\'"])|(\\^)([@-_])|([0-7]{1,3}))' },
{ token: 'invalid.illegal.string.erlang', regex: '\\\\\\^?.?' },
{ token:
[ 'punctuation.definition.placeholder.erlang',
'punctuation.separator.placeholder-parts.erlang',
'constant.other.placeholder.erlang',
'punctuation.separator.placeholder-parts.erlang',
'punctuation.separator.placeholder-parts.erlang',
'constant.other.placeholder.erlang',
'punctuation.separator.placeholder-parts.erlang',
'punctuation.separator.placeholder-parts.erlang',
'punctuation.separator.placeholder-parts.erlang',
'constant.other.placeholder.erlang',
'constant.other.placeholder.erlang' ],
[ 'punctuation.definition.erlang',
'punctuation.separator.erlang',
'constant.other.erlang',
'punctuation.separator.erlang',
'punctuation.separator.erlang',
'constant.other.erlang',
'punctuation.separator.erlang',
'punctuation.separator.erlang',
'punctuation.separator.erlang',
'constant.other.erlang',
'constant.other.erlang' ],
regex: '(~)(?:((?:\\-)?)(\\d+)|(\\*))?(?:(\\.)(?:(\\d+)|(\\*)))?(?:(\\.)(?:(\\*)|(.)))?([~cfegswpWPBX#bx\\+ni])' },
{ token:
[ 'punctuation.definition.placeholder.erlang',
'punctuation.separator.placeholder-parts.erlang',
'constant.other.placeholder.erlang',
'constant.other.placeholder.erlang' ],
[ 'punctuation.definition.erlang',
'punctuation.separator.erlang',
'constant.other.erlang',
'constant.other.erlang' ],
regex: '(~)((?:\\*)?)((?:\\d+)?)([~du\\-#fsacl])' },
{ token: 'invalid.illegal.string.erlang', regex: '~.?' },
{ defaultToken: 'string.quoted.double.erlang' } ] } ],
Expand Down

0 comments on commit 4041489

Please sign in to comment.