-
Notifications
You must be signed in to change notification settings - Fork 9
add expression separator ;
to support one line variable
#55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
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. |
@@ -78,7 +78,10 @@ function! crunch#eval(exprs) abort "{{{2 | |||
" Decho '== Inizilation ==' | |||
let s:variables = deepcopy(g:crunch_user_variables, 0) | |||
|
|||
let expr_list = split(a:exprs, '\n', 1) | |||
let separator_magic = "\t \t \t\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to study this a bit before the merge and see if it's possible to not use the magic separator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I didn't get any better method to remember the positions of ;
and \n
.
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.
evaluates to
I would expect nothing to happen since this should be a comment that gets ignored by crunch.
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. |
No description provided.