File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -504,6 +504,8 @@ patterns are available:
504
504
505
505
- `pascal` suitable for source code in the Pascal/Delphi language.
506
506
507
+ - `perl` suitable for source code in the Perl language.
508
+
507
509
- `php` suitable for source code in the PHP language.
508
510
509
511
- `python` suitable for source code in the Python language.
Original file line number Diff line number Diff line change 32
32
33
33
sed ' s/beer\\/beer,\\/' < Beer.java > Beer-correct.java
34
34
35
- builtin_patterns=" bibtex cpp csharp fortran html java objc pascal php python ruby tex"
35
+ builtin_patterns=" bibtex cpp csharp fortran html java objc pascal perl php python ruby tex"
36
36
for p in $builtin_patterns
37
37
do
38
38
test_expect_success " builtin $p pattern compiles" '
Original file line number Diff line number Diff line change @@ -61,6 +61,23 @@ PATTERNS("pascal",
61
61
"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+"
62
62
"|<>|<=|>=|:=|\\.\\."
63
63
"|[^[:space:]]|[\x80-\xff]+" ),
64
+ PATTERNS ("perl" ,
65
+ "^[ \t]*package .*;\n"
66
+ "^[ \t]*sub .* \\{\n"
67
+ "^[A-Z]+ \\{\n" /* BEGIN, END, ... */
68
+ "^=head[0-9] " , /* POD */
69
+ /* -- */
70
+ "[[:alpha:]_'][[:alnum:]_']*"
71
+ "|0[xb]?[0-9a-fA-F_]*"
72
+ /* taking care not to interpret 3..5 as (3.)(.5) */
73
+ "|[0-9a-fA-F_]+(\\.[0-9a-fA-F_]+)?([eE][-+]?[0-9_]+)?"
74
+ "|=>|-[rwxoRWXOezsfdlpSugkbctTBMAC>]|~~|::"
75
+ "|&&=|\\|\\|=|//=|\\*\\*="
76
+ "|&&|\\|\\||//|\\+\\+|--|\\*\\*|\\.\\.\\.?"
77
+ "|[-+*/%.^&<>=!|]="
78
+ "|=~|!~"
79
+ "|<<|<>|<=>|>>"
80
+ "|[^[:space:]]" ),
64
81
PATTERNS ("php" ,
65
82
"^[\t ]*(((public|protected|private|static)[\t ]+)*function.*)$\n"
66
83
"^[\t ]*(class.*)$" ,
You can’t perform that action at this time.
0 commit comments