Class: CleanRipperDocumentation

Inherits:
Object
  • Object
show all
Defined in:
lib/clean_ripper_doc.rb

Overview

Show all sexp that CleanRipper can output.

Instance Method Summary collapse

Instance Method Details

#binary(right, operator, left) ⇒ Object

A binary operation.

Examples:

1+2     #=> [:binary, [:lit, 1], :+, [:lit, 2]]
a and b #=> [:binary, [:lvar, :a], :and, [:lvar, :a]]

Parameters:

  • right (Sexp)

    The right side of the operation.

  • left (Sexp)

    The left side of the operation.

  • operator (Symbol)

    The operator.



23
24
25
# File 'lib/clean_ripper_doc.rb', line 23

def binary(right, operator, left)
  
end

#call(receiver, method, arguments, block) ⇒ Object

A method call.

Examples:

Array.new(5, nil)
#=> [:call, [:const, :Array], :new, [[:lit, 5], [:nil]], nil]
print var
#=> [:call, nil, :print, [[:ident, :var]], nil]

Parameters:

  • receiver (Sexp, nil)

    How calls the method.

  • method (Symbol)

    The method name.

  • arguments (Array)

    Array of arguments.

  • block (Sexp, nil)

    Block passed to the method.



47
48
49
# File 'lib/clean_ripper_doc.rb', line 47

def call(receiver, method, arguments, block)
  
end

#lit(value) ⇒ Object

A literal object.

Examples:

1    #=> [:lit, 1]
"aa" #=> [:lit, "aa"]

Parameters:

  • value (Opject)

    The literal object.



12
13
14
# File 'lib/clean_ripper_doc.rb', line 12

def lit(value)
  
end

#string(*parts) ⇒ Object

An interpolated string.

Examples:

"teste: #{var}"
#=> [:string, [:lit, "teste: "], [:lvar, :var]]
"a#{2}b"
#=> [:string, [:lit, "a"], [:lit, 2], [:lit, "b"]]

Parameters:

  • parts (Sexp)

    All parts of the string.



58
59
60
# File 'lib/clean_ripper_doc.rb', line 58

def string(*parts)
  
end

#unary(operator, receiver) ⇒ Object

An unary operation.

Examples:

-a     #=> [:unary, :-, [:lvar, :a]]
!b     #=> [:unary, :!, [:lvar, :b]]

Parameters:

  • receiver (Sexp)

    The receiver of the operation.

  • operator (Symbol)

    The operator.



33
34
35
# File 'lib/clean_ripper_doc.rb', line 33

def unary(operator, receiver)
  
end