Skip to content

Instantly share code, notes, and snippets.

View StanAngeloff's full-sized avatar

Stan Angeloff StanAngeloff

View GitHub Profile
$unlink: (object) ->
if isArray(object)
$unlink(child) for child in object
else if typeof object is 'object'
unlinked: {}
(unlinked[key]: $unlink(value)) for key, value of object
return unlinked
else
object
$unlink: (object) ->
if isArray(object)
$unlink(child) for child in object
else if typeof object is 'object'
{ key: $unlink(value) } for key, value of object
else
object
B extends A: ->
@where_am_i: 'at work'
sayWhereYouAre: ->
alert 'I am ' + @where_am_i
func1: ->
private: ->
'I am kind of hidden'
private()
# OK
func1();
# Nope
private()
prototype A
# empty
prototype B extends A
constructor: ->
@where_am_i: 'at work'
sayWhereYouAre: ->
alert 'I am ' + @where_am_i
prototype A
constructor: ->
say 1
prototype B extends A
constructor: ->
say 2
super()
[stan@psp-stan-arch ~]$ cd /home/stan/public/coffee-script/
[stan@psp-stan-arch coffee-script]$ bin/cake build
[stan@psp-stan-arch coffee-script]$ bin/cake build:parser
Error: Cannot find module 'jison'
at loadModuleSync (node.js:842:13)
at require (node.js:950:12)
at /home/stan/public/coffee-script/lib/grammar.js:4:12
at Object.<anonymous> (/home/stan/public/coffee-script/lib/grammar.js:580:2)
at Module._loadContent (node.js:966:21)
at Module._loadScriptSync (node.js:978:16)
### A House class.
### @author Stan Angeloff
class House
### A buy(..) method
### @access public
### @return void
buy: ->
puts 'I am moving soon...'
### func(..) documented
diff --git a/src/grammar.coffee b/src/grammar.coffee
index 0ed752c..40dbc89 100644
--- a/src/grammar.coffee
+++ b/src/grammar.coffee
@@ -75,6 +75,7 @@ grammar: {
o "Class"
o "Splat"
o "Existence"
+ o "Javadoc"
o "Comment"
sys: require('sys')
Lexer: require('../lib/lexer').Lexer
INTERPOLATION : /^\$([a-zA-Z_@]\w*)/
class PartialLexer
constructor: (chunk) ->
@i: 0
@chunk: chunk