================================================================================
Compatibility semicolon
================================================================================

// qtdeclarative/tests/auto/qml/qqmlecmascript/data/compatibilitySemicolon.qml
QtObject {
    function code() {
        // Not correct according to ECMA 5.1, but JSC and V8 accept the following:
        do {
            ;
        } while (false) true
    }
}

--------------------------------------------------------------------------------

(program
  (comment)
  (ui_object_definition
    (identifier)
    (ui_object_initializer
      (function_declaration
        (identifier)
        (formal_parameters)
        (statement_block
          (comment)
          (do_statement
            (statement_block
              (empty_statement))
            (parenthesized_expression
              (false)))
          (expression_statement
            (true)))))))

================================================================================
Semicolon after array/object binding in property declaration
================================================================================

// qtdeclarative/tests/auto/qml/qqmlecmascript/data/semicolonAfterProperty.qml
QtObject {
    property var field: {"key": "value"};
    property list<QtObject> mylist: [
        QtObject {id: a},
        QtObject {id: b}
    ];
    property var object: QtObject {};
}

--------------------------------------------------------------------------------

(program
  (comment)
  (ui_object_definition
    (identifier)
    (ui_object_initializer
      (ui_property
        (type_identifier)
        (identifier)
        (expression_statement
          (object
            (pair
              (string
                (string_fragment))
              (string
                (string_fragment))))))
      (ui_property
        (ui_list_property_type
          (type_identifier)
          (type_identifier))
        (identifier)
        (ui_object_array
          (ui_object_definition
            (identifier)
            (ui_object_initializer
              (ui_binding
                (identifier)
                (expression_statement
                  (identifier)))))
          (ui_object_definition
            (identifier)
            (ui_object_initializer
              (ui_binding
                (identifier)
                (expression_statement
                  (identifier)))))))
      (ui_property
        (type_identifier)
        (identifier)
        (ui_object_definition
          (identifier)
          (ui_object_initializer))))))

================================================================================
Semicolon after array/object binding is not allowed
================================================================================

QtObject {
    object: QtObject {};
    array: [QtObject {}];
}

--------------------------------------------------------------------------------

(program
  (ui_object_definition
    (identifier)
    (ui_object_initializer
      (ui_binding
        (identifier)
        (ui_object_definition
          (identifier)
          (ui_object_initializer)))
      (ERROR)
      (ui_binding
        (identifier)
        (ui_object_array
          (ui_object_definition
            (identifier)
            (ui_object_initializer))))
      (ERROR))))

================================================================================
Multi-line string literal
================================================================================

// qtdeclarative/tests/auto/qml/qmllint/data/multilineString.qml
// qtdeclarative/tests/auto/qml/qqmlecmascript/data/rewriteMultiLineStrings.qml
QtObject {
    property string multipart: "Hello
world"

    Component.onCompleted: {
        multipart = 'Hello
world' + '!';
    }
}

--------------------------------------------------------------------------------

(program
  (comment)
  (comment)
  (ui_object_definition
    (identifier)
    (ui_object_initializer
      (ui_property
        (type_identifier)
        (identifier)
        (expression_statement
          (string
            (string_fragment))))
      (ui_binding
        (nested_identifier
          (identifier)
          (identifier))
        (statement_block
          (expression_statement
            (assignment_expression
              (identifier)
              (binary_expression
                (string
                  (string_fragment))
                (string
                  (string_fragment))))))))))

================================================================================
Weird object pattern
================================================================================

// Found in
// qtdeclarative/tests/auto/quickcontrols/controls/data/tst_scrollbar.qml
//
// This appears not accepted by Chrome/Firefox, but QML parser doesn't report
// any error.
Control {
    id: control
    function func() {
        var p0 = { x = control.leftPadding, y = control.height/2 };
    }
}

--------------------------------------------------------------------------------

(program
  (comment)
  (comment)
  (comment)
  (comment)
  (comment)
  (ui_object_definition
    (identifier)
    (ui_object_initializer
      (ui_binding
        (identifier)
        (expression_statement
          (identifier)))
      (function_declaration
        (identifier)
        (formal_parameters)
        (statement_block
          (variable_declaration
            (variable_declarator
              (identifier))
            (ERROR
              (object_pattern
                (object_assignment_pattern
                  (shorthand_property_identifier_pattern)
                  (member_expression
                    (identifier)
                    (property_identifier)))
                (object_assignment_pattern
                  (shorthand_property_identifier_pattern)
                  (binary_expression
                    (member_expression
                      (identifier)
                      (property_identifier))
                    (number)))))))))))
