emacsorphanage / dart-mode

An Emacs mode for the Dart language
GNU General Public License v3.0
15 stars 2 forks source link

How to fontify short words with all caps #97

Open bradyt opened 5 years ago

bradyt commented 5 years ago

It's not clear how to fontify short words in all caps. For example, LF, etc, in the following example. As contants, or types? At first I interpreted the style guide that some types may end up all caps. https://www.dartlang.org/guides/language/effective-dart/style#do-capitalize-acronyms-and-abbreviations-longer-than-two-letters-like-words. Maybe we can find clarification as examples are collected.

  /// Whether the character at the current position is a printable character
  /// other than whitespace.
  ///
  /// See http://yaml.org/spec/1.2/spec.html#nb-char.
  bool get _isNonSpace {
    var char = _scanner.peekChar();
    if (char == null) return false;
    switch (char) {
      case LF:
      case CR:
      case BOM:
      case SP:
        return false;
      case NEL:
        return true;
      default:
        return (char >= 0x00020 && char <= 0x00007E) ||
            (char >= 0x000A0 && char <= 0x00D7FF) ||
            (char >= 0x0E000 && char <= 0x00FFFD) ||
            (char >= 0x10000 && char <= 0x10FFFF);
    }
  }