Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 106 lines (88 sloc) 2.02 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
class Tag
  tag: true
  name: undefined
  parts: -> []

class Anchor extends Tag
  name: 'Anchor'
  constructor: (@content) ->
  parts: -> ['@', @content]

class Content extends Tag
  name: 'Content'
  constructor: (@content) ->
  parts: -> [@content]

class Group extends Tag
  name: 'Group'
  constructor: (@content) ->
  parts: -> ['(', @content, ')']

class Block extends Tag
  name: 'Block'
  constructor: (@content) ->
  parts: -> ['{', @content, '}']

class ScriptBlock extends Tag
  name: 'ScriptBlock'
  constructor: (@content) ->
  parts: -> ['{', @content, '}']

class If extends Tag
  name: 'If'
  constructor: (@test,@block,@else) ->
  parts: -> ['if', @test, @block, @else]

class Else extends Tag
  name: 'Else'
  constructor: (@content) ->
  parts: -> ['else ', @content]

class For extends Tag
  name: 'For'
  constructor: (@test,@block) ->
  parts: -> ['for', @test, @block]

class While extends Tag
  name: 'While'
  constructor: (@test,@block) ->
  parts: -> ['while', @test, @block]

class DoWhile extends Tag
  name: 'DoWhile'
  constructor: (@block,@test) ->
  parts: -> ['do', @block, 'while', @test, ';']

class Func extends Tag
  name: 'Func'
  constructor: (@identifier,@args,@block) ->
  parts: -> ['function ', @identifier, @args, @block]

class Parameters extends Tag
  name: 'Parameters'
  constructor: (@parameters) ->
  parts: -> [@parameters]

class Value extends Tag
  name: 'Value'
  constructor: (@identifier,@next) ->
  parts: -> [@identifier,@next]

class Member extends Tag
  name: 'Member'
  constructor: (@value) ->
  parts: -> [@value]

class Access extends Tag
  name: 'Access'
  constructor: (@content) ->
  parts: -> ['[', @content, ']']

class Invoke extends Tag
  name: 'Invoke'
  constructor: (@content) ->
  parts: -> ['(', @content, ')']


if module isnt undefined
  module.exports = {
    Tag
    Anchor
    Content
    Group
    Block
    ScriptBlock
    If
    Else
    For
    While
    DoWhile
    Func
    Parameters
    Value
    Member
    Access
    Invoke
  }
Something went wrong with that request. Please try again.