   ###
   class Value extends Pattern
     constructor: (@dataType, @type, @ns, @string) ->
-    textDeriv: (node) =>
+    textDeriv: (node) ->
       return new Empty("skipping Value validation")
 
-    toString: =>
+    toString: ->
       output = ""
 
       if @dataType

    constructor: (pattern1, pattern2) ->
      @pattern1 = getPattern pattern1
      @pattern2 = getPattern pattern2
    choiceLeaves: =>
      l1 = @pattern1.choiceLeaves()
      l2 = @pattern2.choiceLeaves()
      for c in l2
        unless c in l1
          l1.push(c)
      return l1
    pruneChoiceLeaf: (pattern) =>
      if @pattern1 is pattern
        return @pattern2.pruneChoiceLeaf(pattern)
      if @pattern2 is pattern
        return @pattern1.pruneChoiceLeaf(pattern)
      return this

    startTagOpenDeriv: (node) =>
      p1 = @pattern1.startTagOpenDeriv(node)
      p2 = @pattern2.startTagOpenDeriv(node)
      return builder.choice(p1, p2)
    startTagCloseDeriv: (node) =>
      builder.choice(@pattern1.startTagCloseDeriv(node), @pattern2.startTagCloseDeriv(node))
    endTagDeriv: (node) =>
      builder.choice(@pattern1.endTagDeriv(node), @pattern2.endTagDeriv(node))
    attDeriv: (attribute) =>
      builder.choice(@pattern1.attDeriv(attribute), @pattern2.attDeriv(attribute))
    textDeriv: (node) =>
      builder.choice(@pattern1.textDeriv(node), @pattern2.textDeriv(node))
    toString: =>
      "(#{@pattern1} | #{@pattern2})"
    contains: (nodeName) =>
      @pattern1.contains(nodeName) or @pattern2.contains(nodeName)
    _nullable: =>
      @pattern1.nullable() or @pattern2.nullable()



  ###
  class Empty extends Pattern
    constructor: (@message, @pattern, @childNode) ->
    textDeriv: (node) ->
      return this
    toString: ->
      if @message
        "#{@message}"
      else
        "(null)"
    _nullable: ->
      true


