Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Schmidt <[email protected]>
  • Loading branch information
sriharshachilakapati and RunDevelopment authored Aug 30, 2020
1 parent ec4e325 commit 6e2da60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions components/prism-purescript.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
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': {
'import-statement': {
// The imported or hidden names are not included in this import
// statement. This is because we want to highlight those exactly like
// we do for the names in the program.
pattern: /((?:\r?\n|\r|^)\s*)import\s+(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*(?:\s+as\s+(?:[A-Z][_a-zA-Z0-9']*)(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m,
pattern: /(^\s*)import\s+[A-Z][\w']*(?:\.[A-Z][\w']*)*(?:\s+as\s+[A-Z][\w']*(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m,
lookbehind: true,
inside: {
'keyword': /\b(?:import|as|hiding)\b/
}
},

// These are builtin functions only. Constructors are highlighted later as a constant.
'builtin': /\b(?:when|unless|liftA1|apply|bind|discard|join|ifM|identity|whenM|unlessM|liftM1|ap|compose|otherwise|top|bottom|recip|eq|notEq|degree|div|mod|lcm|gcd|flip|const|map|void|flap|conj|disj|not|mempty|compare|min|max|comparing|clamp|between|sub|negate|append|add|zero|mul|one|show|unit|absurd)\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;
4 changes: 2 additions & 2 deletions tests/languages/purescript/string_feature.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"fo\"o"
"foo \
\ bar"
"foo -- comment \
"foo -- comment lookalike \
\ bar"

----------------------------------------------------
Expand All @@ -16,4 +16,4 @@

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

Checks for strings.
Checks for strings.

0 comments on commit 6e2da60

Please sign in to comment.