Skip to content

RGSS3/minidsl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minidsl

Minidsl is an DSL way to generate mainly codes.

$: << "lib"
require 'minidsl'

include Minidsl
r = Scope.push_context :Statements


class Test
   def int(opt = {})
      opt.map{|k, v|
         "int #{k} = #{v};"
      }
   end
   def println(str)
     "System.out.println(#{str.inspect});"
   end
end

s = pure_proxy Test.new
s.instance_eval{
  int a: 3, b: 5
  println "Hello world"
}

puts r.result

would generate

int a = 3;
int b = 5;
System.out.println("Hello world");

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/RGSS3/minidsl.

License

The gem is available as open source under the terms of the MIT License.

About

update -> see http://github.com/RGSS3/doremi

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors