Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
Add FOR shortcuts
Browse files Browse the repository at this point in the history
Allow briefer FOR statements:

    for do ...          ->  for %%_ in (:*) do ...
    for %%? do ...      ->  for %%? in (:range*) do ...
    for %%? N ...       ->  for %%? in (:range*N) ...

There must be whitespace after "do", the other delimiters ("=,;") will
not be recognised.  There must only be a single whitespace after the
variable for "do" or the number to be recognised.  A delayed variable is
assumed to be a number, use two spaces if that is not the case.

FOR /F has a new option "line", which sets "delims" and "eol" to NUL,
ensuring a complete line will be read (assuming "tokens" is still 1).
  • Loading branch information
adoxa committed Oct 13, 2019
1 parent 2dac4de commit 39a5e25
Show file tree
Hide file tree
Showing 5 changed files with 487 additions and 6 deletions.
11 changes: 8 additions & 3 deletions dll_enhancedbatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,15 @@ void hookCtrlCAborts(char aborts);
#define pGotoFlag cmd_addrs[23]
#define pForFbegin cmd_addrs[24]
#define pForFend cmd_addrs[25]
#define pParseFortoken cmd_addrs[26]
#define pLexBufPtr ((LPWSTR*)cmd_addrs[27])
#define pLexBufferend ((LPWSTR)cmd_addrs[28])
#define pForFoptions cmd_addrs[29]
#define pTokLen ((int*)cmd_addrs[30])

#ifdef _WIN64
#define OFFSETS 26
#define OFFSETS 31
#else
#define pSFWorkpassed ((char*)cmd_addrs[26])
#define OFFSETS 27
#define pSFWorkpassed ((char*)cmd_addrs[31])
#define OFFSETS 32
#endif
Loading

0 comments on commit 39a5e25

Please sign in to comment.