identifier method

void identifier(
  1. String identifier, {
  2. bool spaceBefore = true,
  3. bool spaceAfter = true,
})

Writes an identifier, escaping it if necessary.

Implementation

void identifier(String identifier,
    {bool spaceBefore = true, bool spaceAfter = true}) {
  if (isKeyword(identifier) || _notAKeywordRegex.hasMatch(identifier)) {
    identifier = escapeIdentifier(identifier);
  }

  symbol(identifier, spaceBefore: spaceBefore, spaceAfter: spaceAfter);
}