Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Documentation missing command in documentation: "ENDLOCAL" is in command list documentation, but "ENDTEXT" is not.

Jul
254
6
TL;DR: "endlocal" and "text" are both valid commands but only 1 is listed in the documentation list of valid commands.

So I'm writing a validator and it brought this to my attention.

"Setlocal" and "endlocal" passed my validator as valid commands
"text" did but "endtext" did not

Turns out, for setlocal/endlocal, both the 'begin' and 'end' commands are in the command list documentation

But for text/endtext, only the 'begin' command is in the command list documentation.

It's a minor inconsistency, and not a bug, but it's an inconsistency nonetheless.

Anyone gathering a list of commands from the documentation is getting an incomplete list, which is what happened to me.
 
Well, technically.... ENDLOCAL is a command, but ENDTEXT is just a keyword like THEN, ELSE, or WHILE:

Code:
C:\>endlocal
TCC: Missing SETLOCAL

C:\>endtext
TCC: Unknown command "endtext"

C:\>then
TCC: Unknown command "then"

C:\>else
TCC: Unknown command "else"

C:\>while
TCC: Unknown command "while"

C:\>

It would be handy to have it in the list, though. You want to pick up such keywords when e.g. adding TCC to a syntax-highlighting text editor.
 
It would be handy to have it in the list, though. You want to pick up such keywords when e.g. adding TCC to a syntax-highlighting text editor.

That's basically what I'm getting at.

My validator isn't highlighting syntax but it is warning me of any command that isn't in my path or isn't an internal command, which is how I found this!

Regardless of what types of entities they are under the hood, to someone over the hood, it's a bit inconsistent.


[Side-note: It's not actually a validator, I'm writing a dependency generator for my BAT files. Validation just happened to be an unintended side-effect.]
 
Here are a few more "command-like" keywords:

ELSEIFF, ELSE, ENDIFF
ITERATE, LEAVE, ENDDO
CASE, DEFAULT, ENDSWITCH
ENDCOMMENT
 
OMG Charles, thank you so much!! I probably would have just hoped I'd never run into one, and if I did, have gone and had to add it to the code of my validator one at a time as i ran into them over the course of my life.

Better to do it all now and be done with it.

Perhaps in reality, the documentation should have a section like this, for people like us who want to parse TCC script.
 
ENDTEXT is definitely NOT a command. It's not even a "sort-of" command like ELSE that is recognized by the parser. It is only recognized by the TEXT command when it's scanning for the end.

ENDLOCAL is very much a stand-alone command.

The Take Command SDK has a list of all of the commands (including ELSE, ENDIFF, ENDO, etc.) in the file "commands".
 
Fair enough.
I was unaware there was an SDK.

I guess a keyword list would be nice, but I'm figuring my situation out without one, and also thanks to Charle's shelp.


I believe I found a typo in documentation?

1686499248949.png



```
|:aPiped output is ANSI
|:uPiped output is UTF16 Unicode
|:8 or I:u8Piped output is UTF8

```

Looks like there is a capital "I" in place of the pipe symbol right before the ":u8". Not obvious in the forum font here, but obvious in the actual help file viewer.

i could send this one in email?
 

Similar threads

Back
Top