Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-138051

Explore if "Tokenized" SourceLocation-s flat array / map might be helpful

    XMLWordPrintable

Details

    Description

      While working on the AST node for property and attributes, and observing the way we work with FileLocationRegions, where there is a repetition of multiple enum-s, which are essentially a "subset" of Tokens.. 

      soo high level idea is to have a generic class, where mapped container storing SourceLocations can be either flatmap (more useful for FileLocations::Info) OR array (where the size is small and known beforehand, like AST::Nodes)
      which can be constructed based on the set of tokens

      let's say {T_DEFAULT, T_FINAL, T_READONLY} , where each of the tokens have different values will be mapped to the array indices.
      In case with map it's pretty simple it's just flatmap<TOKEN, SourceLocation> However with the array, where it would be nice to have accesss like arr[T_DEFAULT] and arr[T_READONLY] this is more complicated and requires more attentive boundary checking. However such container might potentially be used in many places

      So the first step will anyway be gathering some data and trying to figure out how beneficial this could be     

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtqmlteam Qt Qml Team User
            dima.a Dmitrii Akshintsev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes