Sha256: b7c83d45c9a496c9a8dd37438b93237affd18a957c5f228e06a6917d04afc030
Contents?: true
Size: 1010 Bytes
Versions: 7
Compression:
Stored size: 1010 Bytes
Contents
module Unparser class Emitter # Emitter for postconditions class Post < self handle :while_post, :until_post children :condition, :body MAP = { :while_post => K_WHILE, :until_post => K_UNTIL }.freeze handle *MAP.keys # Perform dispatch # # @return [undefined] # # @api private # def dispatch visit(body) write(WS, MAP.fetch(node.type), WS) visit(condition) end end # Base class for while and until emitters class Repetition < self MAP = { :while => K_WHILE, :until => K_UNTIL }.freeze handle *MAP.keys children :condition, :body private # Perform dispatch # # @return [undefined] # # @api private # def dispatch write(MAP.fetch(node.type), WS) visit(condition) emit_body k_end end end # Repetition end # Emitter end # Unparser
Version data entries
7 entries across 7 versions & 1 rubygems