Skip to content

Commit

Permalink
[perl mode] Upgrade to 0.09
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Oct 16, 2011
1 parent 2d307e2 commit 064283f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 12 additions & 2 deletions mode/perl/index.html
Expand Up @@ -13,8 +13,6 @@
<h1>CodeMirror 2: Perl mode</h1>

<div><textarea id="code" name="code">
// Demo code

#!/usr/bin/perl

use Something qw(func1 func2);
Expand All @@ -23,7 +21,19 @@ <h1>CodeMirror 2: Perl mode</h1>
my $s1 = qq'single line';
our $s2 = q(multi-
line);

=item Something
Example.
=cut

my $html=<<'HTML'
<html>
<title>hi!</title>
</html>
HTML

print "first,".join(',', 'second', qq~third~);

if($s1 =~ m[(?<!\s)(l.ne)\z]o) {
$h->{$1}=$$.' predefined variables';
$s2 =~ s/\-line//ox;
Expand Down
4 changes: 3 additions & 1 deletion mode/perl/perl.js
@@ -1,4 +1,4 @@
// CodeMirror2 mode/perl/perl.js (text/x-perl) beta 0.08 (2011-10-11)
// CodeMirror2 mode/perl/perl.js (text/x-perl) beta 0.09 (2011-10-15)
// This is a part of CodeMirror from https://github.com/sabaca/CodeMirror_mode_perl (mail@sabaca.com)
CodeMirror.defineMode("perl",function(config,parserConfig){
// http://perldoc.perl.org
Expand Down Expand Up @@ -505,6 +505,8 @@ CodeMirror.defineMode("perl",function(config,parserConfig){
if(stream.match(/^<<(?=\w)/)){ // NOTE: <<SOMETHING\n...\nSOMETHING\n
stream.eatWhile(/\w/);
return tokenSOMETHING(stream,state,stream.current().substr(2))}
if(stream.sol()&&stream.match(/^\=item(?!\w)/)){// NOTE: \n=item...\n=cut\n
return tokenSOMETHING(stream,state,'=cut')}
var ch=stream.next();
if(ch=='"'||ch=="'"){ // NOTE: ' or " or <<'SOMETHING'\n...\nSOMETHING\n or <<"SOMETHING"\n...\nSOMETHING\n
if(stream.prefix(3)=="<<"+ch){
Expand Down

0 comments on commit 064283f

Please sign in to comment.