Home
last modified time | relevance | path

Searched refs:tokenize (Results 1 - 25 of 104) sorted by relevance

12345

/third_party/python/Tools/peg_generator/pegen/
H A Dtokenizer.py2 import tokenize namespace
10 def shorttok(tok: tokenize.TokenInfo) -> str:
15 """Caching wrapper for the tokenize module.
20 _tokens: List[tokenize.TokenInfo]
23 self, tokengen: Iterator[tokenize.TokenInfo], *, path: str = "", verbose: bool = False
34 def getnext(self) -> tokenize.TokenInfo:
43 def peek(self) -> tokenize.TokenInfo:
47 if tok.type in (tokenize.NL, tokenize.COMMENT):
62 def diagnose(self) -> tokenize
[all...]
H A Dparser.py5 import tokenize namespace
187 def name(self) -> Optional[tokenize.TokenInfo]:
194 def number(self) -> Optional[tokenize.TokenInfo]:
201 def string(self) -> Optional[tokenize.TokenInfo]:
208 def op(self) -> Optional[tokenize.TokenInfo]:
215 def type_comment(self) -> Optional[tokenize.TokenInfo]:
222 def soft_keyword(self) -> Optional[tokenize.TokenInfo]:
229 def expect(self, type: str) -> Optional[tokenize.TokenInfo]:
243 def expect_forced(self, res: Any, expectation: str) -> Optional[tokenize.TokenInfo]:
293 tokengen = tokenize
[all...]
/third_party/googletest/googlemock/scripts/generator/cpp/
H A Dast.py44 from cpp import tokenize namespace
549 if parts[-1].token_type == tokenize.NAME:
579 if (type_name and type_name[-1].token_type == tokenize.NAME and
580 p.token_type == tokenize.NAME):
581 type_name.append(tokenize.Token(tokenize.SYNTAX, ' ', 0, 0))
749 if token.token_type == tokenize.NAME:
768 if next.token_type == tokenize.SYNTAX and next.name == '(':
773 syntax = tokenize.SYNTAX
783 new_temp = self._GetTokensUpTo(tokenize
[all...]
/third_party/python/Tools/i18n/
H A Dpygettext.py35 Enter pygettext, which uses Python's standard tokenize module to scan
167 import tokenize namespace
340 if ttype == tokenize.STRING and is_literal_string(tstring):
344 if ttype in (tokenize.COMMENT, tokenize.NL, tokenize.ENCODING):
348 if ttype == tokenize.NAME and tstring in ('class', 'def'):
351 if ttype == tokenize.NAME and tstring in opts.keywords:
354 if ttype == tokenize.STRING:
408 if ttype == tokenize
[all...]
/third_party/vk-gl-cts/framework/randomshaders/
H A DrsgExpression.hpp57 virtual void tokenize (GeneratorState& state, TokenStream& str) const = DE_NULL;
74 void tokenize (GeneratorState& state, TokenStream& str) const { DE_UNREF(state); str << Token(m_variable->getName()); } in tokenize() function in rsg::VariableAccess
114 void tokenize (GeneratorState& state, TokenStream& str) const;
132 void tokenize (GeneratorState& state, TokenStream& str) const;
151 void tokenize (GeneratorState& state, TokenStream& str) const;
169 void tokenize (GeneratorState& state, TokenStream& str) const;
191 void tokenize (GeneratorState& state, TokenStream& str) const;
216 void tokenize (GeneratorState& state, TokenStream& str) const;
236 void tokenize (GeneratorState& state, TokenStream& str) const;
258 void tokenize (GeneratorStat
[all...]
H A DrsgStatement.cpp203 void BlockStatement::tokenize (GeneratorState& state, TokenStream& str) const in tokenize() function in rsg::BlockStatement
208 (*i)->tokenize(state, str); in tokenize()
219 void ExpressionStatement::tokenize (GeneratorState& state, TokenStream& str) const in tokenize() function in rsg::ExpressionStatement
222 m_expression->tokenize(state, str); in tokenize()
332 void DeclarationStatement::tokenize (GeneratorState& state, TokenStream& str) const in tokenize() function in rsg::DeclarationStatement
339 m_expression->tokenize(state, str); in tokenize()
455 void ConditionalStatement::tokenize (GeneratorState& state, TokenStream& str) const in tokenize() function in rsg::ConditionalStatement
461 m_condition->tokenize(state, str); in tokenize()
468 m_trueStatement->tokenize(state, str); in tokenize()
472 m_trueStatement->tokenize(stat in tokenize()
555 void AssignStatement::tokenize (GeneratorState& state, TokenStream& str) const tokenize() function in rsg::AssignStatement
[all...]
H A DrsgShader.cpp93 void Shader::tokenize (GeneratorState& state, TokenStream& str) const in tokenize() function in rsg::Shader
101 m_globalStatements[ndx]->tokenize(state, str); in tokenize()
107 m_functions[ndx]->tokenize(state, str); in tokenize()
112 m_mainFunction.tokenize(state, str); in tokenize()
125 void Function::tokenize (GeneratorState& state, TokenStream& str) const in tokenize() function in rsg::Function
147 m_functionBlock.tokenize(state, str); in tokenize()
H A DrsgStatement.hpp44 virtual void tokenize (GeneratorState& state, TokenStream& str) const = DE_NULL;
62 void tokenize (GeneratorState& state, TokenStream& str) const;
78 void tokenize (GeneratorState& state, TokenStream& str) const;
98 void tokenize (GeneratorState& state, TokenStream& str) const;
119 void tokenize (GeneratorState& state, TokenStream& str) const;
145 void tokenize (GeneratorState& state, TokenStream& str) const;
/third_party/typescript/tests/baselines/reference/
H A DarrayAssignmentTest5.js19 tokenize(line:string, state:IState, includeStates:boolean):ILineTokens;
23 var lineTokens:ILineTokens= this.tokenize(line, state, true);
29 public tokenize(line:string, state:IState, includeStates:boolean):ILineTokens {
43 var lineTokens = this.tokenize(line, state, true);
49 Bug.prototype.tokenize = function (line, state, includeStates) {
H A DarrayAssignmentTest6.js13 tokenize(line:string, state:IState, includeStates:boolean):ILineTokens;
16 public tokenize(line:string, tokens:IToken[], includeStates:boolean):ILineTokens {
29 Bug.prototype.tokenize = function (line, tokens, includeStates) {
/third_party/python/Tools/scripts/
H A Dcleanfuture.py42 import tokenize namespace
144 # Line-getter for tokenize.
156 STRING = tokenize.STRING
157 NL = tokenize.NL
158 NEWLINE = tokenize.NEWLINE
159 COMMENT = tokenize.COMMENT
160 NAME = tokenize.NAME
161 OP = tokenize.OP
164 get = tokenize.generate_tokens(self.getline).__next__
183 startline = srow - 1 # tokenize i
[all...]
H A Dhighlight.py11 import tokenize namespace
35 tok_type = tokenize.COMMENT
37 for tok in tokenize.generate_tokens(readline):
41 if tok_type == tokenize.COMMENT:
43 elif tok_type == tokenize.OP and tok_str[:1] not in '{}[](),.:;@':
45 elif tok_type == tokenize.STRING:
47 if prev_tok_type == tokenize.INDENT or scol==0:
49 elif tok_type == tokenize.NAME:
H A Dreindent.py46 import tokenize namespace
122 encoding, _ = tokenize.detect_encoding(f.readline)
184 # that we can use tokenize's 1-based line numbering easily.
193 # signal that tokenize doesn't know what to do about them;
202 tokens = tokenize.generate_tokens(self.getline)
275 # Line-getter for tokenize.
284 # Line-eater for tokenize.
286 INDENT=tokenize.INDENT,
287 DEDENT=tokenize.DEDENT,
288 NEWLINE=tokenize
[all...]
H A Duntabify.py8 import tokenize namespace
30 with tokenize.open(filename) as f:
H A Dgenerate_opcode_h.py4 import tokenize namespace
75 if hasattr(tokenize, 'open'):
76 fp = tokenize.open(opcode_py) # Python 3.2+
H A Dfinddiv.py21 import tokenize namespace
59 g = tokenize.generate_tokens(fp.readline)
/third_party/python/Lib/
H A Dtabnanny.py25 import tokenize namespace
96 f = tokenize.open(file)
105 process_tokens(tokenize.generate_tokens(f.readline))
107 except tokenize.TokenError as msg:
276 INDENT = tokenize.INDENT
277 DEDENT = tokenize.DEDENT
278 NEWLINE = tokenize.NEWLINE
279 JUNK = tokenize.COMMENT, tokenize.NL
/third_party/python/Lib/lib2to3/pgen2/
H A Ddriver.py26 from . import grammar, parse, token, tokenize, pgen namespace
40 # XXX Move the prefix computation into a wrapper around tokenize.
59 if type in (tokenize.COMMENT, tokenize.NL):
88 tokens = tokenize.generate_tokens(stream.readline)
102 tokens = tokenize.generate_tokens(io.StringIO(text).readline)
/third_party/node/deps/acorn/acorn/dist/
H A Dbin.js26 var inputFilePaths = [], forceFileName = false, fileMode = false, silent = false, compact = false, tokenize = false;
32 print(" [--tokenize] [--locations] [--allow-hash-bang] [--allow-await-outside-function] [--compact] [--silent] [--module] [--help] [--] [<infile>...]");
49 else if (arg === "--tokenize") { tokenize = true; }
65 if (!tokenize) {
/third_party/skia/third_party/externals/swiftshader/third_party/subzero/src/
H A DIceRangeSpec.cpp51 auto Tokens = RangeSpec::tokenize(Token, RangeSpec::DELIM_RANGE); in getRange()
97 std::vector<std::string> RangeSpec::tokenize(const std::string &Spec, in tokenize() function in Ice::RangeSpec
115 auto Tokens = tokenize(Spec, DELIM_LIST); in init()
/third_party/python/Lib/idlelib/
H A Drunscript.py15 import tokenize namespace
63 with tokenize.open(filename) as f:
65 tabnanny.process_tokens(tokenize.generate_tokens(f.readline))
66 except tokenize.TokenError as msg:
/third_party/python/Programs/
H A Dfreeze_test_frozenmain.py2 import tokenize namespace
25 with tokenize.open(filename) as source_fp:
/third_party/node/deps/npm/node_modules/diff/lib/diff/
H A Dbase.js47 oldString = this.removeEmpty(this.tokenize(oldString));
48 newString = this.removeEmpty(this.tokenize(newString));
281 tokenize: function tokenize(value) {
H A Djson.js46 jsonDiff.tokenize =
54 .tokenize;
/third_party/node/deps/npm/node_modules/diff/dist/
H A Ddiff.min.js1 !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).Diff={})}(this,function(e){"use strict";function t(){}t.prototype={diff:function(s,a,e){var n,t=2<arguments.length&&void 0!==e?e:{},r=t.callback;"function"==typeof t&&(r=t,t={}),this.options=t;var u=this;function d(e){return r?(setTimeout(function(){r(void 0,e)},0),!0):e}s=this.castInput(s),a=this.castInput(a),s=this.removeEmpty(this.tokenize(s));var f=(a=this.removeEmpty(this.tokenize(a))).length,c=s.length,p=1,i=f+c;t.maxEditLength&&(i=Math.min(i,t.maxEditLength));var o=null!==(n=t.timeout)&&void 0!==n?n:1/0,l=Date.now()+o,h=[{oldPos:-1,lastComponent:void 0}],v=this.extractCommon(h[0],a,s,0);if(h[0].oldPos+1>=c&&f<=v+1)return d([{value:this.join(a),count:a.length}]);var m=-1/0,g=1/0;function w(){for(var e=Math.max(m,-p);e<=Math.min(g,p);e+=2){var n=void 0,t=h[e-1],r=h[e+1];t&&(h[e-1]=void 0);var i,o=!1;r&&(i=r.oldPos-e,o=r&&0<=i&&i<f);var l=t&&t.oldPos+1<c;if(o||l){if(n=!l||o&&t.oldPos+1<r.oldPos?u.addToPath(r,!0,void 0,0):u.addToPath(t,void 0,!0,1),v=u.extractCommon(n,a,s,e),n.oldPos+1>=c&&f<=v+1)return d(function(e,n,t,r,i){var o,l=[];for(;n;)l.push(n),o=n.previousComponent,delete n.previousComponent,n=o;l.reverse();for(var s=0,a=l.length,u=0,d=0;s<a;s++){var f,c,p=l[s];p.removed?(p.value=e.join(r.slice(d,d+p.count)),d+=p.count,s&&l[s-1].added&&(f=l[s-1],l[s-1]=l[s],l[s]=f)):(!p.added&&i?(c=(c=t.slice(u,u+p.count)).map(function(e,n){var t=r[d+n];return t.length>e.length?t:e}),p.value=e.join(c)):p.value=e.join(t.slice(u,u+p.count)),u+=p.count,p.added||(d+=p.count))}var h=l[a-1];1<a&&"string"==typeof h.value&&(h.added||h.removed)&&e.equals("",h.value)&&(l[a-2].value+=h.value,l.pop());return l}(u,n.lastComponent,a,s,u.useLongestToken));(h[e]=n).oldPos+1>=c&&(g=Math.min(g,e-1)),f<=v+1&&(m=Math.max(m,e+1))}else h[e]=void 0}p++}if(r)!function e(){setTimeout(function(){return i<p||Date.now()>l?r():void(w()||e())},0)}();else for(;p<=i&&Date.now()<=l;){var y=w();if(y)return y}},addToPath:function(e,n,t,r){var i=e.lastComponent;return i&&i.added===n&&i.removed===t?{oldPos:e.oldPos+r,lastComponent:{count:i.count+1,added:n,removed:t,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:n,removed:t,previousComponent:i}}},extractCommon:function(e,n,t,r){for(var i=n.length,o=t.length,l=e.oldPos,s=l-r,a=0;s+1<i&&l+1<o&&this.equals(n[s+1],t[l+1]);)s++,l++,a++;return a&&(e.lastComponent={count:a,previousComponent:e.lastComponent}),e.oldPos=l,s},equals:function(e,n){return this.options.comparator?this.options.comparator(e,n):e===n||this.options.ignoreCase&&e.toLowerCase()===n.toLowerCase()},removeEmpty:function(e){for(var n=[],t=0;t<e.length;t++)e[t]&&n.push(e[t]);return n},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};var r=new t;function i(e,n){if("function"==typeof e)n.callback=e;else if(e)for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}var o=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,l=/\S/,s=new t;s.equals=function(e,n){return this.options.ignoreCase&&(e=e.toLowerCase(),n=n.toLowerCase()),e===n||this.options.ignoreWhitespace&&!l.test(e)&&!l.test(n)},s.tokenize=function(e){for(var n=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),t=0;t<n.length-1;t++)!n[t+1]&&n[t+2]&&o.test(n[t])&&o.test(n[t+2])&&(n[t]+=n[t+2],n.splice(t+1,2),t--);return n};var a=new t;function L(e,n,t){return a.diff(e,n,t)}a.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,"\n"));var n=[],t=e.split(/(\n|\r\n)/);t[t.length-1]||t.pop();for(var r=0;r<t.length;r++){var i=t[r];r%2&&!this.options.newlineIsToken?n[n.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),n.push(i))}return n};var u=new t;u.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var d=new t;function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(n,e){var t,r=Object.keys(n);return Object.getOwnPropertySymbols&&(t=Object.getOwnPropertySymbols(n),e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})),r.push.apply(r,t)),r}function c(i){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?n(Object(o),!0).forEach(function(e){var n,t,r;n=i,r=o[t=e],t in n?Object.defineProperty(n,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[t]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(o,e))})}return i}function x(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,n){if(!e)return;if("string"==typeof e)return p(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p(e,n)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}d.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};var h=Object.prototype.toString,v=new t;function m(e,n,t,r,i){var o,l;for(n=n||[],t=t||[],r&&(e=r(i,e)),o=0;o<n.length;o+=1)if(n[o]===e)return t[o];if("[object Array]"===h.call(e)){for(n.push(e),l=new Array(e.length),t.push(l),o=0;o<e.length;o+=1)l[o]=m(e[o],n,t,r,i);return n.pop(),t.pop(),l}if(e&&e.toJSON&&(e=e.toJSON()),"object"===f(e)&&null!==e){n.push(e),l={},t.push(l);var s,a=[];for(s in e)e.hasOwnProperty(s)&&a.push(s);for(a.sort(),o=0;o<a.length;o+=1)l[s=a[o]]=m(e[s],n,t,r,s);n.pop(),t.pop()}else l=e;return l}v.useLongestToken=!0,v.tokenize=a.tokenize,v.castInput=function(e){var n=this.options,t=n.undefinedReplacement,r=n.stringifyReplacer,i=void 0===r?function(e,n){return void 0===n?t:n}:r;return"string"==typeof e?e:JSON.stringify(m(e,null,null,i),i," ")},v.equals=function(e,n){return t.prototype.equals.call(v,e.replace(/,([\r\n])/g,"$1"),n.replace(/,([\r\n])/g,"$1"))};var g=new t;function C(e){var l=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},s=e.split(/\r\n|[\n\v\f\r\x85]/),a=e.match(/\r\n|[\n\v\f\r\x85]/g)||[],i=[],u=0;function n(){var e={};for(i.push(e);u<s.length;){var n=s[u];if(/^(\-\-\-|\+\+\+|@@)\s/.test(n))break;var t=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(n);t&&(e.index=t[1]),u++}for(o(e),o(e),e.hunks=[];u<s.length;){var r=s[u];if(/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(r))break;if(/^@@/.test(r))e.hunks.push(function(){var e=u,n=s[u++].split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),t={oldStart:+n[1],oldLines:void 0===n[2]?1:+n[2],newStart:+n[3],newLines:void 0===n[4]?1:+n[4],lines:[],linedelimiters:[]};0===t.oldLines&&(t.oldStart+=1);0===t.newLines&&(t.newStart+=1);for(var r=0,i=0;u<s.length&&!(0===s[u].indexOf("--- ")&&u+2<s.length&&0===s[u+1].indexOf("+++ ")&&0===s[u+2].indexOf("@@"));u++){var o=0==s[u].length&&u!=s.length-1?" ":s[u][0];if("+"!==o&&"-"!==o&&" "!==o&&"\\"!==o)break;t.lines.push(s[u]),t.linedelimiters.push(a[u]||"\n"),"+"===o?r++:"-"===o?i++:" "===o&&(r++,i++)}r||1!==t.newLines||(t.newLines=0);i||1!==t.oldLines||(t.oldLines=0);if(l.strict){if(r!==t.newLines)throw new Error("Added line count did not match for hunk at line "+(e+1));if(i!==t.oldLines)throw new Error("Removed line count did not match for hunk at line "+(e+1))}return t}());else{if(r&&l.strict)throw new Error("Unknown line "+(u+1)+" "+JSON.stringify(r));u++}}}function o(e){var n,t,r,i=/^(---|\+\+\+)\s+(.*)$/.exec(s[u]);i&&(n="---"===i[1]?"old":"new",r=(t=i[2].split("\t",2))[0].replace(/\\\\/g,"\\"),/^".*"$/.test(r)&&(r=r.substr(1,r.length-2)),e[n+"FileName"]=r,e[n+"Header"]=(t[1]||"").trim(),u++)}for(;u<s.length;)n();return i}function w(e,n){var t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof n&&(n=C(n)),Array.isArray(n)){if(1<n.length)throw new Error("applyPatch only works with a single input.");n=n[0]}var r,i,l=e.split(/\r\n|[\n\v\f\r\x85]/),o=e.match(/\r\n|[\n\v\f\r\x85]/g)||[],s=n.hunks,a=t.compareLine||function(e,n,t,r){return n===r},u=0,d=t.fuzzFactor||0,f=0,c=0;for(var p=0;p<s.length;p++){for(var h=s[p],v=l.length-h.oldLines,m=0,g=c+h.oldStart-1,w=function(n,t,r){var i=!0,o=!1,l=!1,s=1;return function e(){if(i&&!l){if(o?s++:i=!1,n+s<=r)return s;l=!0}if(!o)return l||(i=!0),t<=n-s?-s++:(o=!0,e())}}(g,f,v);void 0!==m;m=w())if(function(e,n){for(var t=0;t<e.lines.length;t++){var r=e.lines[t],i=0<r.length?r[0]:" ",o=0<r.length?r.substr(1):r;if(" "===i||"-"===i){if(!a(n+1,l[n],i,o)&&d<++u)return;n++}}return 1}(h,g+m)){h.offset=c+=m;break}if(void 0===m)return!1;f=h.offset+h.oldStart+h.oldLines}for(var y=0,L=0;L<s.length;L++){var x=s[L],S=x.oldStart+x.offset+y-1;y+=x.newLines-x.oldLines;for(var b=0;b<x.lines.length;b++){var k,F=x.lines[b],N=0<F.length?F[0]:" ",P=0<F.length?F.substr(1):F,j=x.linedelimiters&&x.linedelimiters[b]||"\n";" "===N?S++:"-"===N?(l.splice(S,1),o.splice(S,1)):"+"===N?(l.splice(S,0,P),o.splice(S,0,j),S++):"\\"===N&&("+"===(k=x.lines[b-1]?x.lines[b-1][0]:null)?r=!0:"-"===k&&(i=!0))}}if(r)for(;!l[l.length-1];)l.pop(),o.pop();else i&&(l.push(""),o.push("\n"));for(var O=0;O<l.length-1;O++)l[O]=l[O]+o[O];return l.join("")}function y(e,n,u,d,t,r,f){void 0===(f=f||{}).context&&(f.context=4);var c=L(u,d,f);if(c){c.push({value:"",lines:[]});for(var p=[],h=0,v=0,m=[],g=1,w=1,i=0;i<c.length;i++)!function(e){var n,t,r,i,o,l,s=c[e],a=s.lines||s.value.replace(/\n$/,"").split("\n");s.lines=a,s.added||s.removed?(h||(n=c[e-1],h=g,v=w,n&&(m=0<f.context?y(n.lines.slice(-f.context)):[],h-=m.length,v-=m.length)),m.push.apply(m,x(a.map(function(e){return(s.added?"+":"-")+e}))),s.added?w+=a.length:g+=a.length):(h&&(a.length<=2*f.context&&e<c.length-2?m.push.apply(m,x(y(a))):(t=Math.min(a.length,f.context),m.push.apply(m,x(y(a.slice(0,t)))),r={oldStart:h,oldLines:g-h+t,newStart:v,newLines:w-v+t,lines:m},e>=c.length-2&&a.length<=f.context&&(i=/\n$/.test(u),o=/\n$/.test(d),l=0==a.length&&m.length>r.oldLines,!i&&l&&0<u.length&&m.splice(r.oldLines,0,"\\ No newline at end of file"),(i||l)&&o||m.push("\\ No newline at end of file")),p.push(r),v=h=0,m=[])),g+=a.length,w+=a.length)}(i);return{oldFileName:e,newFileName:n,oldHeader:t,newHeader:r,hunks:p}}function y(e){return e.map(function(e){return" "+e})}}function S(e){if(Array.isArray(e))return e.map(S).join("\n");var n=[];e.oldFileName==e.newFileName&&n.push("Index: "+e.oldFileName),n.push("==================================================================="),n.push("--- "+e.oldFileName+(void 0===e.oldHeader?"":"\t"+e.oldHeader)),n.push("+++ "+e.newFileName+(void 0===e.newHeader?"":"\t"+e.newHeader));for(var t=0;t<e.hunks.length;t++){var r=e.hunks[t];0===r.oldLines&&--r.oldStart,0===r.newLines&&--r.newStart,n.push("@@ -"+r.oldStart+","+r.oldLines+" +"+r.newStart+","+r.newLines+" @@"),n.push.apply(n,r.lines)}return n.join("\n")+"\n"}function b(e,n,t,r,i,o,l){return S(y(e,n,t,r,i,o,l))}function k(e,n){if(n.length>e.length)return!1;for(var t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function F(e){var n=function r(e){var i=0;var o=0;e.forEach(function(e){var n,t;"string"!=typeof e?(n=r(e.mine),t=r(e.theirs),void 0!==i&&(n.oldLines===t.oldLines?i+=n.oldLines:i=void 0),void 0!==o&&(n.newLines===t.newLines?o+=n.newLines:o=void 0)):(void 0===o||"+"!==e[0]&&" "!==e[0]||o++,void 0===i||"-"!==e[0]&&" "!==e[0]||i++)});return{oldLines:i,newLines:o}}(e.lines),t=n.oldLines,r=n.newLines;void 0!==t?e.oldLines=t:delete e.oldLines,void 0!==r?e.newLines=r:delete e.newLines}function N(e,n){if("string"!=typeof e)return e;if(/^@@/m.test(e)||/^Index:/m.test(e))return C(e)[0];if(!n)throw new Error("Must provide a base reference or pass in a patch");return y(void 0,void 0,n,e)}function P(e){return e.newFileName&&e.newFileName!==e.oldFileName}function j(e,n,t){return n===t?n:(e.conflict=!0,{mine:n,theirs:t})}function O(e,n){return e.oldStart<n.oldStart&&e.oldStart+e.oldLines<n.oldStart}function H(e,n){return{oldStart:e.oldStart,oldLines:e.oldLines,newStart:e.newStart+n,newLines:e.newLines,lines:e.lines}}function A(e,n,t,r){var i,o=M(n),l=function(e,n){var t=[],r=[],i=0,o=!1,l=!1;for(;i<n.length&&e.index<e.lines.length;){var s=e.lines[e.index],a=n[i];if("+"===a[0])break;if(o=o||" "!==s[0],r.push(a),i++,"+"===s[0])for(l=!0;"+"===s[0];)t.push(s),s=e.lines[++e.index];a.substr(1)===s.substr(1)?(t.push(s),e.index++):l=!0}"+"===(n[i]||"")[0]&&o&&(l=!0);if(l)return t;for(;i<n.length;)r.push(n[i++]);return{merged:r,changes:t}}(t,o);l.merged?(i=e.lines).push.apply(i,x(l.merged)):E(e,r?l:o,r?o:l)}function E(e,n,t){e.conflict=!0,e.lines.push({conflict:!0,mine:n,theirs:t})}function z(e,n,t){for(;n.offset<t.offset&&n.index<n.lines.length;){var r=n.lines[n.index++];e.lines.push(r),n.offset++}}function T(e,n){for(;n.index<n.lines.length;){var t=n.lines[n.index++];e.lines.push(t)}}function M(e){for(var n=[],t=e.lines[e.index][0];e.index<e.lines.length;){var r=e.lines[e.index];if("-"===t&&"+"===r[0]&&(t="+"),t!==r[0])break;n.push(r),e.index++}return n}function D(e){return e.reduce(function(e,n){return e&&"-"===n[0]},!0)}function I(e,n,t){for(var r=0;r<t;r++){var i=n[n.length-t+r].substr(1);if(e.lines[e.index+r]!==" "+i)return}return e.index+=t,1}g.tokenize
[all...]

Completed in 11 milliseconds

12345