Sha256: 850676284df0427d16b74475086bff6dc61bb819d159b015186d70d98634d450
Contents?: true
Size: 744 Bytes
Versions: 11
Compression:
Stored size: 744 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 # Escaping double quotes is required in order to avoid any conflicts with the eval quotes. value = indent_lines context.evaluate('"' + node[@value].gsub('"', '\\"') + '"'), " " * indent comment_tag = "#{"\n" if node[@options][:newline]}#{indentation}<!-- #{value.strip} -->\n" @node_stack << :comment @code += comment_tag end end end
Version data entries
11 entries across 11 versions & 1 rubygems