Skip to content

Commit

Permalink
Fortran: more bullet-proof pattern for comments inside strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Jul 18, 2015
1 parent fa286aa commit 40ae215
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions components/prism-fortran.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ Prism.languages.fortran = {
alias: 'number'
},
'string': {
pattern: /(?:\w+_)?(['"])(?:\1\1|&\n(?:\s*!.+\n)?|(?!\1).)*(?:\1|&)/,
pattern: /(?:\w+_)?(['"])(?:\1\1|&(?:\r\n?|\n)(?:\s*!.+(?:\r\n?|\n))?|(?!\1).)*(?:\1|&)/,
inside: {
'comment': /!.*/
'comment': {
pattern: /(&(?:\r\n?|\n)\s*)!.*/,
lookbehind: true
}
}
},
'comment': /!.*/,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-fortran.min.js

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

0 comments on commit 40ae215

Please sign in to comment.