From b38fc89a1db458743b601d85f2c04cfa295adb1b Mon Sep 17 00:00:00 2001 From: toastal <561087+toastal@users.noreply.github.com> Date: Fri, 23 Jul 2021 11:12:58 +0000 Subject: [PATCH] =?UTF-8?q?PureScript:=20Made=20`=E2=88=80`=20a=20keyword?= =?UTF-8?q?=20(alias=20for=20`forall`)=20(#3005)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/prism-purescript.js | 2 +- components/prism-purescript.min.js | 2 +- .../languages/purescript/keyword_feature.test | 42 ++++++++++--------- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/components/prism-purescript.js b/components/prism-purescript.js index 02cdaaab78..9abff50301 100644 --- a/components/prism-purescript.js +++ b/components/prism-purescript.js @@ -1,5 +1,5 @@ Prism.languages.purescript = Prism.languages.extend('haskell', { - 'keyword': /\b(?:ado|case|class|data|derive|do|else|forall|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/, + 'keyword': /\b(?:ado|case|class|data|derive|do|else|forall|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b|∀/, 'import-statement': { // The imported or hidden names are not included in this import diff --git a/components/prism-purescript.min.js b/components/prism-purescript.min.js index 04fc4edadd..afa495712a 100644 --- a/components/prism-purescript.min.js +++ b/components/prism-purescript.min.js @@ -1 +1 @@ -Prism.languages.purescript=Prism.languages.extend("haskell",{keyword:/\b(?:ado|case|class|data|derive|do|else|forall|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/,"import-statement":{pattern:/(^[\t ]*)import\s+[A-Z][\w']*(?:\.[A-Z][\w']*)*(?:\s+as\s+[A-Z][\w']*(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m,lookbehind:!0,inside:{keyword:/\b(?:import|as|hiding)\b/}},builtin:/\b(?:absurd|add|ap|append|apply|between|bind|bottom|clamp|compare|comparing|compose|conj|const|degree|discard|disj|div|eq|flap|flip|gcd|identity|ifM|join|lcm|liftA1|liftM1|map|max|mempty|min|mod|mul|negate|not|notEq|one|otherwise|recip|show|sub|top|unit|unless|unlessM|void|when|whenM|zero)\b/}),Prism.languages.purs=Prism.languages.purescript; \ No newline at end of file +Prism.languages.purescript=Prism.languages.extend("haskell",{keyword:/\b(?:ado|case|class|data|derive|do|else|forall|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b|∀/,"import-statement":{pattern:/(^[\t ]*)import\s+[A-Z][\w']*(?:\.[A-Z][\w']*)*(?:\s+as\s+[A-Z][\w']*(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m,lookbehind:!0,inside:{keyword:/\b(?:import|as|hiding)\b/}},builtin:/\b(?:absurd|add|ap|append|apply|between|bind|bottom|clamp|compare|comparing|compose|conj|const|degree|discard|disj|div|eq|flap|flip|gcd|identity|ifM|join|lcm|liftA1|liftM1|map|max|mempty|min|mod|mul|negate|not|notEq|one|otherwise|recip|show|sub|top|unit|unless|unlessM|void|when|whenM|zero)\b/}),Prism.languages.purs=Prism.languages.purescript; \ No newline at end of file diff --git a/tests/languages/purescript/keyword_feature.test b/tests/languages/purescript/keyword_feature.test index 339da635eb..3d47c6bc59 100644 --- a/tests/languages/purescript/keyword_feature.test +++ b/tests/languages/purescript/keyword_feature.test @@ -18,30 +18,32 @@ primitive then type where +∀ ---------------------------------------------------- [ - ["keyword", "ado"], - ["keyword", "case"], - ["keyword", "class"], - ["keyword", "data"], - ["keyword", "derive"], - ["keyword", "do"], - ["keyword", "else"], - ["keyword", "if"], - ["keyword", "in"], - ["keyword", "infixl"], - ["keyword", "infixr"], - ["keyword", "instance"], - ["keyword", "let"], - ["keyword", "module"], - ["keyword", "newtype"], - ["keyword", "of"], - ["keyword", "primitive"], - ["keyword", "then"], - ["keyword", "type"], - ["keyword", "where"] + ["keyword", "ado"], + ["keyword", "case"], + ["keyword", "class"], + ["keyword", "data"], + ["keyword", "derive"], + ["keyword", "do"], + ["keyword", "else"], + ["keyword", "if"], + ["keyword", "in"], + ["keyword", "infixl"], + ["keyword", "infixr"], + ["keyword", "instance"], + ["keyword", "let"], + ["keyword", "module"], + ["keyword", "newtype"], + ["keyword", "of"], + ["keyword", "primitive"], + ["keyword", "then"], + ["keyword", "type"], + ["keyword", "where"], + ["keyword", "∀"] ] ----------------------------------------------------