Sha256: 4647c879bda652453bf19204f8f044f70335f2527b20fd6464dc04bc5a8bc2de

Contents?: true

Size: 547 Bytes

Versions: 1

Compression:

Stored size: 547 Bytes

Contents

module Gisele
  module Language

    def rule2mod(rule)
      rule.to_s.gsub(/(^|_)([a-z])/){|x| $2.capitalize}.to_sym
    end
    module_function :rule2mod

    def mod2rule(mod)
      mod = mod.name.to_s.split('::').last.to_sym if mod.is_a?(Module)
      mod.to_s.gsub(/[A-Z]/){|x| "_#{x.downcase}"}[1..-1].to_sym
    end
    module_function :mod2rule

  end # module Language
end # module Gisele
require_relative 'language/syntax'
require_relative 'language/ast'
require_relative 'language/transformer'
require_relative 'language/sugar_removal'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gisele-0.1.0 lib/gisele/language.rb