Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-1833

texttemplate: Add public `regexp` property to make this module flexible

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 2.6.0
    • General
    • None
    • All

    Description

      It would be nice to have a public regexp property in the texttemplate module, that's allow to specify any other matches.

      Right now, the texttemplate module supports only hard-coded template matches in a form like ${foo}. But this is useless when, e.g. we need to porting some CMake project to Qbs project.

      E..g. in CMake is useda following form @foo@, so, currently it it impossible to use the texttemplate module in this case.

      This module right now used the hard-coded regexp:

      var rex = /\${(\$|\w+)}/g;
      

      which can't be changed at all.

      So, I suggest to make this regex a public, like:

      Module {
          property var regex:  /\${(\$|\w+)}/g
      }
      

      which can be changed e.g. with:

      \@(\w+)\@
      

      or any other.

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            kuzulis Denis Shienkov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes