[QBS] syntactic sugar

Jan Krieger jan at jkrieger.de
Mon Feb 27 22:45:47 CET 2012


Hi!

I already proposed this in the blog, but will post it again here:

I think a bit of syntactic sugar would be good for qbs:
-  Depends { name: “Qt.core” }
   looks somehow uggly, why not simply write
    Depends: “Qt.core”
   and leave the extended syntax as the non-default alternative, if
   you need to specify something more general?
- the same for this construct:
    Group {
      condition: qbs.target == “windows”
      files: [
        "harddiskdeleter_win.cpp",
        "blowupmonitor_win.cpp",
        "setkeyboardonfire_win.cpp"
      ]
    }
   why not simply write:
    Group (condition: qbs.target == “windows”) {
      files: [
        "harddiskdeleter_win.cpp",
        "blowupmonitor_win.cpp",
        "setkeyboardonfire_win.cpp"
      ]
    }
- also (just to mention it again) somebody also already proposed to
   allow for string lists without delimiters for each entry, e.g.:
      files: @(
        harddiskdeleter_win.cpp,
        blowupmonitor_win.cpp,
        setkeyboardonfire_win.cpp,
        "but with whitespaces.cpp"
      ]
   this was taken from: https://bugreports.qt-project.org/browse/QBS-58

I’m sure there are more cases like that, but I think sugaring these 
cases might improve the acceptance and readability of qbs code.

BTW: Is there a definition of the QML syntax in the form of a Extended 
Backus–Naur Form (EBNF)  or something else, then we could make exact 
proposals for a changed syntax.

Best, JAN



More information about the Qbs mailing list