Skip to content
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

Handle powershell unexpected token with newline #2588

Merged
merged 6 commits into from
Jun 19, 2019
Merged

Handle powershell unexpected token with newline #2588

merged 6 commits into from
Jun 19, 2019

Conversation

zigford
Copy link
Contributor

@zigford zigford commented Jun 14, 2019

This is a small fix to the powershell handler when 2 newlines are directly after an unexpected token. Without the fix Ale spits out some nast callback errors.

Test included to capture it in future.

Example code that breaks the handler

{
    "" "

    }

" probably due to an unexpected token which
" contained a newline. Reset matchcount and
" continue to next set of matches
if ! l:match[1] | let l:matchcount = 0 | continue | endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write if !empty(l:match[1]), the l:item assignment below, and put let l:matchcount = 0 in else. No need to put an if statement all in one line for script files like this, and no need to continue when there's not a lot of code below.

@w0rp w0rp added this to In Review in Old Working List via automation Jun 16, 2019
@w0rp w0rp merged commit 9ad8fd6 into dense-analysis:master Jun 19, 2019
Old Working List automation moved this from In Review to Done Jun 19, 2019
@w0rp
Copy link
Member

w0rp commented Jun 19, 2019

Cheers! 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants