DesugarCompiler is a compiler that desugars Ruby code into a more primitive form. This is useful for consumers that want to deal with fewer node types.

Instance Methods

@@foo &&= bar

becomes

@@foo && @@foo = bar

@@foo += bar

becomes

@@foo = @@foo + bar

@@foo ||= bar

becomes

defined?(@@foo) ? @@foo : @@foo = bar

Foo &&= bar

becomes

Foo && Foo = bar

Foo += bar

becomes

Foo = Foo + bar

Foo ||= bar

becomes

defined?(Foo) ? Foo : Foo = bar

$foo &&= bar

becomes

$foo && $foo = bar

$foo += bar

becomes

$foo = $foo + bar

$foo ||= bar

becomes

defined?($foo) ? $foo : $foo = bar

@foo &&= bar

becomes

@foo && @foo = bar

@foo += bar

becomes

@foo = @foo + bar

@foo ||= bar

becomes

@foo || @foo = bar

foo &&= bar

becomes

foo && foo = bar

foo += bar

becomes

foo = foo + bar

foo ||= bar

becomes

foo || foo = bar