<commit_before>/*
 * Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
 * for details. All rights reserved. Use of this source code is governed by a
 * BSD-style license that can be found in the LICENSE file.
 */
/**
 * @assertion A cascaded method invocation has the form e..suffix where suffix is a sequence
 * of operator, method, getter or setter invocations.
 * cascadeSection:
 * '..'  (cascadeSelector arguments*)(assignableSelector arguments*)* (assignmentOperator expressionWithoutCascade)?
 * ;
 * cascadeSelector:
 *  '[ ' expression '] '
 *  | identifier
 * ;
 * @description Checks that various correct cascaded invocations
 * do not produce compile-time errors.
 * @author msyabro
 * @reviewer iefremov
 */

class C {
  m1() {}
  m2(p1, p2) {}
  m3(p1, [p2]) {}

  operator+(other) {}
  operator negate() {}
  operator[](index) {}
  operator[]=(index, value) {}
  operator call(p1, p2, p3) {}

  get x() {}
  get y() {}

  set x(v) {}
  set y(v) {}

  static statMethod() {}
  static var statVar;
}

main() {
  var o = new C();

  //instance methods
  o..m1();
  o..m2(1, 1);
  o..m3(1, p2: 1);

  o..m1()..m2(1, 1)..m3(1);
  o..m2(0, 0)..m3(0, 1);
  o..m1()..m1()..m1();

  //getters
  o..x..y;
  o..x;
  o..x..x..x;

  //setters
  o..x = 1;
  o..x = 1..y = 2;
  o..x = 1..x = 'string'..x = [1, 2, 3];

  //operators
//  o..+ 1..+ 2..+ 3;
//  o..negate()..-; //Can one invoke negate as an unary minus here?
//  o..(null, null, null)..call(1, 2, 3);
  o..(null, null, null);

  o..[1]..[2];
  o..[1] = 1..[2] = 2;
//  o.. + 1 .. [2] .. [3] = 3 .. negate() .. ([], {}, []);

  //static fields
  o..statMethod();
  o..statVar;
  o..statMethod()..statVar..statMethod();

  o.. m1() .. + 2 .. [1] .. y = x .. statVar .. x .. m2(1, 2);

}<commit_msg>Fixing a wrong test (issue 155)<commit_after>/*
 * Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
 * for details. All rights reserved. Use of this source code is governed by a
 * BSD-style license that can be found in the LICENSE file.
 */
/**
 * @assertion A cascaded method invocation has the form e..suffix where suffix is a sequence
 * of operator, method, getter or setter invocations.
 * cascadeSection:
 * '..'  (cascadeSelector arguments*)(assignableSelector arguments*)* (assignmentOperator expressionWithoutCascade)?
 * ;
 * cascadeSelector:
 *  '[ ' expression '] '
 *  | identifier
 * ;
 * @description Checks that various correct cascaded invocations
 * do not produce compile-time errors.
 * @author msyabro
 * @reviewer iefremov
 */

class C {
  m1() {}
  m2(p1, p2) {}
  m3(p1, [p2]) {}

  operator+(other) {}
  operator negate() {}
  operator[](index) {}
  operator[]=(index, value) {}

  get x() {}
  get y() {}

  set x(v) {}
  set y(v) {}

  static statMethod() {}
  static var statVar;
}

main() {
  var o = new C();

  //instance methods
  o..m1();
  o..m2(1, 1);
  o..m3(1, p2: 1);

  o..m1()..m2(1, 1)..m3(1);
  o..m2(0, 0)..m3(0, 1);
  o..m1()..m1()..m1();

  //getters
  o..x..y;
  o..x;
  o..x..x..x;

  //setters
  o..x = 1;
  o..x = 1..y = 2;
  o..x = 1..x = 'string'..x = [1, 2, 3];

  o..[1]..[2];
  o..[1] = 1..[2] = 2;

  //static fields
  o..statMethod();
  o..statVar;
  o..statMethod()..statVar..statMethod();

  o.. m1() .. [1] .. y = o .. statVar .. x .. m2(1, 2);
}
{'fraction_non_alphanumeric': 0.2132086851628468, 'fraction_numerical': 0.036489746682750304, 'mean_word_length': 2.4516129032258065, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2408666', 'n_tokens_mistral': 1395, 'n_tokens_neox': 1300, 'n_words': 363}