/** * Copyright 2017 Matt Acosta * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { PhpVersion } from './PhpVersion'; /** * A list of character codes. */ export declare const enum Character { Null = 0, Backspace = 8, Tab = 9, LineFeed = 10, VerticalTab = 11, FormFeed = 12, CarriageReturn = 13, Space = 32, Exclamation = 33, DoubleQuote = 34, Hash = 35, Dollar = 36, Percent = 37, Ampersand = 38, SingleQuote = 39, OpenParen = 40, CloseParen = 41, Asterisk = 42, Plus = 43, Comma = 44, Minus = 45, Period = 46, Slash = 47, _0 = 48, _1 = 49, _2 = 50, _3 = 51, _4 = 52, _5 = 53, _6 = 54, _7 = 55, _8 = 56, _9 = 57, Colon = 58, Semicolon = 59, LessThan = 60, Equal = 61, GreaterThan = 62, Question = 63, At = 64, A = 65, B = 66, C = 67, D = 68, E = 69, F = 70, G = 71, H = 72, I = 73, J = 74, K = 75, L = 76, M = 77, N = 78, O = 79, P = 80, Q = 81, R = 82, S = 83, T = 84, U = 85, V = 86, W = 87, X = 88, Y = 89, Z = 90, OpenBracket = 91, Backslash = 92, CloseBracket = 93, Caret = 94, Underscore = 95, BackQuote = 96, a = 97, b = 98, c = 99, d = 100, e = 101, f = 102, g = 103, h = 104, i = 105, j = 106, k = 107, l = 108, m = 109, n = 110, o = 111, p = 112, q = 113, r = 114, s = 115, t = 116, u = 117, v = 118, w = 119, x = 120, y = 121, z = 122, OpenBrace = 123, VerticalBar = 124, CloseBrace = 125, Tilde = 126, Delete = 127 } /** * Defines the language-specific characteristics of certain characters. */ export declare class CharacterInfo { /** * Determines if a character is a binary digit (0-1). */ static isBinDigit(ch: number): boolean; /** * Determines if a character is a digit (0-9). */ static isDigit(ch: number): boolean; /** * Determines if a character is a valid escape sequence in a double-quoted * string. The escape sequence may still be valid if it consists of multiple * characters however. */ static isDoubleQuoteEscape(ch: number): boolean; /** * Determines if a character is a hexadecimal digit (0-9, A-F). */ static isHexDigit(ch: number): boolean; /** * Determines if the character may be part of an identifier. * * This is similar to `isIdentifierStart()` but allows for digits. */ static isIdentifierPart(ch: number, languageVersion?: PhpVersion): boolean; /** * Determines if a character may start an identifier. */ static isIdentifierStart(ch: number, languageVersion?: PhpVersion): boolean; /** * Determines if a character is a line break (CR or LF). */ static isLineBreak(ch: number): boolean; /** * Determines if a character is an octal digit (0-7). */ static isOctDigit(ch: number): boolean; /** * Determines if a character is a valid escape sequence in a single-quoted * string. */ static isSingleQuoteEscape(ch: number): boolean; /** * Determines if a character is whitespace (but not a line break). */ static isWhitespace(ch: number): boolean; /** * Determines if a character is whitespace or a line break. */ static isWhitespaceLike(ch: number): boolean; }