google / vroom

Launch vim tests
Apache License 2.0
274 stars 27 forks source link

Parsing @do arguments is broken #97

Open rburny opened 8 years ago

rburny commented 8 years ago

I have found a situation where I cannot pass data to a previously defined macro. Here is an example snippet:

  @macro (test)
  :echomsg "[]"
  ~ {res}
  @endmacro
  @do (test, res="[]")

which fails with ERROR on line 26: Unrecognized directive "do (test, res='[]')" The underlying issue is that each directive must much the following regexp: r'( .*) \(\s*([%><=\'"\w\d.+,$ ]*)\s*\)$' which doesn't allow square brackets.

Naive solution would be to simply extend this regexp to allow more characters. However, I suggest reimplementing @do completely. There are two reasons for that:

  File "/usr/local/google/home/rburny/vroom/vroom/actions.py", line 346, in ParseCall
    kwargs[k.strip()] = eval(v)
  File "<string>", line 1
    "1
     ^
SyntaxError: EOL while scanning string literal
groschovskiy commented 8 years ago

I will try to examine the problem and to solve it in the near future