summaryrefslogtreecommitdiff
path: root/inc/geshi/bash.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/geshi/bash.php')
-rw-r--r--inc/geshi/bash.php45
1 files changed, 34 insertions, 11 deletions
diff --git a/inc/geshi/bash.php b/inc/geshi/bash.php
index 1dc64161e..b41f895ae 100644
--- a/inc/geshi/bash.php
+++ b/inc/geshi/bash.php
@@ -4,7 +4,7 @@
* --------
* Author: Andreas Gohr (andi@splitbrain.org)
* Copyright: (c) 2004 Andreas Gohr, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1\.0\.8
+ * Release Version: 1.0.8.3
* Date Started: 2004/08/20
*
* BASH language file for GeSHi.
@@ -63,11 +63,27 @@ $language_data = array (
//Variables
1 => "/\\$\\{[^\\n\\}]*?\\}/i",
//BASH-style Heredoc
- 2 => '/<<-?\s*?([\'"]?)([a-zA-Z0-9]+)\1;[^\n]*?\\n.*\\n\\2(?![a-zA-Z0-9])/siU'
+ 2 => '/<<-?\s*?(\'?)([a-zA-Z0-9]+)\1\\n.*\\n\\2(?![a-zA-Z0-9])/siU',
+ //Escaped String Starters
+ 3 => "/\\\\['\"]/siU"
),
'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
+ 'QUOTEMARKS' => array('"'),
+ 'HARDQUOTE' => array("'", "'"),
+ 'HARDESCAPE' => array("\'"),
+ 'ESCAPE_CHAR' => '',
+ 'ESCAPE_REGEXP' => array(
+ //Simple Single Char Escapes
+ 1 => "#\\\\[nfrtv\\$\\\"\n]#i",
+ // $var
+ 2 => "#\\$[a-z_][a-z0-9_]*#i",
+ // ${...}
+ 3 => "/\\$\\{[^\\n\\}]*?\\}/i",
+ // $(...)
+ 4 => "/\\$\\([^\\n\\)]*?\\)/i",
+ // `...`
+ 5 => "/`[^`]*`/"
+ ),
'KEYWORDS' => array(
1 => array(
'case', 'do', 'done', 'elif', 'else', 'esac', 'fi', 'for', 'function',
@@ -190,16 +206,23 @@ $language_data = array (
'COMMENTS' => array(
0 => 'color: #666666; font-style: italic;',
1 => 'color: #800000;',
- 2 => 'color: #cc0000; font-style: italic;'
+ 2 => 'color: #cc0000; font-style: italic;',
+ 3 => 'color: #000000; font-weight: bold;'
),
'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
+ 1 => 'color: #000099; font-weight: bold;',
+ 2 => 'color: #007800;',
+ 3 => 'color: #007800;',
+ 4 => 'color: #007800;',
+ 5 => 'color: #780078;',
+ 'HARD' => 'color: #000099; font-weight: bold;'
),
'BRACKETS' => array(
0 => 'color: #7a0874; font-weight: bold;'
),
'STRINGS' => array(
- 0 => 'color: #ff0000;'
+ 0 => 'color: #ff0000;',
+ 'HARD' => 'color: #ff0000;'
),
'NUMBERS' => array(
0 => 'color: #000000;'
@@ -233,11 +256,11 @@ $language_data = array (
//Variables without braces
1 => "\\$[a-zA-Z_][a-zA-Z0-9_]*",
//Variable assignment
- 2 => "(?<![\.a-zA-Z_])([a-zA-Z_][a-zA-Z0-9_]*?)(?==)",
+ 2 => "(?<![\.a-zA-Z_\-])([a-zA-Z_][a-zA-Z0-9_]*?)(?==)",
//Shorthand shell variables
4 => "\\$[*#\$\\-\\?!]",
//Parameters of commands
- 5 => "(?<=\s)-[0-9a-zA-Z\-]+(?=[\s=]|$)"
+ 5 => "(?<=\s)--?[0-9a-zA-Z\-]+(?=[\s=]|$)"
),
'STRICT_MODE_APPLIES' => GESHI_NEVER,
'SCRIPT_DELIMITERS' => array(
@@ -251,9 +274,9 @@ $language_data = array (
),
'KEYWORDS' => array(
'DISALLOWED_BEFORE' => "(?<![\.\-a-zA-Z0-9_\$\#])",
- 'DISALLOWED_AFTER' => "(?![\.\-a-zA-Z0-9_%])"
+ 'DISALLOWED_AFTER' => "(?![\.\-a-zA-Z0-9_%\\/])"
)
)
);
-?>
+?> \ No newline at end of file