MES20152 / kuniri

http://kuniri.github.io/kuniri/
GNU Affero General Public License v3.0
0 stars 0 forks source link

Handling one line method/function/constructor #3

Open simiaosimis opened 9 years ago

simiaosimis commented 9 years ago

Problem: Kuniri can't handle multiple method/function/constructor declaration in a single line. Description: Kuniri should indentify the ';' and process the rest of the string as a new line.

def xpto(a, b) a + b end; def abc() "abc" end; def lalala() 12 end; def xpto(a, b) a if a > b else b end

Those code have a valid syntax on ruby, and Kuniri does not handling it.

Suggestion: I recommend to add extra manipulation in "lib/kuniri/language/ruby/function_behavior_ruby.rb"

Original: https://github.com/Kuniri/kuniri/issues/94

simiaosimis commented 9 years ago

One way of implementing it is spliting the line with pLine.split(/;/) and then identify if the parts are comment, string or regexes, in this case you should join their parts, otherwise you should delete the first element of the string (that will be the semicolon).