Class: Code::Parser::Code

Inherits:
Language
  • Object
show all
Defined in:
lib/code/parser/code.rb

Instance Method Summary collapse

Instance Method Details

#presentObject



18
19
20
# File 'lib/code/parser/code.rb', line 18

def present
  (whitespace? << statement << whitespace?).repeat(1)
end

#rootObject



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

def root
  present | whitespace?
end

#statementObject



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

def statement
  Statement
end

#whitespaceObject



6
7
8
# File 'lib/code/parser/code.rb', line 6

def whitespace
  Whitespace
end

#whitespace?Boolean

Returns:



10
11
12
# File 'lib/code/parser/code.rb', line 10

def whitespace?
  whitespace.maybe
end