Skip to content

Commit

Permalink
ReasonML: Add support for single line comments (#2150)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Fedoseev authored and RunDevelopment committed Jan 5, 2020
1 parent 24c8f83 commit 7f1c55b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 1 addition & 5 deletions components/prism-reason.js
@@ -1,8 +1,4 @@
Prism.languages.reason = Prism.languages.extend('clike', {
'comment': {
pattern: /(^|[^\\])\/\*[\s\S]*?\*\//,
lookbehind: true
},
'string': {
pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,
greedy: true
Expand All @@ -29,4 +25,4 @@ Prism.languages.insertBefore('reason', 'class-name', {
});

// We can't match functions property, so let's not even try.
delete Prism.languages.reason.function;
delete Prism.languages.reason.function;
2 changes: 1 addition & 1 deletion components/prism-reason.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion tests/languages/reason/comment_feature.test
@@ -1,3 +1,4 @@
// foobar
/**/
/* Single line comment */
/* Multiline
Expand All @@ -9,6 +10,7 @@ Doc comment
----------------------------------------------------

[
["comment", "// foobar"],
["comment", "/**/"],
["comment", "/* Single line comment */"],
["comment", "/* Multiline\r\ncomment */"],
Expand All @@ -17,4 +19,4 @@ Doc comment

----------------------------------------------------

Checks for comments.
Checks for comments.

0 comments on commit 7f1c55b

Please sign in to comment.