PpWhitespace

Understands whitespacey things about source code character streams.

cpip.core.PpWhitespace.DEFINE_WHITESPACE = {'\n', '\t', ' '}

Whitespace characters that are significant in define statements ISO/IEC 14882:1998(E) 16-2 only ‘ ‘ and ‘t’ as ws

cpip.core.PpWhitespace.LEN_WHITESPACE_CHARACTER_SET = 5

Number of whitespace characters

cpip.core.PpWhitespace.LEX_NEWLINE = '\n'

Whitespace newline

cpip.core.PpWhitespace.LEX_WHITESPACE = {'\x0b', '\t', '\x0c', '\n', ' '}

Whitespace characters

class cpip.core.PpWhitespace.PpWhitespace

A class that does whitespacey type things in accordance with ISO/IEC 9899:1999(E) Section 6 and ISO/IEC 14882:1998(E).

hasLeadingWhitespace(theCharS)

Returns True if any leading whitespace, False if zero length or starts with non-whitespace.

isAllMacroWhitespace(theCharS)

“Return True if theCharS is zero length or only has allowable whitespace for preprocesing macros.

ISO/IEC 14882:1998(E) 16-2 only ‘ ‘ and ‘ ‘ as whitespace.

isAllWhitespace(theCharS)

Returns True if the supplied string is all whitespace.

isBreakingWhitespace(theCharS)

Returns True if whitespace leads theChars and that whitespace contains a newline.

preceedsNewline(theCharS)

Returns True if theChars ends with a newline. i.e. this immediately precedes a new line.

sliceNonWhitespace(theBuf, theOfs=0)

Returns the length of non-whitespace characters that are in theBuf from position theOfs.

sliceWhitespace(theBuf, theOfs=0)

Returns the length of whitespace characters that are in theBuf from position theOfs.