xref: /OpenGrok/opengrok-indexer/src/main/jflex/analysis/lua/Lua.lexh (revision d219b4cea555a12b602d2d5518daa22134ad4879)
1*d219b4ceSAdam Hornacek/*
2*d219b4ceSAdam Hornacek * CDDL HEADER START
3*d219b4ceSAdam Hornacek *
4*d219b4ceSAdam Hornacek * The contents of this file are subject to the terms of the
5*d219b4ceSAdam Hornacek * Common Development and Distribution License (the "License").
6*d219b4ceSAdam Hornacek * You may not use this file except in compliance with the License.
7*d219b4ceSAdam Hornacek *
8*d219b4ceSAdam Hornacek * See LICENSE.txt included in this distribution for the specific
9*d219b4ceSAdam Hornacek * language governing permissions and limitations under the License.
10*d219b4ceSAdam Hornacek *
11*d219b4ceSAdam Hornacek * When distributing Covered Code, include this CDDL HEADER in each
12*d219b4ceSAdam Hornacek * file and include the License file at LICENSE.txt.
13*d219b4ceSAdam Hornacek * If applicable, add the following below this CDDL HEADER, with the
14*d219b4ceSAdam Hornacek * fields enclosed by brackets "[]" replaced with your own identifying
15*d219b4ceSAdam Hornacek * information: Portions Copyright [yyyy] [name of copyright owner]
16*d219b4ceSAdam Hornacek *
17*d219b4ceSAdam Hornacek * CDDL HEADER END
18*d219b4ceSAdam Hornacek */
19*d219b4ceSAdam Hornacek
20*d219b4ceSAdam Hornacek/*
21*d219b4ceSAdam Hornacek * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
22*d219b4ceSAdam Hornacek * Portions Copyright (c) 2017, Chris Fraire <cfraire@me.com>.
23*d219b4ceSAdam Hornacek */
24*d219b4ceSAdam Hornacek
25*d219b4ceSAdam Hornacek/*
26*d219b4ceSAdam Hornacek * Copyright © 1994–2017 Lua.org, PUC-Rio.
27*d219b4ceSAdam Hornacek *
28*d219b4ceSAdam Hornacek * Permission is hereby granted, free of charge, to any person obtaining a
29*d219b4ceSAdam Hornacek * copy of this software and associated documentation files (the "Software"),
30*d219b4ceSAdam Hornacek * to deal in the Software without restriction, including without limitation
31*d219b4ceSAdam Hornacek * the rights to use, copy, modify, merge, publish, distribute, sublicense,
32*d219b4ceSAdam Hornacek * and/or sell copies of the Software, and to permit persons to whom the
33*d219b4ceSAdam Hornacek * Software is furnished to do so, subject to the following conditions:
34*d219b4ceSAdam Hornacek *
35*d219b4ceSAdam Hornacek * The above copyright notice and this permission notice shall be included in
36*d219b4ceSAdam Hornacek * all copies or substantial portions of the Software.
37*d219b4ceSAdam Hornacek *
38*d219b4ceSAdam Hornacek * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39*d219b4ceSAdam Hornacek * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40*d219b4ceSAdam Hornacek * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
41*d219b4ceSAdam Hornacek * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
42*d219b4ceSAdam Hornacek * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
43*d219b4ceSAdam Hornacek * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
44*d219b4ceSAdam Hornacek * DEALINGS IN THE SOFTWARE.
45*d219b4ceSAdam Hornacek */
46*d219b4ceSAdam Hornacek
47*d219b4ceSAdam Hornacek/*
48*d219b4ceSAdam Hornacek * "Names (also called identifiers) in Lua can be any string of letters,
49*d219b4ceSAdam Hornacek * digits, and underscores, not beginning with a digit...."
50*d219b4ceSAdam Hornacek */
51*d219b4ceSAdam HornacekIdentifier = [\p{Letter}_] [\p{Letter}\p{Number}_]*
52*d219b4ceSAdam Hornacek
53*d219b4ceSAdam HornacekNumber = ([0][xX][0-9a-fA-F]+ | [0-9]+\.[0-9]+ |
54*d219b4ceSAdam Hornacek    [0-9][0-9_]*) ([eE][+-]?[0-9]+)?
55