Module: Yoga::Parser

Defined in:
lib/yoga/parser.rb,
lib/yoga/parser/helpers.rb

Overview

A parsing helper.

This uses the @tokens and @_root instance variables.

Defined Under Namespace

Modules: Helpers

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Internal ruby construct.



30
31
32
# File 'lib/yoga/parser.rb', line 30

def self.included(base)
  base.send :include, Parser::Helpers
end

Instance Method Details

#callYoga::Node

Performs the parsing.

Returns:



22
23
24
# File 'lib/yoga/parser.rb', line 22

def call
  @_root ||= parse_root
end

#initialize(tokens) ⇒ Object

Initialize the parser.

Parameters:



14
15
16
17
# File 'lib/yoga/parser.rb', line 14

def initialize(tokens)
  @tokens = tokens
  @buffer = []
end