lib/luobo/token.rb in luobo-0.1.0 vs lib/luobo/token.rb in luobo-0.1.2
- old
+ new
@@ -6,9 +6,13 @@
def initialize ln, line, indent_level, processor_name, line_code = '', block_open = false
@ln, @line, @indent_level, @processor_name, @line_code = ln, line, indent_level, processor_name, line_code
@blocks = Array.new if block_open
end
+ def indent
+ " " * indent_level
+ end
+
# add a line to current block args, separate each line with "\n"
def add_block_code line
raise "block not opened in line #{:ln}" unless block_open?
line.chomp.split("\n").each do |ln|
@blocks << ln