Returns if the given string is a valid id for a reference.
static bool isId(String id) { if (id.isEmpty) return false; return id.codeUnits.every((int c) { return isIdChar(c); }); }