dil.lexer.Funcs

Members

Enums

CProperty
enum CProperty

Enumeration of character property flags.

Functions

char2ev
int char2ev(char c)
escapeNonPrintable
cstring escapeNonPrintable(cstring s)

Returns s with non-printable characters escaped.

escapeNonPrintable
cstring escapeNonPrintable(dchar c)

Returns an escape sequence if c is not printable.

escapeNonPrintable
size_t escapeNonPrintable(dchar c, char* p)

Writes an escape sequence to p if c is not printable. Returns the number of characters written.

hex2val
bool hex2val(ref Char c)

Converts c to its hexadecimal value. Returns false if c isn't a hex digit.

isAllSpace
bool isAllSpace(cchar* start, cchar* end)

Returns true if the string is empty or has only whitespace characters.

isEOF
bool isEOF(dchar c)
isEndOfLine
bool isEndOfLine(cchar* p)
isIdentifierStart
bool isIdentifierStart(cchar* p, cchar* end)

Returns true if p points to the start of a D identifier.

isNewline
bool isNewline(cchar* p)
isNewline
bool isNewline(dchar c)
isUnicodeNewline
bool isUnicodeNewline(cchar* p)
isUnicodeNewlineChar
bool isUnicodeNewlineChar(dchar d)
isalnum
int isalnum(char c)
isalpha
int isalpha(char c)
isascii
int isascii(uint c)
isdigi_
int isdigi_(char c)
isdigit
int isdigit(char c)
int isdigit(uint c)
ishexa_
int ishexa_(char c)
ishexad
int ishexad(char c)
int ishexad(uint c)
isidbeg
int isidbeg(char c)
int isidbeg(dchar c)
int isidbeg(uint c)
isident
int isident(char c)
int isident(uint c)
isoctal
int isoctal(char c)
isspace
int isspace(char c)
int isspace(uint c)
scanIdentifier
cstring scanIdentifier(ref cchar* ref_p, cchar* end)

Scans a D identifier.

scanNewline
bool scanNewline(ref cchar* p)

Scans a Newline and sets p one character past it.

scanNewline
bool scanNewline(ref cchar* p, cchar* end)

Scans a Newline and sets p one character past it.

scanNewlineReverse
bool scanNewlineReverse(cchar* begin, ref cchar* end)

Scans a Newline in reverse direction and sets end on the first character of the newline.

Static functions

castInt
size_t castInt(cstring s)

Casts a string to an integer at compile-time. Allows for fast string comparison using integers: *cast(uint*)"\xAA\xBB\xCC\xDD".ptr == castInt("\xAA\xBB\xCC\xDD")

Static variables

ptable
int ptable;

ASCII character properties table.

Variables

LS
char[3] LS;
LSd
dchar LSd;

Unicode line separator.

PS
char[3] PS;
PSd
dchar PSd;

Unicode paragraph separator.

_Z_
dchar _Z_;

Control+Z.

Meta

Authors

Aziz Köksal

License

GPL3 $(Maturity very high)