CloneSet87


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
42230.987SourceElements[3]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
145144
Closure/closure/goog/i18n/datetimeformat.js
242115
Closure/closure/goog/locale/datetimeformat.js
Clone Instance
1
Line Count
45
Source Line
144
Source File
Closure/closure/goog/i18n/datetimeformat.js

/**
 * regular expression pattern for parsing pattern string
 * @type {Array.<RegExp>}
 * @private
 */
goog.i18n.DateTimeFormat.TOKENS_=  [
  //quote string
  /^'(?:[^']|'')*'/,
  // pattern chars
  /^(?:G+|y+|M+|k+|S+|E+|a+|h+|K+|H+|c+|L+|Q+|d+|m+|s+|v+|z+|Z+)/,
  // and all the other chars
  /^[^'GyMkSEahKHcLQdmsvzZ]+/   // and all the other chars
                                   ];


/**
 * These are token types, corresponding to above token definitions.
 * @enum {number}
 * @private
 */
goog.i18n.DateTimeFormat.PartTypes_=  {
  QUOTED_STRING:  0,
  FIELD:  1,
  LITERAL:  2                         } ;



/**
 * Apply specified pattern to this formatter object.
 * @param {string} pattern String specifying how the date should be formatted.
 * @private
 */
goog.i18n.DateTimeFormat.prototype.applyPattern_=  function (pattern){
  // lex the pattern, once for all uses
  while (pattern) {
    for (var i=  0; i<  goog.i18n.DateTimeFormat.TOKENS_.length; ++i) {
      var m=  pattern.match(goog.i18n.DateTimeFormat.TOKENS_[i]);
      if (m) {
        var part=  m[0];
        pattern=  pattern.substring(part.length);
        if (i==  goog.i18n.DateTimeFormat.PartTypes_.QUOTED_STRING) {
          if (part==  "''") {
            part=  "'";  // '' -> '
                            }
          else   {
            part=  part.substring(1, part.length-  1); // strip quotes
            part=  part.replace(/''/,   "'");
                 }
                                                                    }
        this.patternParts_.push( { text: part, type: i } );
        break;
             }
                                                                      }
                  }
                                                                     } ;


Clone Instance
2
Line Count
42
Source Line
115
Source File
Closure/closure/goog/locale/datetimeformat.js

/**
 * regular expression pattern for parsing pattern string
 * @private
 */
goog.locale.DateTimeFormat.TOKENS_=  [
  //quote string
  /^'(?:[^']|'')*'/,
  // pattern chars
  /^(?:G+|y+|M+|k+|S+|E+|a+|h+|K+|H+|c+|L+|Q+|d+|m+|s+|v+|z+|Z+)/,
  // and all the other chars
  /^[^'GyMkSEahKHcLQdmsvzZ]+/   // and all the other chars
                                     ];

/**
 * These are token types, corresponding to above token definitions.
 * @enum {number}
 */
goog.locale.DateTimeFormat.PartTypes=  {
  QUOTED_STRING:  0,
  FIELD:  1,
  LITERAL:  2                          } ;


/**
 * Apply specified pattern to this formatter object.
 * @param {string} pattern String specifying how the date should be formatted.
 * @deprecated Use goog.i18n.DateTimeFormat.
 */
goog.locale.DateTimeFormat.prototype.applyPattern=  function (pattern){
  // lex the pattern, once for all uses
  while (pattern) {
    for (var i=  0; i<  goog.locale.DateTimeFormat.TOKENS_.length; ++i) {
      var m=  pattern.match(goog.locale.DateTimeFormat.TOKENS_[i]);
      if (m) {
        var part=  m[0];
        pattern=  pattern.substring(part.length);
        if (i==  goog.locale.DateTimeFormat.PartTypes.QUOTED_STRING) {
          if (part==  "''") {
            part=  "'";  // '' -> '
                            }
          else   {
            part=  part.substring(1, part.length-  1); // strip quotes
            part=  part.replace(/''/,   "'");
                 }
                                                                     }
        this.patternParts_.push( { text: part, type: i } );
        break;
             }
                                                                        }
                  }
                                                                      } ;


Clone AbstractionParameter Count: 3Parameter Bindings

/**
 * regular expression pattern for parsing pattern string
 * @private
 */
/**
 * regular expression pattern for parsing pattern string
 * @type {Array.<RegExp>}
 * @private
 */
goog. [[#variable5db07ea0]].DateTimeFormat.TOKENS_=[
                                                    //quote string
                                                    /^'(?:[^']|'')*'/,
                                                                      // pattern chars
                                                                      /^(?:G+|y+|M+|k+|S+|E+|a+|h+|K+|H+|c+|L+|Q+|d+|m+|s+|v+|z+|Z+)/,
                                                                                                                                      // and all the other chars
                                                                                                                                      /^[^'GyMkSEahKHcLQdmsvzZ]+/ // and all the other chars
                                                   ];
/**
 * These are token types, corresponding to above token definitions.
 * @enum {number}
 */
/**
 * These are token types, corresponding to above token definitions.
 * @enum {number}
 * @private
 */
goog. [[#variable5db07ea0]].DateTimeFormat. [[#variable5db07d80]]= {QUOTED_STRING: 0,
                                                                    FIELD: 1,
                                                                    LITERAL: 2 } ;
/**
 * Apply specified pattern to this formatter object.
 * @param {string} pattern String specifying how the date should be formatted.
 * @deprecated Use goog.i18n.DateTimeFormat.
 */
/**
 * Apply specified pattern to this formatter object.
 * @param {string} pattern String specifying how the date should be formatted.
 * @private
 */
goog. [[#variable5db07ea0]].DateTimeFormat.prototype. [[#variable5db07ce0]]= function (pattern)
                                                                             {
                                                                               // lex the pattern, once for all uses
                                                                               while (pattern)
                                                                                 { for (var i=0; i<goog. [[#variable5db07ea0]].DateTimeFormat.TOKENS_.length; ++i)
                                                                                     { var m=pattern.match(goog. [[#variable5db07ea0]].DateTimeFormat.TOKENS_[i]);
                                                                                       if (m)
                                                                                         { var part=m[0];
                                                                                           pattern=pattern.substring(part.length);
                                                                                           if (i==goog. [[#variable5db07ea0]].DateTimeFormat. [[#variable5db07d80]].QUOTED_STRING)
                                                                                             { if (part=="''")
                                                                                                 { part="'"; // '' -> '
                                                                                                 }
                                                                                               else
                                                                                                 { part=part.substring(1,part.length-1); // strip quotes
                                                                                                   part=part.replace(/''/,"'");
                                                                                                 }
                                                                                             }
                                                                                           this.patternParts_.push( {text:part,
                                                                                                                     type:i } );
                                                                                           break;
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             } ;
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#5db07ea0]]
locale 
12[[#5db07ea0]]
i18n 
21[[#5db07d80]]
PartTypes 
22[[#5db07d80]]
PartTypes_ 
31[[#5db07ce0]]
applyPattern 
32[[#5db07ce0]]
applyPattern_