diff --git a/components/prism-reason.js b/components/prism-reason.js index 462f10e93d..ed420ec727 100644 --- a/components/prism-reason.js +++ b/components/prism-reason.js @@ -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': { diff --git a/components/prism-reason.min.js b/components/prism-reason.min.js index fcdc91bfb9..4c67651f29 100644 --- a/components/prism-reason.min.js +++ b/components/prism-reason.min.js @@ -1 +1 @@ -Prism.languages.reason=Prism.languages.extend("clike",{comment:{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"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/}),Prism.languages.insertBefore("reason","class-name",{character:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,alias:"string"},constructor:{pattern:/\b[A-Z]\w*\b(?!\s*\.)/,alias:"variable"},label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete Prism.languages.reason.function; \ No newline at end of file +Prism.languages.reason=Prism.languages.extend("clike",{comment:{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"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/}),Prism.languages.insertBefore("reason","class-name",{character:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,alias:"string"},constructor:{pattern:/\b[A-Z]\w*\b(?!\s*\.)/,alias:"variable"},label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete Prism.languages.reason.function; \ No newline at end of file diff --git a/tests/languages/reason/operator_feature.test b/tests/languages/reason/operator_feature.test index 868aac43f1..2794f78663 100644 --- a/tests/languages/reason/operator_feature.test +++ b/tests/languages/reason/operator_feature.test @@ -8,6 +8,7 @@ +. -. *. /. mod land lor lxor lsl lsr asr +|> -> ---------------------------------------------------- @@ -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", "->"] ] ----------------------------------------------------