Skip to content

Commit

Permalink
Eiffel: Fix verbatim strings. Fix #1379
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Apr 7, 2018
1 parent 218f160 commit 04df41b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/prism-eiffel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ Prism.languages.eiffel = {
'string': [
// Aligned-verbatim-strings
{
pattern: /"([^[]*)\[[\s\S]+?\]\1"/,
pattern: /"([^[]*)\[[\s\S]*?\]\1"/,
greedy: true
},
// Non-aligned-verbatim-strings
{
pattern: /"([^{]*)\{[\s\S]+?\}\1"/,
pattern: /"([^{]*)\{[\s\S]*?\}\1"/,
greedy: true
},
// Single-line string
Expand Down
2 changes: 1 addition & 1 deletion components/prism-eiffel.min.js

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

4 changes: 4 additions & 0 deletions tests/languages/eiffel/string_feature.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
"foo%
%bar"

"[]"
"[fo"o
bar]"
"!-[fo"o[]
bar]!-"
"{}"
"{fo"o
bar}"
"*?{fo"o{}
Expand All @@ -19,8 +21,10 @@ bar}*?"
["string", "\"fo%\"o\""],
["string", "\"foo%\r\n%bar\""],

["string", "\"[]\""],
["string", "\"[fo\"o\r\nbar]\""],
["string", "\"!-[fo\"o[]\r\nbar]!-\""],
["string", "\"{}\""],
["string", "\"{fo\"o\r\nbar}\""],
["string", "\"*?{fo\"o{}\r\nbar}*?\""]
]
Expand Down

0 comments on commit 04df41b

Please sign in to comment.