1<?php
2/********************************************************************************
3 * bibtex.php
4 * -----
5 * Author: Maïeul Rouquette from
6 * Quinn Taylor (quinntaylor@mac.com)
7 * Copyright: (c) 2009 Quinn Taylor (quinntaylor@mac.com), Nigel McNie (http://qbnz.com/highlighter)
8 * Release Version: 1.0.9.1
9 * Date Started: 2009/04/29
10 *
11 * BibLaTeX language file for GeSHi.
12 *
13 * CHANGES
14 * 2015/12/29 (1.0.8.13) Biblatex parser
15 * CHANGES
16 * -------
17 * 2009/04/29 (1.0.8.4)
18 *  -  First Release
19 *
20 * TODO
21 * -------------------------
22 *  - Add regex for matching and replacing URLs with corresponding hyperlinks
23 *  - Add regex for matching more LaTeX commands that may be embedded in BibTeX
24 *    (Someone who understands regex better than I should borrow from latex.php)
25 ********************************************************************************
26 *
27 *     This file is part of GeSHi.
28 *
29 *   GeSHi is free software; you can redistribute it and/or modify
30 *   it under the terms of the GNU General Public License as published by
31 *   the Free Software Foundation; either version 2 of the License, or
32 *   (at your option) any later version.
33 *
34 *   GeSHi is distributed in the hope that it will be useful,
35 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
36 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
37 *   GNU General Public License for more details.
38 *
39 *   You should have received a copy of the GNU General Public License
40 *   along with GeSHi; if not, write to the Free Software
41 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
42 *
43 *
44*******************************************************************************/
45
46// http://en.wikipedia.org/wiki/BibTeX
47// http://www.fb10.uni-bremen.de/anglistik/langpro/bibliographies/jacobsen-bibtex.html
48
49$language_data = array (
50    'LANG_NAME' => 'BibTeX',
51    'OOLANG' => false,
52    'COMMENT_SINGLE' => array(
53        1 => '%%'
54        ),
55    'COMMENT_MULTI' => array(),
56    'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
57    'QUOTEMARKS' => array(),
58    'ESCAPE_CHAR' => '',
59    'KEYWORDS' => array(
60        0 => array(
61            '@comment','@preamble','@string'
62            ),
63        // Standard entry types
64        1 => array(
65            '@article','@book','@booklet','@conference','@inbook',
66            '@incollection','@inproceedings','@manual','@mastersthesis',
67            '@misc','@phdthesis','@proceedings','@techreport','@unpublished'
68            ),
69        // Custom entry types
70        2 => array(
71            '@collection','@patent','@webpage'
72            ),
73        // Standard entry field names
74        3 => array(
75            'address','annote','author','booktitle','chapter','crossref',
76            'edition','editor','howpublished','institution','journal','key',
77            'month','note','number','organization','pages','publisher','school',
78            'series','title','type','volume','year',
79            ),
80        // Custom entry field names
81        4 => array(
82            'abstract','affiliation','chaptername','cited-by','cites',
83            'contents','copyright','date-added','date-modified','doi','eprint',
84            'isbn','issn','keywords','language','lccn','lib-congress',
85            'location','price','rating','read','size','source','url',
86            )
87        ),
88    'URLS' => array(
89        0 => '',
90        1 => '',
91        2 => '',
92        3 => '',
93        4 => ''
94        ),
95    'SYMBOLS' => array(
96        '{', '}', '#', '=', ','
97        ),
98    'CASE_SENSITIVE' => array(
99        1 => false,
100        2 => false,
101        3 => false,
102        4 => false,
103        GESHI_COMMENTS => false,
104        ),
105    // Define the colors for the groups listed above
106    'STYLES' => array(
107        'KEYWORDS' => array(
108            1 => 'color: #C02020;', // Standard entry types
109            2 => 'color: #C02020;', // Custom entry types
110            3 => 'color: #C08020;', // Standard entry field names
111            4 => 'color: #C08020;'  // Custom entry field names
112            ),
113        'COMMENTS' => array(
114            1 => 'color: #2C922C; font-style: italic;'
115            ),
116        'STRINGS' => array(
117            0 => 'color: #2020C0;'
118            ),
119        'SYMBOLS' => array(
120            0 =>  'color: #E02020;'
121            ),
122        'REGEXPS' => array(
123            1 => 'color: #2020C0;', // {...}
124            2 => 'color: #C08020;',  // BibDesk fields
125            3 => 'color: #800000;',   // LaTeX commands
126            4 => 'color: #C08020;', // Custom entry field (biblatex)
127            5 => 'color: #C02020;', // Custom entry types (biblatex)
128            ),
129        'ESCAPE_CHAR' => array(
130            0 =>  'color: #000000; font-weight: bold;'
131            ),
132        'BRACKETS' => array(
133            0 =>  'color: #E02020;'
134            ),
135        'NUMBERS' => array(
136            ),
137        'METHODS' => array(
138            ),
139        'SCRIPT' => array(
140            )
141        ),
142    'REGEXPS' => array(
143        // {parameters}
144        1 => array(
145            GESHI_SEARCH => "(?<=\\{)(?:\\{(?R)\\}|[^\\{\\}])*(?=\\})",
146            GESHI_REPLACE => '\0',
147            GESHI_MODIFIERS => 's',
148            GESHI_BEFORE => '',
149            GESHI_AFTER => ''
150            ),
151        2 => array(
152            GESHI_SEARCH => "\bBdsk-(File|Url)-\d+",
153            GESHI_REPLACE => '\0',
154            GESHI_MODIFIERS => 'Us',
155            GESHI_BEFORE => '',
156            GESHI_AFTER => ''
157            ),
158        3 => array(
159            GESHI_SEARCH => "\\\\[A-Za-z0-9]*+",
160            GESHI_REPLACE => '\0',
161            GESHI_MODIFIERS => 'Us',
162            GESHI_BEFORE => '',
163            GESHI_AFTER => ''
164            ),
165        4 => array(
166            GESHI_SEARCH => "([A-z]+)\s+=",
167            GESHI_REPLACE => '\0',
168            GESHI_MODIFIERS => 'Us',
169            GESHI_BEFORE => '',
170            GESHI_AFTER => ''
171            ),
172        5 => array(
173            GESHI_SEARCH => "@([A-z])+",
174            GESHI_REPLACE => '\0',
175            GESHI_MODIFIERS => '',
176            GESHI_BEFORE => '',
177            GESHI_AFTER => ''
178            ),
179        ),
180    'HIGHLIGHT_STRICT_BLOCK' => array(
181        ),
182    'OBJECT_SPLITTERS' => array(
183        ),
184    'STRICT_MODE_APPLIES' => GESHI_NEVER,
185    'SCRIPT_DELIMITERS' => array(
186        ),
187    'PARSER_CONTROL' => array(
188        'ENABLE_FLAGS' => array(
189            'NUMBERS' => GESHI_NEVER
190            ),
191        'KEYWORDS' => array(
192            3 => array(
193                'DISALLOWED_AFTER' => '(?=\s*=)'
194                ),
195            4 => array(
196                'DISALLOWED_AFTER' => '(?=\s*=)'
197                ),
198            )
199        )
200    );
201