vim-crunch
vim-crunch copied to clipboard
add expression separator `;` to support one line variable
Nice idea, please add an small example of using this to the docs and a simple test. Let me know if you have any questions.
@arecarn Add an example in doc and also a test case.
Hi @arecarn , any update for this PR?
Hi @hiberabyss I don't have any updates yet, but I will get to it soon.
@hiberabyss I finally got a chance to look at this and found it doesn't play well with the evaluation of expressions that with a crunch comments.
e.g.
" a = 1; b = 2; a + b
evaluates to
" a = 1; b = 2; a + b = Crunch error: value for a not found;
I would expect nothing to happen since this should be a comment that gets ignored by crunch.
" a = 1; b = 2; a + b
I also don't feel the motivation to dig into this feature to make it work in all cases. The good news is that someday I would like creating an actual parser for crunch and it would include semicolons to separate expression on a single line.
Hi @arecarn , for this case, I think the comment lines and invalid lines should be removed before evaluating.
@hiberabyss good point.