Permalink
Browse files

0.9.0

  • Loading branch information...
1 parent 6117604 commit 6259e193947a10bc823a40a0afbfbef786e31f78 @satyr committed Nov 24, 2012
Showing with 31 additions and 73 deletions.
  1. +22 −0 README.md
  2. +1 −1 doc/doc.js
  3. +1 −1 doc/lang-co.js
  4. +2 −2 extras/coco.js
  5. +1 −1 extras/mode-coco.js
  6. +1 −1 lib/coco.js
  7. +1 −1 package.co
  8. +1 −1 package.json
  9. +1 −1 src/coco.co
  10. +0 −64 src/coco.js
View
@@ -36,6 +36,28 @@ Get [Node.js](http://nodejs.org) and [npm](http://npmjs.org), then:
- `git clone git://github.com/satyr/coco.git && cd coco && bin/coke i`
## Changelog
+### 0.9.0
+- Literal `&` is now used to reference several new targets:
+ - Left hand of `|>` (in place of `_`).
+ - Current item of newly added quick map: `for [0 1] => &+2 # [2 3]`
+ - Subject of new `with` as proposed
+ in [#172](https://github.com/satyr/coco/issues/172).
+- Made cascade, now `with` in disguise, require at least one `&` in body.
+ ([#179](https://github.com/satyr/coco/issues/179))
+- Made `let` accept `this =` on the first assignment to substitute old `with`.
+- Made bodyless `catch` return the catchee.
+- Made `by -1` implied on downward ranges.
+- Made interpolation apply to `#&` and `#@`.
+- Quit expanding `super` followed by `::` to parent method,
+ so that call to `super::anotherMethod` works as expected.
+- Fixed:
+ - [#175](https://github.com/satyr/coco/issues/175)
+ - [#178](https://github.com/satyr/coco/issues/178)
+ - [#185](https://github.com/satyr/coco/issues/185)
+ - [#190](https://github.com/satyr/coco/issues/190)
+ - [#192](https://github.com/satyr/coco/issues/192)
+ - [coffee#1188](https://github.com/jashkenas/coffee-script/issues/1188)
+
### 0.8.2
- Fixed:
- [#165](https://github.com/satyr/coco/issues/165)
View
@@ -1 +1 @@
-(function(){function s(e,t){return document.body.appendChild(f(document.createElement(e),t))}function o(n,r){var i,s;i=n[0],s=n[1],t.innerHTML=r,document.title=i+(e&&" - "+e),s&&document.getElementById(s).scrollIntoView(),prettyPrint()}function u(e,t){var n,r,i,s,o,u,f,l,c,h,p;s=i=r=n="",o=/^[^\n\S]*#(?![!{$A-Za-z_]) ?(.*)/;for(u=0,l=(f=t.split("\n")).length;u<l;++u){c=f[u];if(!c){h=!0,r&&(r+="\n");continue}if(p=o.exec(c)){if(r||i&&h)s+=a(e,i,r,n++),i=r="";i+=p[1]+"\n"}else r+=c+"\n";h=!1}if(i||r)s+=a(e,i,r,n);return"<h1>"+e+"</h1>"+s+"<br clear=both>"}function a(e,t,n,r){return n&&(n='<pre class="code prettyprint lang-co"\n >'+n.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"</pre>"),"<div id="+r+" class=block><div class=comment\n ><a class=anchor href=#"+e+r+">#"+r+"</a\n >"+i.makeHtml(t)+"</div\n >"+n+"</div>"}function f(e,t){for(var n in t)e[n]=t[n];return e}var e,t,n,r,i;e=document.title,t=document.getElementById("doc")||s("div",{id:"doc"}),n=document.getElementById("nav")||function(){var t,n,r,i,o;t="<div class=pointee>&#x2935;</div>",e&&(t+="<h1>"+e+"</h1>");for(n=0,i=(r=sources).length;n<i;++n)o=r[n],t+=o?"<li><a href=#"+o+">"+o+"</a>":"<p class=spacer>";return t+="<li class=index><a href=#>#</a>",s("ul",{id:"nav",innerHTML:t})}.call(this),r={__proto__:null},i=new Showdown.converter,(this.onhashchange=function(){var i,s,a,f;if(!(i=/^\D+(?=(\d*)$)/.exec(location.hash.slice(1)))){document.title=e,n.className=t.innerHTML="";return}n.className="menu",t.innerHTML="...",s=i[0];if(a=r[s])return o(i,a);f=new XMLHttpRequest,f.open("GET",s!=="Cokefile"?s+".co":s,!0),typeof f.overrideMimeType=="function"&&f.overrideMimeType("text/plain"),f.onreadystatechange=function(){f.readyState===4&&o(i,r[s]=u(s,f.responseText))},f.send(null)})()}).call(this)
+(function(){function s(e,t){return document.body.appendChild(f(document.createElement(e),t))}function o(n,r){var i,s;i=n[0],s=n[1],t.innerHTML=r,document.title=i+(e&&" - "+e),s&&document.getElementById(s).scrollIntoView(),prettyPrint()}function u(e,t){var n,r,i,s,o,u,f,l,c,h,p;n=r=i=s="",o=/^[^\n\S]*#(?![!{$A-Za-z_]) ?(.*)/;for(u=0,l=(f=t.split("\n")).length;u<l;++u){c=f[u];if(!c){h=!0,i&&(i+="\n");continue}if(p=o.exec(c)){if(i||r&&h)n+=a(e,r,i,s++),r=i="";r+=p[1]+"\n"}else i+=c+"\n";h=!1}if(r||i)n+=a(e,r,i,s);return"<h1>"+e+"</h1>"+n+"<br clear=both>"}function a(e,t,n,r){return n&&(n='<pre class="code prettyprint lang-co"\n >'+n.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"</pre>"),"<div id="+r+" class=block><div class=comment\n ><a class=anchor href=#"+e+r+">#"+r+"</a\n >"+i.makeHtml(t)+"</div\n >"+n+"</div>"}function f(e,t){for(var n in t)e[n]=t[n];return e}var e,t,n,r,i;e=document.title,t=document.getElementById("doc")||s("div",{id:"doc"}),n=document.getElementById("nav")||function(){var t,n,r,i,o;t="<div class=pointee>&#x2935;</div>",e&&(t+="<h1>"+e+"</h1>");for(n=0,i=(r=sources).length;n<i;++n)o=r[n],t+=o?"<li><a href=#"+o+">"+o+"</a>":"<p class=spacer>";return t+="<li class=index><a href=#>#</a>",s("ul",{id:"nav",innerHTML:t})}.call(this),r={__proto__:null},i=new Showdown.converter,(this.onhashchange=function(){var i,s,a,f;if(!(i=/^\D+(?=(\d*)$)/.exec(location.hash.slice(1)))){document.title=e,n.className=t.innerHTML="";return}n.className="menu",t.innerHTML="...",s=i[0];if(a=r[s])return o(i,a);f=new XMLHttpRequest,f.open("GET",s!=="Cokefile"?s+".co":s,!0),typeof f.overrideMimeType=="function"&&f.overrideMimeType("text/plain"),f.onreadystatechange=function(){f.readyState===4&&o(i,r[s]=u(s,f.responseText))},f.send(null)})()}).call(this)
View
@@ -1 +1 @@
-(function(){var e,t,n,r,i;e=function(e,t,n){var r,i,s;for(r=0,i=t.length;r<i;++r)s=t[r],s.length<4&&s.splice(2,0,0);return PR.registerLangHandler(PR.createSimpleLexer(t,n),[e])},t="(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*",n="(?!(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])",e("co",[["str",/^'(?:''[\S\s]*?''|[^\\']*(?:\\[\S\s][^\\']*)*)'/,"'"],["lang-co-qq",/(^"(?:""[\S\s]*?""|[^\\"]*(?:\\[\S\s][^\\"]*)*)")/,'"'],["lang-co-qr",/(^\/\/[\S\s]*?\/\/[gimy$?]{0,4})/,"/"],["lang-co-at",RegExp("(^@@?"+t+"?)"),"@"],["com",/^#.*/,"#"],["typ",/^(?:0x[\da-f][\da-f_]*|(?:[2-9]|[12]\d|3[0-6])r[\da-z][\da-z_]*|\d[\d_]*(?:\.\d[\d_]*)?(?:e[+-]?\d[\d_]*)?[\w$]*)/i,"0123456789"],["lang-js",/^`([^\\`]*(?:\\[\S\s][^\\`]*)*)`/,"`"]],[["str",/^\\\S[^\s,;)}\]]*/],["com",/^\/\*[\S\s]*\*\//],["pln",RegExp("^(?:\\.{3}|(?:\\.\\s*(?:(?:[-+*/%&|^:]|>>>?|<<)?=|[~!@])?\\s*|[)}\\]?]|::)(?:"+t+"[?~!@]?)+|"+t+"[^\\n\\S]*:(?![:=]))")],["kwd",RegExp("^(?:t(?:ry|h(?:row|en)|ypeof!?)|f(?:or(?:[^\\n\\S]+(?:own|ever))?|inally|unction)|n(?:ew|ot)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:[fs]|n(?:stanceof)?|mp(?:ort(?:[^\\n\\S]+all)?|lements))|e(?:lse|x(?:tends|port))|d(?:e(?:fault|lete|bugger)|o)|un(?:less|til)|w(?:hile|ith)|s(?:witch|uper)|o[fr]|return|break|and|let|var)"+n)],["typ",RegExp("^(?:true|false|null|void)"+n)],["ctx",RegExp("^(?:t(?:h(?:is|at)|o|il)|f(?:rom|allthrough)|e(?:val)?|it|arguments|by|constructor|prototype|superclass|_)"+n)],["glb",RegExp("^(?:Array|Boolean|Date|Error|Function|JSON|Math|Number|Object|RegExp|S(?:tring|yntaxError)|TypeError|is(?:NaN|Finite)|parse(?:Int|Float)|(?:en|de)codeURI(?:Component)?)"+n)],["var",RegExp("^"+t)],["str",/^<\[[\S\s]*?]>/],["lang-co-r",/^[^\/](\/(?![\s\/])[^[\/\n\\]*(?:(?:\\.|\[[^\]\n\\]*(?:\\.[^\]\n\\]*)*\])[^[\/\n\\]*)*\/[gimy$]{0,4})(?!\d)/]]),r=["lang-co",RegExp("^#({[\\S\\s]*?}|"+t+")"),"#"],i=["lit",/^[\S\s]+?/],e("co-qq",[r],[["str",/^[\S\s]+?/]]),e("co-qr",[r],[["com",/^\s#(?!{).*/],i]),e("co-r",[],[i]),e("co-at",[["ctx",/^@+/,"@"]],[])}).call(this)
+(function(){var e,t,n,r,i;e=function(e,t,n){var r,i,s;for(r=0,i=t.length;r<i;++r)s=t[r],s.length<4&&s.splice(2,0,0);return PR.registerLangHandler(PR.createSimpleLexer(t,n),[e])},t="(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*",n="(?!(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])",e("co",[["str",/^'(?:''[\S\s]*?''|[^\\']*(?:\\[\S\s][^\\']*)*)'/,"'"],["lang-co-qq",/(^"(?:""[\S\s]*?""|[^\\"]*(?:\\[\S\s][^\\"]*)*)")/,'"'],["lang-co-qr",/(^\/\/[\S\s]*?\/\/[gimy$?]{0,4})/,"/"],["lang-co-at",RegExp("(^@@?"+t+"?)"),"@"],["com",/^#.*/,"#"],["typ",/^(?:0x[\da-f][\da-f_]*|(?:[2-9]|[12]\d|3[0-6])r[\da-z][\da-z_]*|\d[\d_]*(?:\.\d[\d_]*)?(?:e[+-]?\d[\d_]*)?[\w$]*)/i,"0123456789"],["lang-js",/^`([^\\`]*(?:\\[\S\s][^\\`]*)*)`/,"`"]],[["str",/^\\\S[^\s,;)}\]]*/],["com",/^\/\*[\S\s]*\*\//],["pln",RegExp("^(?:\\.{3}|(?:\\.\\s*(?:(?:[-+*/%&|^:]|>>>?|<<)?=|[~!@])?\\s*|[)}\\]?]|::)(?:"+t+"[?~!@]?)+|"+t+"[^\\n\\S]*:(?![:=]))")],["kwd",RegExp("^(?:t(?:ry|h(?:row|en)|ypeof!?)|f(?:or(?:[^\\n\\S]+(?:own|ever))?|inally|unction)|n(?:ew|ot)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:[fs]|n(?:stanceof)?|mp(?:ort(?:[^\\n\\S]+all)?|lements))|e(?:lse|x(?:tends|port))|d(?:e(?:fault|lete|bugger)|o)|un(?:less|til)|w(?:hile|ith)|s(?:witch|uper)|o[fr]|return|break|and|let|var)"+n)],["typ",RegExp("^(?:true|false|null|void)"+n)],["ctx",RegExp("^(?:t(?:h(?:is|at)|o|il)|f(?:rom|allthrough)|e(?:val)?|it|arguments|by|constructor|prototype|superclass)"+n)],["glb",RegExp("^(?:Array|Boolean|Date|Error|Function|JSON|Math|Number|Object|RegExp|S(?:tring|yntaxError)|TypeError|is(?:NaN|Finite)|parse(?:Int|Float)|(?:en|de)codeURI(?:Component)?)"+n)],["var",RegExp("^"+t)],["str",/^<\[[\S\s]*?]>/],["lang-co-r",/^[^\/](\/(?![\s\/])[^[\/\n\\]*(?:(?:\\.|\[[^\]\n\\]*(?:\\.[^\]\n\\]*)*\])[^[\/\n\\]*)*\/[gimy$]{0,4})(?!\d)/]]),r=["lang-co",RegExp("^#({[\\S\\s]*?}|"+t+"|[@&])"),"#"],i=["lit",/^[\S\s]+?/],e("co-qq",[r],[["str",/^[\S\s]+?/]]),e("co-qr",[r],[["com",/^\s#(?!{).*/],i]),e("co-r",[],[i]),e("co-at",[["ctx",/^@+/,"@"]],[])}).call(this)
View
Oops, something went wrong.
View
@@ -1 +1 @@
-(function(){function e(e,t){function n(){}return n.prototype=(e.superclass=t).prototype,(e.prototype=new n).constructor=e,typeof t.extended=="function"&&t.extended(e),e}define("ace/mode/coco",function(t,n,r){var i,s,o,u;i="(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*",n.Mode=s=function(n){function u(){var e;this.$tokenizer=new(t("ace/tokenizer").Tokenizer)(u.Rules);if(e=t("ace/mode/matching_brace_outdent"))this.$outdent=new e.MatchingBraceOutdent}u.displayName="CocoMode";var r,s=e(u,n).prototype,o=u;return r=RegExp("(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*"+i+")?))\\s*$"),s.getNextLineIndent=function(e,t,n){var i,s;return i=this.$getIndent(t),s=this.$tokenizer.getLineTokens(t,e).tokens,(!s.length||s[s.length-1].type!=="comment")&&e==="start"&&r.test(t)&&(i+=n),i},s.toggleCommentLines=function(e,n,r,i){var s,o,u,a,f;s=/^(\s*)#/,o=new(t("ace/range").Range)(0,0,0,0);for(u=r;u<=i;++u)(f=s.test(a=n.getLine(u)))?a=a.replace(s,"$1"):a=a.replace(/^\s*/,"$&#"),o.end.row=o.start.row=u,o.end.column=a.length+1,n.replace(o,a);return 1-f*2},s.checkOutdent=function(e,t,n){var r;return(r=this.$outdent)!=null?r.checkOutdent(t,n):void 8},s.autoOutdent=function(e,t,n){var r;return(r=this.$outdent)!=null?r.autoOutdent(t,n):void 8},u}(t("ace/mode/text").Mode),o="(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))",u={token:"string",regex:".+"},s.Rules={start:[{token:"keyword",regex:"(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var)"+o},{token:"constant.language",regex:"(?:true|false|null|void)"+o},{token:"invalid.illegal",regex:"(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)"+o},{token:"language.support.class",regex:"(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)"+o},{token:"language.support.function",regex:"(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)"+o},{token:"variable.language",regex:"(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|[e_])"+o},{token:"identifier",regex:i+"\\s*:(?![:=])"},{token:"variable",regex:i},{token:"keyword.operator",regex:"(?:\\.{3}|\\s+\\?)"},{token:"keyword.variable",regex:"(?:@+|::|\\.\\.)",next:"key"},{token:"keyword.operator",regex:"\\.\\s*",next:"key"},{token:"string",regex:"\\\\\\S[^\\s,;)}\\]]*"},{token:"string.doc",regex:"'''",next:"qdoc"},{token:"string.doc",regex:'"""',next:"qqdoc"},{token:"string",regex:"'",next:"qstring"},{token:"string",regex:'"',next:"qqstring"},{token:"string",regex:"`",next:"js"},{token:"string",regex:"<\\[",next:"words"},{token:"string.regex",regex:"//",next:"heregex"},{token:"comment.doc",regex:"/\\*",next:"comment"},{token:"comment",regex:"#.*"},{token:"string.regex",regex:"\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}",next:"key"},{token:"constant.numeric",regex:"(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)"},{token:"lparen",regex:"[({[]"},{token:"rparen",regex:"[)}\\]]",next:"key"},{token:"keyword.operator",regex:"\\S+"},{token:"text",regex:"\\s+"}],heregex:[{token:"string.regex",regex:".*?//[gimy$?]{0,4}",next:"start"},{token:"string.regex",regex:"\\s*#{"},{token:"comment.regex",regex:"\\s+(?:#.*)?"},{token:"string.regex",regex:"\\S+"}],key:[{token:"keyword.operator",regex:"[.?@!]+"},{token:"identifier",regex:i,next:"start"},{token:"text",regex:".",next:"start"}],comment:[{token:"comment.doc",regex:".*?\\*/",next:"start"},{token:"comment.doc",regex:".+"}],qdoc:[{token:"string",regex:".*?'''",next:"key"},u],qqdoc:[{token:"string",regex:'.*?"""',next:"key"},u],qstring:[{token:"string",regex:"[^\\\\']*(?:\\\\.[^\\\\']*)*'",next:"key"},u],qqstring:[{token:"string",regex:'[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',next:"key"},u],js:[{token:"string",regex:"[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",next:"key"},u],words:[{token:"string",regex:".*?\\]>",next:"key"},u]}})}).call(this)
+(function(){function e(e,t){function n(){}return n.prototype=(e.superclass=t).prototype,(e.prototype=new n).constructor=e,typeof t.extended=="function"&&t.extended(e),e}define("ace/mode/coco",function(t,n,r){var i,s,o,u;i="(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*",n.Mode=s=function(n){function u(){var e;this.$tokenizer=new(t("ace/tokenizer").Tokenizer)(u.Rules);if(e=t("ace/mode/matching_brace_outdent"))this.$outdent=new e.MatchingBraceOutdent}u.displayName="CocoMode";var r,s=e(u,n).prototype,o=u;return r=RegExp("(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*"+i+")?))\\s*$"),s.getNextLineIndent=function(e,t,n){var i,s;return i=this.$getIndent(t),s=this.$tokenizer.getLineTokens(t,e).tokens,(!s.length||s[s.length-1].type!=="comment")&&e==="start"&&r.test(t)&&(i+=n),i},s.toggleCommentLines=function(e,n,r,i){var s,o,u,a,f;s=/^(\s*)#/,o=new(t("ace/range").Range)(0,0,0,0);for(u=r;u<=i;++u)(a=s.test(f=n.getLine(u)))?f=f.replace(s,"$1"):f=f.replace(/^\s*/,"$&#"),o.end.row=o.start.row=u,o.end.column=f.length+1,n.replace(o,f);return 1-a*2},s.checkOutdent=function(e,t,n){var r;return(r=this.$outdent)!=null?r.checkOutdent(t,n):void 8},s.autoOutdent=function(e,t,n){var r;return(r=this.$outdent)!=null?r.autoOutdent(t,n):void 8},u}(t("ace/mode/text").Mode),o="(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))",u={token:"string",regex:".+"},s.Rules={start:[{token:"keyword",regex:"(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var)"+o},{token:"constant.language",regex:"(?:true|false|null|void)"+o},{token:"invalid.illegal",regex:"(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)"+o},{token:"language.support.class",regex:"(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)"+o},{token:"language.support.function",regex:"(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)"+o},{token:"variable.language",regex:"(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)"+o},{token:"identifier",regex:i+"\\s*:(?![:=])"},{token:"variable",regex:i},{token:"keyword.operator",regex:"(?:\\.{3}|\\s+\\?)"},{token:"keyword.variable",regex:"(?:@+|::|\\.\\.)",next:"key"},{token:"keyword.operator",regex:"\\.\\s*",next:"key"},{token:"string",regex:"\\\\\\S[^\\s,;)}\\]]*"},{token:"string.doc",regex:"'''",next:"qdoc"},{token:"string.doc",regex:'"""',next:"qqdoc"},{token:"string",regex:"'",next:"qstring"},{token:"string",regex:'"',next:"qqstring"},{token:"string",regex:"`",next:"js"},{token:"string",regex:"<\\[",next:"words"},{token:"string.regex",regex:"//",next:"heregex"},{token:"comment.doc",regex:"/\\*",next:"comment"},{token:"comment",regex:"#.*"},{token:"string.regex",regex:"\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}",next:"key"},{token:"constant.numeric",regex:"(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)"},{token:"lparen",regex:"[({[]"},{token:"rparen",regex:"[)}\\]]",next:"key"},{token:"keyword.operator",regex:"\\S+"},{token:"text",regex:"\\s+"}],heregex:[{token:"string.regex",regex:".*?//[gimy$?]{0,4}",next:"start"},{token:"string.regex",regex:"\\s*#{"},{token:"comment.regex",regex:"\\s+(?:#.*)?"},{token:"string.regex",regex:"\\S+"}],key:[{token:"keyword.operator",regex:"[.?@!]+"},{token:"identifier",regex:i,next:"start"},{token:"text",regex:".",next:"start"}],comment:[{token:"comment.doc",regex:".*?\\*/",next:"start"},{token:"comment.doc",regex:".+"}],qdoc:[{token:"string",regex:".*?'''",next:"key"},u],qqdoc:[{token:"string",regex:'.*?"""',next:"key"},u],qstring:[{token:"string",regex:"[^\\\\']*(?:\\\\.[^\\\\']*)*'",next:"key"},u],qqstring:[{token:"string",regex:'[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',next:"key"},u],js:[{token:"string",regex:"[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",next:"key"},u],words:[{token:"string",regex:".*?\\]>",next:"key"},u]}})}).call(this)
View
@@ -16,7 +16,7 @@ parser.lexer = {
return '';
}
};
-exports.VERSION = '0.8.3b';
+exports.VERSION = '0.9.0';
exports.compile = function(code, options){
var e, that;
try {
View
@@ -1,5 +1,5 @@
name : \coco
-version : \0.8.2
+version : \0.9.0
description : 'Unfancy CoffeeScript'
keywords :
View
@@ -1,6 +1,6 @@
{
"name": "coco",
- "version": "0.8.2",
+ "version": "0.9.0",
"description": "Unfancy CoffeeScript",
"keywords": [
"language",
View
@@ -15,7 +15,7 @@ parser import
upcomingInput : -> ''
exports import
- VERSION: \0.8.3b
+ VERSION: \0.9.0
# Compiles a string of Coco code to JavaScript.
compile: (code, options) ->
View
@@ -1,64 +0,0 @@
-(function(){
- var lexer, parser;
- lexer = require('./lexer');
- parser = require('./parser').parser;
- parser.yy = require('./ast');
- parser.lexer = {
- lex: function(){
- var tag, __ref;
- __ref = this.tokens[++this.pos] || [''], tag = __ref[0], this.yytext = __ref[1], this.yylineno = __ref[2];
- return tag;
- },
- setInput: function(it){
- this.pos = -1;
- return this.tokens = it;
- },
- upcomingInput: function(){
- return '';
- }
- };
- exports.VERSION = '0.7.6';
- exports.compile = function(code, options){
- var that;
- try {
- return parser.parse(lexer.lex(code)).compileRoot(options);
- } catch (e) {
- if (that = options != null ? options.filename : void 8) {
- e.message += "\nat " + that;
- }
- throw e;
- }
- };
- exports.ast = function(it){
- return parser.parse(typeof it === 'string' ? lexer.lex(it) : it);
- };
- exports.tokens = lexer.lex;
- exports.lex = function(it){
- return lexer.lex(it, {
- raw: true
- });
- };
- exports.run = function(code, options){
- var __ref;
- return Function(exports.compile(code, (__ref = {}, __import(__ref, options), __ref.bare = true, __ref)))();
- };
- exports.tokens.rewrite = lexer.rewrite;
- __importAll(exports.ast, parser.yy);
- if (require.extensions) {
- require('./node')(exports);
- } else {
- exports.require = require;
- if ('' + this === '[object BackstagePass]') {
- this.EXPORTED_SYMBOLS = ['Coco'];
- }
- }
- function __import(obj, src){
- var own = {}.hasOwnProperty;
- for (var key in src) if (own.call(src, key)) obj[key] = src[key];
- return obj;
- }
- function __importAll(obj, src){
- for (var key in src) obj[key] = src[key];
- return obj;
- }
-}).call(this);

0 comments on commit 6259e19

Please sign in to comment.