Class: BigKeeper::OCCodeOperator

Inherits:
Object
  • Object
show all
Defined in:
lib/big_keeper/util/code_operator.rb

Class Method Summary collapse

Class Method Details

.in_note_code(line_hash) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/big_keeper/util/code_operator.rb', line 8

def in_note_code(line_hash)
  line = line_hash["line"]
  in_note = line_hash["in_note"]
  line = line.strip
  if in_note
    line_hash["line"]=""
    if (line.include?("*/"))
      line_hash["in_note"] = false
    end
    return
  end
  if line[0,2] == "//" || line[0,7] == "#pragma"
    line_hash["line"]=""
    return
  end
  if line.include?("/*")
    line_hash["in_note"] = true
    before_line = line[line.index("/*")+1...line.size]
    if before_line.include?("*/")
      line_hash["in_note"] = false
    end
    line_hash["line"] = line[0,line.index("/*")]
    return
  end

end