1 <?php # vim:ts=2:sw=2:et:
2 /* For licensing and copyright terms, see the file named LICENSE */
4 class ShellLanguage extends HyperLanguage {
5 public function __construct() {
7 parent::NAME => 'Shell',
9 $this->setExtensions(array('sh'));
10 $this->setCaseInsensitive(false);
11 $this->addStates(array(
17 'keyword' => array('', 'operator'),
22 $this->addRules(array(
23 'string' => Rule::C_DOUBLEQUOTESTRING,
24 'char' => Rule::C_SINGLEQUOTESTRING,
25 'ticked' => "/\`(?:\\\`|.)*\`/sU",
29 'break', 'test', 'continue',
30 'else', 'for', 'then',
31 'if', 'in', 'case', 'esac', 'while',
32 'end', 'fi', 'until', 'return', 'elif', 'exit'
34 'operator' => '/[;&|!<>\[\]]|&&|\$\(\(|\$\(|\)\)|\)|\(\|\||<<|>>|=|==/',
36 'identifier' => Rule::C_IDENTIFIER,
38 $this->addMappings(array(