Sha256: e100fd09c6543194522368b9f7a82cd745798fb3ccdcf9573faef6e63dc06a51

Contents?: true

Size: 558 Bytes

Versions: 7

Compression:

Stored size: 558 Bytes

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
    # @param context [Context] Processing environment data
    #
    def comment(node, indent, context)
      indentation = " " * indent

      value = context.evaluate "\"#{node[@value]}\""

      comment_tag = "#{indentation}<!-- #{value} -->\n"

      @node_stack << :comment
      @code += comment_tag
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
opulent-1.1.0 lib/opulent/compiler/comment.rb
opulent-1.0.9 lib/opulent/compiler/comment.rb
opulent-1.0.8 lib/opulent/compiler/comment.rb
opulent-1.0.7 lib/opulent/compiler/comment.rb
opulent-1.0.4 lib/opulent/compiler/comment.rb
opulent-1.0.3 lib/opulent/compiler/comment.rb
opulent-1.0.2 lib/opulent/compiler/comment.rb