Skip to content

Commit

Permalink
Added additional operators to Reason (#1648)
Browse files Browse the repository at this point in the history
This adds the `|>` and `->` operators to Reason.
  • Loading branch information
Schniz authored and RunDevelopment committed Dec 3, 2018
1 parent 9de47d3 commit 8b1bb46
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/prism-reason.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Prism.languages.reason = Prism.languages.extend('clike', {
// 'class-name' must be matched *after* 'constructor' defined below
'class-name': /\b[A-Z]\w*/,
'keyword': /\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,
'operator': /\.{3}|:[:=]|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:mod|land|lor|lxor|lsl|lsr|asr)\b/
'operator': /\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:mod|land|lor|lxor|lsl|lsr|asr)\b/
});
Prism.languages.insertBefore('reason', 'class-name', {
'character': {
Expand Down
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/operator_feature.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
+. -. *. /.
mod land lor lxor
lsl lsr asr
|> ->

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

Expand All @@ -21,7 +22,8 @@ lsl lsr asr
["operator", "+"], ["operator", "-"], ["operator", "*"], ["operator", "/"],
["operator", "+."], ["operator", "-."], ["operator", "*."], ["operator", "/."],
["operator", "mod"], ["operator", "land"], ["operator", "lor"], ["operator", "lxor"],
["operator", "lsl"], ["operator", "lsr"], ["operator", "asr"]
["operator", "lsl"], ["operator", "lsr"], ["operator", "asr"],
["operator", "|>"], ["operator", "->"]
]

----------------------------------------------------
Expand Down

0 comments on commit 8b1bb46

Please sign in to comment.