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

Batch Script syntax highlighting issues #47297

Closed
11 tasks
Kroc opened this issue Apr 6, 2018 · 2 comments
Closed
11 tasks

Batch Script syntax highlighting issues #47297

Kroc opened this issue Apr 6, 2018 · 2 comments
Assignees
Labels
languages-basic Basic language support issues

Comments

@Kroc
Copy link

Kroc commented Apr 6, 2018

Issue Type: Bug

There are a handful of highlighting issues with Windows Batch files:

  • ECHO: is not recognised, when ECHO. is; ECHO: is faster as it does not do a file lookup! -- see: https://ss64.com/nt/echo.html

  • The OFF in ECHO OFF is not highlighted

  • The following code gets highlighting confused (the "$... seems to throw it off)

    vscode_batch_syntax

  • No space between GOTO and the label name does not highlight correctly; i.e. GOTO:EOF

  • CLS keyword is not highlighted

  • EQU / NOT and other comparison operators are not highlighted

  • IN & DO are not highlighted

  • command concatenator &, and the pipe operators >, | are not highlighted nor pipe numbers for redirection, e.g. >NUL 2>&1 (a common way to suppress all output)

  • error-suppressor @ is not highlighted in any way; this needs to be highlighted when used with a command, but not within 'strings' (which may or may not be quoted, according to command used)

  • ENABLEEXTENSIONS / DISABLEDELAYEDEXPANSION etc. not highlighted along with SETLOCAL

  • Syntax break-down here: (looks like the quoted paren-escape failed to be noticed)

    vscode_batch_syntax2


Aside: What would be the best way to broach a discussion on using a PEG-based parser, rather than the regex-infused TextMate system for VSCode? Windows Batch files happen to be one of the best examples of extremely complex mode-like behaviour that would be easily and elegantly handled by a real state machine based approach using PEG/EBNF grammars. Grammar based parsing would also be readily shareable between language servers and other external software.


VS Code version: Code 1.22.1 (950b8b0, 2018-04-06T02:26:57.615Z)
OS version: Windows_NT x64 10.0.16299

Extensions: none

@aeschli
Copy link
Contributor

aeschli commented Apr 6, 2018

This issue was moved to mmims/language-batchfile#26

@aeschli aeschli closed this as completed Apr 6, 2018
@mmims
Copy link

mmims commented Apr 18, 2018

Fixes for these issues (mmims/language-batchfile@6235c49) are ready to be merged.

@vscodebot vscodebot bot locked and limited conversation to collaborators May 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
languages-basic Basic language support issues
Projects
None yet
Development

No branches or pull requests

3 participants