Skip to content
Snippets Groups Projects
  1. Mar 09, 2021
    • Mark OLESEN's avatar
      ENH: improvements for token methods · 51cd7cee
      Mark OLESEN authored
      - direct check of punctuation.
        For example,
      
            while (!tok.isPunctuation(token::BEGIN_LIST)) ..
      
        instead of
      
        while (!(tok.isPunctuation() && tok.pToken() == token::BEGIN_LIST)) ..
      
        Using direct comparison (tok != token::BEGIN_LIST) can be fragile
        when comparing int values:
      
            int c = readChar(is);
            while (tok != c) ..  // Danger, uses LABEL comparison!
      
      - direct check of word.
        For example,
      
            if (tok.isWord("uniform")) ..
      
        instead of
      
            if (tok.isWord() && tok.wordToken() == "uniform") ..
      
      - make token lineNumber() a setter method
      
      ENH: adjust internal compound method empty() -> moved()
      
      - support named compound tokens
      
      STYLE: setter method for stream indentation
      51cd7cee
  2. Nov 11, 2019
    • Mark OLESEN's avatar
      ENH: rationalize some string methods. · 7c1190f0
      Mark OLESEN authored
      - silently deprecate 'startsWith', 'endsWith' methods
        (added in 2016: 2b143606), in favour of
        'starts_with', 'ends_with' methods, corresponding to C++20 and
        allowing us to cull then in a few years.
      
      - handle single character versions of starts_with, ends_with.
      
      - add single character version of removeEnd and silently deprecate
        removeTrailing which did the same thing.
      
      - drop the const versions of removeRepeated, removeTrailing.
        Unused and with potential confusion.
      
      STYLE: use shrink_to_fit(), erase()
      7c1190f0
  3. Oct 31, 2019
  4. Oct 02, 2018