Sha256: 5354e94e36b32b8e3fb3eb7f698aa6fd3d0a9390d7a0260373f10284380cc6ac

Contents?: true

Size: 568 Bytes

Versions: 18

Compression:

Stored size: 568 Bytes

Contents

class Code
  class Parser
    class UnaryMinus < ::Code::Parser
      def parse
        if match(MINUS)
          previous_cursor = cursor
          comments = parse_comments
          right = parse_subclass(::Code::Parser::UnaryMinus)

          if right
            { unary_minus: { right: right, comments: comments }.compact }
          else
            @cursor = previous_cursor
            buffer!
            parse_subclass(::Code::Parser::Power)
          end
        else
          parse_subclass(::Code::Parser::Power)
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
template-ruby-parser-0.1.8 lib/code/parser/unary_minus.rb
code-ruby-parser-0.1.8 lib/code/parser/unary_minus.rb
template-ruby-parser-0.1.7 lib/code/parser/unary_minus.rb
code-ruby-parser-0.1.7 lib/code/parser/unary_minus.rb
template-ruby-parser-0.1.6 lib/code/parser/unary_minus.rb
code-ruby-parser-0.1.6 lib/code/parser/unary_minus.rb
template-ruby-parser-0.1.5 lib/code/parser/unary_minus.rb
code-ruby-parser-0.1.5 lib/code/parser/unary_minus.rb
template-ruby-parser-0.1.4 lib/code/parser/unary_minus.rb
code-ruby-parser-0.1.4 lib/code/parser/unary_minus.rb
template-ruby-parser-0.1.3 lib/code/parser/unary_minus.rb
code-ruby-parser-0.1.3 lib/code/parser/unary_minus.rb
template-ruby-parser-0.1.2 lib/code/parser/unary_minus.rb
code-ruby-parser-0.1.2 lib/code/parser/unary_minus.rb
template-ruby-parser-0.1.1 lib/code/parser/unary_minus.rb
code-ruby-parser-0.1.1 lib/code/parser/unary_minus.rb
template-ruby-parser-0.1.0 lib/code/parser/unary_minus.rb
code-ruby-parser-0.1.0 lib/code/parser/unary_minus.rb