Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

78 lines (55 sloc) 1.909 kB
#-----------------------------------------------------------------
# Rules for use
#-----------------------------------------------------------------
token_use: /\buse\s/ use_stuff /[;}]/
{ $return=$item{use_stuff} }
use_stuff: (base | parent | version | module)
base: "base" import_list
parent: "parent" import_list
{ $return='parent'; $return.=' '.$item[2] if $item[2] !~ /^\s*-norequire\b/; }
module: module_name module_more
{ $return=$item{module_name} }
module_name: /[\w:]+/
module_more: eos | version(?) var(?) import_list(?)
#-----------------------------------------------------------------
# Rules for require
#-----------------------------------------------------------------
token_require: /\brequire\s/ require_stuff /[;}]/
{ $return=$item{require_stuff} }
require_stuff: (version | require_name | module)
require_name: <perl_quotelike>
{ my $name=$item[1][2];
return 1 if ($name=~/\.pl$/);
$name=~s(/)(::)g;
$name=~s/\.pm//;
$return=$name;
}
#-----------------------------------------------------------------
# Rules for no
#-----------------------------------------------------------------
token_no: /\bno\s/ no_stuff /[;}]/
{ $return=$item{no_stuff} }
no_stuff: (base | version | module)
#-----------------------------------------------------------------
# General Rules
#-----------------------------------------------------------------
version: /v?[\d\._]+/
eos: { $text=~/^[\s;]+$/ ? 1 : undef;}
var: /\$[\w+]/
import_list: /[(]?/
list_item
comma_list_item(s?)
/[)]?/
{ $return=$item[2];
$return.=" ".join(" ",@{$item[3]}) if $item[3];
}
|
/[(]\s*[)]/ { $return='' }
list_item: <perl_quotelike> { $return=$item[1][2] }
|
<perl_codeblock (){}[]> { $return=$item[1] }
|
/-?\w+/ { $return=$item[1] }
comma_list_item: comma list_item
{ $return=$item{list_item} }
comma: (',' | '=>')
Jump to Line
Something went wrong with that request. Please try again.