kuniri
kuniri copied to clipboard
Add pre-parse module
Add pre-parse to Kuniri to handle basic stuffs before it starts to parse all the code. The first thing to handle is multiple lines with "+". For example:
stringLa = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio." +
"Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum" +
"imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper"
It is important to build a specific structure for pre-parse, because we will find many other cases in the future to add to this part.
This issue will solve #173
New stuffs for pre-parser:
- Convert 'do ... end' to '{...}' in all cases
- Join break lines with '+'
- Remove comments and save it in a hash
- Handle blocks divided in different lines to a common syntax. E.g.:
lambda do |x, y|
...
end
lambda do
|k,l|
end
lambda do |
x, y|
end