21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/xdry/parsing/parsers.rb', line 21
def parse_line! line, , indent
case line
when /^@interface\s+(\w+)\s*;/
name = $1
when /^@protocol\s+(\w+)\s*;/
name = $1
when /^@interface\s+(\w+)/ name, supers, postfix = $1, $2, $'
yield NInterfaceStart.new(name)
yield NOpeningBrace.new if postfix =~ /\{$/
when /^@implementation\s+(\w+)/
name = $1
yield NImplementationStart.new(name)
when /^@protocol\s+(\w+)\s*;/
puts "PREDEF protocol #{$1}"
when /^#define\s+(\w+)/
word = $1
yield NDefine.new(word)
end
end
|