Sha256: a9bd57c84a391217d4cc2c69009a0c44d9177cf6649f305ac7f8e088dcfe11b1

Contents?: true

Size: 1.56 KB

Versions: 14

Compression:

Stored size: 1.56 KB

Contents

# @Opulent
module Opulent
  # @Compiler
  class Compiler
    # Generate the code for a while control structure
    #
    # @param node [Array] Node code generation data
    # @param indent [Fixnum] Size of the indentation to be added
    #
    def doctype_node(node, indent)
      value = case node[@value]
              when :"", :html, :"5"
                '!DOCTYPE html'
              when :"1.1"
                '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"'
              when :strict
                '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"'
              when :frameset
                '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"'
              when :mobile
                '!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd"'
              when :basic
                '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd"'
              when :transitional
                '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"'
              when :xml
                '?xml version="1.0" encoding="utf-8" ?'
              when :'xml ISO-8859-1'
                '?xml version="1.0" encoding="iso-8859-1" ?'
              end

      @node_stack << :doctype
      buffer_freeze "<#{value}>"
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
opulent-1.7.4 lib/opulent/compiler/doctype.rb
opulent-1.7.3 lib/opulent/compiler/doctype.rb
opulent-1.7.2 lib/opulent/compiler/doctype.rb
opulent-1.7.1 lib/opulent/compiler/doctype.rb
opulent-1.7.0 lib/opulent/compiler/doctype.rb
opulent-1.6.9 lib/opulent/compiler/doctype.rb
opulent-1.6.8 lib/opulent/compiler/doctype.rb
opulent-1.6.7 lib/opulent/compiler/doctype.rb
opulent-1.6.6 lib/opulent/compiler/doctype.rb
opulent-1.6.5 lib/opulent/compiler/doctype.rb
opulent-1.6.3 lib/opulent/compiler/doctype.rb
opulent-1.6.2 lib/opulent/compiler/doctype.rb
opulent-1.6.1 lib/opulent/compiler/doctype.rb
opulent-1.6.0 lib/opulent/compiler/doctype.rb