nilac 0.0.4.3.9.2 → 0.0.4.3.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/bin/nilac +9 -5748
  4. data/examples/StringMagic.nila +23 -0
  5. data/examples/countdown.nila +31 -0
  6. data/examples/decBin.nila +3 -3
  7. data/examples/marky.js +30 -0
  8. data/examples/marky.nila +23 -0
  9. data/lib/nilac/ErrorDeclarations.rb +11 -0
  10. data/lib/nilac/add_semicolons.rb +57 -0
  11. data/lib/nilac/compile_arrays.rb +266 -0
  12. data/lib/nilac/compile_blocks.rb +137 -0
  13. data/lib/nilac/compile_case_statement.rb +168 -0
  14. data/lib/nilac/compile_classes.rb +18 -0
  15. data/lib/nilac/compile_comments.rb +79 -0
  16. data/lib/nilac/compile_conditional_structures.rb +1378 -0
  17. data/lib/nilac/compile_custom_function_map.rb +45 -0
  18. data/lib/nilac/compile_default_values.rb +160 -0
  19. data/lib/nilac/compile_hashes.rb +123 -0
  20. data/lib/nilac/compile_heredocs.rb +62 -0
  21. data/lib/nilac/compile_integers.rb +23 -0
  22. data/lib/nilac/compile_interpolated_strings.rb +133 -0
  23. data/lib/nilac/compile_loops.rb +211 -0
  24. data/lib/nilac/compile_named_functions.rb +690 -0
  25. data/lib/nilac/compile_operators.rb +83 -0
  26. data/lib/nilac/compile_parallel_assignment.rb +103 -0
  27. data/lib/nilac/compile_ruby_methods.rb +58 -0
  28. data/lib/nilac/compile_special_keywords.rb +44 -0
  29. data/lib/nilac/compile_strings.rb +145 -0
  30. data/lib/nilac/compile_whitespace_delimited_functions.rb +97 -0
  31. data/lib/nilac/create_mac_executable.rb +25 -0
  32. data/lib/nilac/extract_parsable_file.rb +23 -0
  33. data/lib/nilac/find_all_matching_indices.rb +18 -0
  34. data/lib/nilac/find_file_name.rb +13 -0
  35. data/lib/nilac/find_file_path.rb +13 -0
  36. data/lib/nilac/get_variables.rb +123 -0
  37. data/lib/nilac/output_javascript.rb +13 -0
  38. data/lib/nilac/parse_arguments.rb +41 -0
  39. data/lib/nilac/pretty_print_javascript.rb +457 -0
  40. data/lib/nilac/read_file_line_by_line.rb +11 -0
  41. data/lib/nilac/remove_question_marks.rb +46 -0
  42. data/lib/nilac/replace_multiline_comments.rb +92 -0
  43. data/lib/nilac/replace_named_functions.rb +154 -0
  44. data/lib/nilac/replace_singleline_comments.rb +45 -0
  45. data/lib/nilac/replace_strings.rb +35 -0
  46. data/lib/nilac/split_semicolon_seperated_expressions.rb +39 -0
  47. data/lib/nilac/strToArray.rb +15 -0
  48. data/lib/nilac/version.rb +1 -1
  49. data/lib/nilac.rb +324 -1
  50. data/nilac.gemspec +0 -1
  51. data/shark/features/add_auto_return_statement.feature +1 -1
  52. data/shark/features/array_and_string_indexing.feature +1 -1
  53. data/shark/features/barebones_compilation.feature +1 -1
  54. data/shark/features/case_when.feature +1 -1
  55. data/shark/features/default_method_parameters.feature +1 -1
  56. data/shark/features/fix_newlines.feature +1 -1
  57. data/shark/features/hashes.feature +1 -1
  58. data/shark/features/heredoc.feature +1 -1
  59. data/shark/features/if_then_else.feature +1 -1
  60. data/shark/features/loop.feature +1 -1
  61. data/shark/features/method_multiple_return.feature +1 -1
  62. data/shark/features/multiline_array.feature +1 -1
  63. data/shark/features/multiple_variable_initialization.feature +1 -1
  64. data/shark/features/numbers.feature +1 -1
  65. data/shark/features/regular_for.feature +1 -1
  66. data/shark/features/regular_if.feature +1 -1
  67. data/shark/features/regular_while.feature +1 -1
  68. data/shark/features/ruby_methods.feature +1 -1
  69. data/shark/features/ruby_operators.feature +1 -1
  70. data/shark/features/splats.feature +1 -1
  71. data/shark/features/string_interpolation.feature +1 -1
  72. data/shark/features/strings.feature +1 -1
  73. data/shark/features/times.feature +1 -1
  74. data/shark/features/unless_until.feature +1 -1
  75. data/shark/features/whitespace_delimitation.feature +1 -1
  76. metadata +46 -18
  77. data/src/nilac.rb +0 -5753
@@ -0,0 +1,690 @@
1
+ require_relative 'strToArray'
2
+
3
+ require_relative 'read_file_line_by_line'
4
+
5
+ def compile_named_functions(input_file_contents, named_code_blocks, nested_functions, temporary_nila_file)
6
+
7
+ #This method compiles all the named Nila functions. Below is an example of what is meant
8
+ #by named/explicit function
9
+
10
+ #def square(input_number)
11
+ #
12
+ # input_number*input_number
13
+ #
14
+ #end
15
+
16
+ #The above function will compile to
17
+
18
+ #square = function(input_number) {
19
+ #
20
+ # return input_number*input_number;
21
+ #
22
+ #};
23
+
24
+ def is_parameterless?(input_function_block)
25
+
26
+ if input_function_block[0].include?("(")
27
+
28
+ false
29
+
30
+ else
31
+
32
+ true
33
+
34
+ end
35
+
36
+ end
37
+
38
+ def lexical_scoped_variables(input_function_block)
39
+
40
+ #This method will pickup and declare all the variables inside a function block. In future, this method will be
41
+ #merged with the get variables method
42
+
43
+ def replace_strings(input_string)
44
+
45
+ element = input_string.gsub("==", "equalequal")
46
+
47
+ element = element.gsub("!=", "notequal")
48
+
49
+ element = element.gsub("+=", "plusequal")
50
+
51
+ element = element.gsub("-=", "minusequal")
52
+
53
+ element = element.gsub("*=", "multiequal")
54
+
55
+ element = element.gsub("/=", "divequal")
56
+
57
+ element = element.gsub("%=", "modequal")
58
+
59
+ element = element.gsub("=~", "matchequal")
60
+
61
+ element = element.gsub(">=", "greatequal")
62
+
63
+ input_string = element.gsub("<=", "lessyequal")
64
+
65
+ string_counter = 0
66
+
67
+ while input_string.include?("\"")
68
+
69
+ string_extract = input_string[input_string.index("\"")..input_string.index("\"",input_string.index("\"")+1)]
70
+
71
+ input_string = input_string.sub(string_extract,"--repstring#{string_counter}")
72
+
73
+ string_counter += 1
74
+
75
+ end
76
+
77
+ while input_string.include?("'")
78
+
79
+ string_extract = input_string[input_string.index("'")..input_string.index("'",input_string.index("'")+1)]
80
+
81
+ input_string = input_string.sub(string_extract,"--repstring#{string_counter}")
82
+
83
+ string_counter += 1
84
+
85
+ end
86
+
87
+ return input_string
88
+
89
+ end
90
+
91
+ input_function_block = input_function_block.collect {|element| replace_strings(element)}
92
+
93
+ controlregexp = /(if |Euuf |for |while |def |function |function\()/
94
+
95
+ variables = []
96
+
97
+ function_name, parameters = input_function_block[0].split("(")
98
+
99
+ parameters = parameters.split(")")[0].split(",")
100
+
101
+ parameters = parameters.collect { |element| element.strip }
102
+
103
+ input_function_block.each do |line|
104
+
105
+ if line.include? "=" and line.index(controlregexp).nil?
106
+
107
+ current_line_split = line.strip.split("=")
108
+
109
+ variables << current_line_split[0].rstrip
110
+
111
+ end
112
+
113
+ end
114
+
115
+ parameters.each do |param|
116
+
117
+ if variables.include?(param)
118
+
119
+ variables.delete(param)
120
+
121
+ end
122
+
123
+ end
124
+
125
+ if variables.empty?
126
+
127
+ return []
128
+
129
+ else
130
+
131
+ return variables.uniq.sort
132
+
133
+ end
134
+
135
+ end
136
+
137
+ def remove_question_marks(input_file_contents, input_list, temporary_nila_file)
138
+
139
+ joined_file_contents = input_file_contents.join
140
+
141
+ input_list.each do |element|
142
+
143
+ if element.include? "?"
144
+
145
+ joined_file_contents = joined_file_contents.gsub(element, element[0...-1])
146
+
147
+ end
148
+
149
+ end
150
+
151
+ file_id = open(temporary_nila_file, 'w')
152
+
153
+ file_id.write(joined_file_contents)
154
+
155
+ file_id.close()
156
+
157
+ line_by_line_contents = read_file_line_by_line(temporary_nila_file)
158
+
159
+ return line_by_line_contents
160
+
161
+ end
162
+
163
+ def add_auto_return_statement(input_array)
164
+
165
+ joined_array = input_array.join
166
+
167
+ reversed_input_array = input_array.reverse
168
+
169
+ if !joined_array.include?("return ")
170
+
171
+ rejected_array = reversed_input_array.reject { |content| content.lstrip.eql?("") }
172
+
173
+ rejected_array = rejected_array.reject {|content| content.strip.eql?("")}
174
+
175
+ rejected_array = rejected_array[1..-1]
176
+
177
+ if !rejected_array[0].strip.eql?("}")
178
+
179
+ if !rejected_array[0].strip.eql?("end") and !rejected_array[0].strip.include?("--single_line_comment")
180
+
181
+ last_statement = rejected_array[0]
182
+
183
+ replacement_string = "return #{last_statement.lstrip}"
184
+
185
+ input_array[input_array.index(last_statement)] = replacement_string
186
+
187
+ end
188
+
189
+ end
190
+
191
+ end
192
+
193
+ return input_array
194
+
195
+ end
196
+
197
+ def compile_multiple_return(input_array)
198
+
199
+ def find_all_matching_indices(input_string, pattern)
200
+
201
+ locations = []
202
+
203
+ index = input_string.index(pattern)
204
+
205
+ while index != nil
206
+
207
+ locations << index
208
+
209
+ index = input_string.index(pattern, index+1)
210
+
211
+
212
+ end
213
+
214
+ return locations
215
+
216
+
217
+ end
218
+
219
+ modified_input_array = input_array.dup
220
+
221
+ return_statements = input_array.dup.reject { |element| !element.include? "return" }
222
+
223
+ multiple_return_statements = return_statements.dup.reject { |element| !element.include? "," }
224
+
225
+ modified_multiple_return_statements = multiple_return_statements.dup
226
+
227
+ return_statement_index = []
228
+
229
+ multiple_return_statements.each do |statement|
230
+
231
+ location_array = modified_input_array.each_index.select { |index| modified_input_array[index] == statement }
232
+
233
+ return_statement_index << location_array[0]
234
+
235
+ end
236
+
237
+ multiple_return_statements.each_with_index do |return_statement, index|
238
+
239
+ replacement_counter = 0
240
+
241
+ if return_statement.include? "\""
242
+
243
+ starting_quotes = find_all_matching_indices(return_statement, "\"")
244
+
245
+ for x in 0...(starting_quotes.length)/2
246
+
247
+ quotes = return_statement[starting_quotes[x]..starting_quotes[x+1]]
248
+
249
+ replacement_counter += 1
250
+
251
+ modified_multiple_return_statements[index] = modified_multiple_return_statements[index].sub(quotes, "repstring#{1}")
252
+
253
+ modified_input_array[return_statement_index[index]] = modified_multiple_return_statements[index].sub(quotes, "repstring#{1}")
254
+
255
+ end
256
+
257
+ end
258
+
259
+ end
260
+
261
+ modified_multiple_return_statements = modified_multiple_return_statements.reject { |element| !element.include? "," }
262
+
263
+ return_statement_index = []
264
+
265
+ modified_multiple_return_statements.each do |statement|
266
+
267
+ location_array = modified_input_array.each_index.select { |index| modified_input_array[index] == statement }
268
+
269
+ return_statement_index << location_array[0]
270
+
271
+ end
272
+
273
+ modified_multiple_return_statements.each_with_index do |return_statement, index|
274
+
275
+ method_call_counter = 0
276
+
277
+ if return_statement.include? "("
278
+
279
+ open_paran_location = find_all_matching_indices(return_statement, "(")
280
+
281
+ open_paran_location.each do |paran_index|
282
+
283
+ method_call = return_statement[paran_index..return_statement.index(")", paran_index+1)]
284
+
285
+ method_call_counter += 1
286
+
287
+ modified_multiple_return_statements[index] = modified_multiple_return_statements[index].sub(method_call, "methodcall#{method_call_counter}")
288
+
289
+ modified_input_array[return_statement_index[index]] = modified_multiple_return_statements[index].sub(method_call, "methodcall#{method_call_counter}")
290
+
291
+ end
292
+
293
+ end
294
+
295
+ end
296
+
297
+ modified_multiple_return_statements = modified_multiple_return_statements.reject { |element| !element.include?(",") }
298
+
299
+ return_statement_index = []
300
+
301
+ modified_multiple_return_statements.each do |statement|
302
+
303
+ location_array = modified_input_array.each_index.select { |index| modified_input_array[index] == statement }
304
+
305
+ return_statement_index << location_array[0]
306
+
307
+ end
308
+
309
+ return_statement_index.each do |index|
310
+
311
+ original_statement = input_array[index]
312
+
313
+ statement_split = original_statement.split("return ")
314
+
315
+ replacement_split = "return [" + statement_split[1].rstrip + "]\n\n"
316
+
317
+ input_array[index] = replacement_split
318
+
319
+ end
320
+
321
+ return input_array
322
+
323
+ end
324
+
325
+ def coffee_type_function(input_array)
326
+
327
+ function_name = input_array[0].split("function ")[1].split("(")[0].lstrip
328
+
329
+ input_array[0] = "#{function_name} = function(" + input_array[0].split("function ")[1].split("(")[1].lstrip
330
+
331
+ return input_array
332
+
333
+ end
334
+
335
+ def compile_function(input_array, temporary_nila_file)
336
+
337
+ modified_input_array = input_array.dup
338
+
339
+ if is_parameterless?(modified_input_array)
340
+
341
+ if modified_input_array[0].include?("--single")
342
+
343
+ modified_input_array[0] = input_array[0].sub "def", "function"
344
+
345
+ interim_string = modified_input_array[0].split("--single")
346
+
347
+ modified_input_array[0] = interim_string[0].rstrip + "() {\n--single" + interim_string[1]
348
+
349
+
350
+ elsif modified_input_array[0].include?("--multi")
351
+
352
+ modified_input_array[0] = input_array[0].sub "def", "function"
353
+
354
+ interim_string = modified_input_array[0].split("--multi")
355
+
356
+ modified_input_array[0] = interim_string[0].rstrip + "() {\n--multi" + interim_string[1]
357
+
358
+ else
359
+
360
+ modified_input_array[0] = input_array[0].sub "def", "function"
361
+
362
+ modified_input_array[0] = modified_input_array[0].rstrip + "() {\n"
363
+
364
+ end
365
+
366
+ else
367
+
368
+ if modified_input_array[0].include?("--single")
369
+
370
+ modified_input_array[0] = input_array[0].sub "def", "function"
371
+
372
+ interim_string = modified_input_array[0].split("--single")
373
+
374
+ modified_input_array[0] = interim_string[0].rstrip + " {\n--single" + interim_string[1]
375
+
376
+
377
+ elsif modified_input_array[0].include?("--multi")
378
+
379
+ modified_input_array[0] = input_array[0].sub "def", "function"
380
+
381
+ interim_string = modified_input_array[0].split("--multi")
382
+
383
+ modified_input_array[0] = interim_string[0].rstrip + " {\n--multi" + interim_string[1]
384
+
385
+ else
386
+
387
+ modified_input_array[0] = input_array[0].sub "def", "function"
388
+
389
+ modified_input_array[0] = modified_input_array[0].rstrip + " {\n"
390
+
391
+ end
392
+
393
+ end
394
+
395
+ modified_input_array[-1] = input_array[-1].sub "end", "};\n"
396
+
397
+ modified_input_array = compile_parallel_assignment(modified_input_array, temporary_nila_file)
398
+
399
+ modified_input_array = compile_multiple_ruby_func_calls(modified_input_array)
400
+
401
+ modified_input_array = add_auto_return_statement(modified_input_array)
402
+
403
+ modified_input_array = compile_multiple_return(modified_input_array)
404
+
405
+ modified_input_array = coffee_type_function(modified_input_array)
406
+
407
+ modified_input_array = compile_splats(modified_input_array)
408
+
409
+ variables = lexical_scoped_variables(modified_input_array)
410
+
411
+ if !variables.empty?
412
+
413
+ variable_string = "\nvar " + variables.join(", ") + "\n"
414
+
415
+ modified_input_array.insert(1, variable_string)
416
+
417
+ end
418
+
419
+ modified_input_array = remove_question_marks(modified_input_array, variables, temporary_nila_file)
420
+
421
+ return modified_input_array
422
+
423
+ end
424
+
425
+ def extract_function_name(input_code_block)
426
+
427
+ first_line = input_code_block[0]
428
+
429
+ first_line_split = first_line.split(" ")
430
+
431
+ if first_line_split[1].include?("(")
432
+
433
+ function_name, parameters = first_line_split[1].split("(")
434
+
435
+ else
436
+
437
+ function_name = first_line_split[1]
438
+
439
+ end
440
+
441
+ return function_name
442
+
443
+ end
444
+
445
+ def compile_splats(input_function_block)
446
+
447
+ def errorFree(function_params,optional_param)
448
+
449
+ # This method checks for use cases in complex arguments where a default argument is used
450
+ # after an optional argument. This will result in erroneous output. So this method will
451
+ # stop it from happening.
452
+
453
+ # Example:
454
+ # def method_name(a,b,*c,d = 1,c,e)
455
+
456
+ after_splat = function_params[function_params.index(optional_param)+1..-1]
457
+
458
+ if after_splat.reject {|element| !element.include?("=")}.empty?
459
+
460
+ true
461
+
462
+ else
463
+
464
+ raise "You cannot have a default argument after an optional argument!"
465
+
466
+ false
467
+
468
+ end
469
+
470
+ end
471
+
472
+ function_params = input_function_block[0].split("function(")[1].split(")")[0].split(",")
473
+
474
+ unless function_params.reject{|element| !replace_strings(element).include?("*")}.empty?
475
+
476
+ mod_function_params = function_params.reject {|element| replace_strings(element).include?("*")}
477
+
478
+ opt_index = 0
479
+
480
+ # If there are multiple optional params declared by mistake, only the first optional param is used.
481
+
482
+ optional_param = function_params.reject {|element| !replace_strings(element).include?("*")}[0]
483
+
484
+ if function_params.index(optional_param).eql?(function_params.length-1)
485
+
486
+ mod_function_params.each_with_index do |param,index|
487
+
488
+ input_function_block.insert(index+1,"#{param} = arguments[#{index}]\n\n")
489
+
490
+ opt_index = index + 1
491
+
492
+ end
493
+
494
+ replacement_string = "#{optional_param.gsub("*","")} = []\n\n"
495
+
496
+ replacement_string += "for (var i=#{opt_index};i<arguments.length;i++) {\n #{optional_param.gsub("*","")}.push(arguments[i]); \n}\n\n"
497
+
498
+ input_function_block.insert(opt_index+1,replacement_string)
499
+
500
+ input_function_block[0] = input_function_block[0].sub(function_params.join(","),"")
501
+
502
+ else
503
+
504
+ before_splat = function_params[0...function_params.index(optional_param)]
505
+
506
+ after_splat = function_params[function_params.index(optional_param)+1..-1]
507
+
508
+ cont_index = 0
509
+
510
+ if errorFree(function_params,optional_param)
511
+
512
+ before_splat.each_with_index do |param,index|
513
+
514
+ input_function_block.insert(index+1,"#{param} = arguments[#{index}]\n\n")
515
+
516
+ cont_index = index + 1
517
+
518
+ end
519
+
520
+ after_splat.each_with_index do |param,index|
521
+
522
+ input_function_block.insert(cont_index+1,"#{param} = arguments[arguments.length-#{after_splat.length - index}]\n\n")
523
+
524
+ cont_index = cont_index + 1
525
+
526
+ end
527
+
528
+ replacement_string = "#{optional_param.gsub("*","")} = []\n\n"
529
+
530
+ replacement_string += "for (var i=#{function_params.index(optional_param)};i < arguments.length-#{after_splat.length};i++) {\n #{optional_param.gsub("*","")}.push(arguments[i]); \n}\n\n"
531
+
532
+ input_function_block.insert(cont_index+1,replacement_string)
533
+
534
+ input_function_block[0] = input_function_block[0].sub(function_params.join(","),"")
535
+
536
+ end
537
+
538
+ end
539
+
540
+ end
541
+
542
+ return strToArray(input_function_block.join)
543
+
544
+ end
545
+
546
+ def compile_multiple_ruby_func_calls(input_file_contents)
547
+
548
+ def replace_strings(input_string)
549
+
550
+ string_counter = 0
551
+
552
+ if input_string.count("\"") % 2 == 0
553
+
554
+ while input_string.include?("\"")
555
+
556
+ string_extract = input_string[input_string.index("\"")..input_string.index("\"",input_string.index("\"")+1)]
557
+
558
+ input_string = input_string.sub(string_extract,"--repstring#{string_counter}")
559
+
560
+ string_counter += 1
561
+
562
+ end
563
+
564
+ end
565
+
566
+ if input_string.count("'") % 2 == 0
567
+
568
+ while input_string.include?("'")
569
+
570
+ string_extract = input_string[input_string.index("'")..input_string.index("'",input_string.index("'")+1)]
571
+
572
+ input_string = input_string.sub(string_extract,"--repstring#{string_counter}")
573
+
574
+ string_counter += 1
575
+
576
+ end
577
+
578
+ end
579
+
580
+ input_string = input_string.gsub(/\((\w{0,},)*\w{0,}\)/,"--$k$")
581
+
582
+ return input_string
583
+
584
+ end
585
+
586
+ function_calls = []
587
+
588
+ replacement_calls = []
589
+
590
+ function_map = %w{puts p print}
591
+
592
+ javascript_regexp = /(if |for |while |\(function\(|= function\(|((=|:)\s+\{))/
593
+
594
+ stringified_input = input_file_contents.collect {|element| replace_strings(element)}
595
+
596
+ function_map.each do |func|
597
+
598
+ func_calls = input_file_contents.reject {|line| !(line.include?(func+"(") or line.include?(func+" ") and line.index(javascript_regexp) == nil)}
599
+
600
+ modified_func_calls = func_calls.collect {|element| replace_strings(element)}
601
+
602
+ modified_func_calls = modified_func_calls.reject {|element| !element.include?(",")}
603
+
604
+ call_collector = []
605
+
606
+ modified_func_calls.each_with_index do |ele|
607
+
608
+ call_collector << input_file_contents[stringified_input.index(ele)]
609
+
610
+ end
611
+
612
+ function_calls << modified_func_calls
613
+
614
+ rep_calls = []
615
+
616
+ call_collector.each do |fcall|
617
+
618
+ multiple_call = fcall.split(func)[1].split(",")
619
+
620
+ multiple_call = multiple_call.collect {|element| "\n#{func} " + element.strip + "\n\n"}
621
+
622
+ rep_calls << multiple_call.join
623
+
624
+ end
625
+
626
+ replacement_calls << rep_calls
627
+
628
+ end
629
+
630
+ replacement_calls = replacement_calls.flatten
631
+
632
+ function_calls = function_calls.flatten
633
+
634
+ function_calls.each_with_index do |fcall,index|
635
+
636
+ input_file_contents[stringified_input.index(fcall)] = replacement_calls[index]
637
+
638
+ end
639
+
640
+ return strToArray(input_file_contents.join)
641
+
642
+ end
643
+
644
+ joined_file_contents = input_file_contents.join
645
+
646
+ unless named_code_blocks.empty?
647
+
648
+ codeblock_counter = 1
649
+
650
+ function_names = []
651
+
652
+ named_code_blocks.each do |codeblock|
653
+
654
+ function_names[codeblock_counter-1] = []
655
+
656
+ joined_file_contents = joined_file_contents.sub("--named_function[#{codeblock_counter}]\n", compile_function(codeblock, temporary_nila_file).join)
657
+
658
+ codeblock_counter += 1
659
+
660
+ current_nested_functions = nested_functions[codeblock_counter-2]
661
+
662
+ function_names[codeblock_counter-2] << extract_function_name(codeblock)
663
+
664
+ current_nested_functions.each do |nested_function|
665
+
666
+ function_names[codeblock_counter-2] << extract_function_name(nested_function)
667
+
668
+ joined_file_contents = joined_file_contents.sub(nested_function.join, compile_function(nested_function, temporary_nila_file).join)
669
+
670
+ end
671
+
672
+ end
673
+
674
+ else
675
+
676
+ function_names = []
677
+
678
+ end
679
+
680
+ file_id = open(temporary_nila_file, 'w')
681
+
682
+ file_id.write(joined_file_contents)
683
+
684
+ file_id.close()
685
+
686
+ line_by_line_contents = compile_multiple_ruby_func_calls(read_file_line_by_line(temporary_nila_file))
687
+
688
+ return line_by_line_contents, function_names
689
+
690
+ end