Comments (5)
NOTE1: When a ":function_name" appears in the code between double quotes, it is not highlighted, which is the expected behavior.
Not aware of any issue with labels in quotes and I cannot consider why a label would be highlighted in quotes. So I have not done anything about it and not sure if I want to do more than necessary.
Before and after fix displayed in SciTE.
from lexilla.
NOTE1: When a ":function_name" appears in the code between double quotes, it is not highlighted, which is the expected behavior.
Not aware of any issue with labels in quotes and I cannot consider why a label would be highlighted in quotes. So I have not done anything about it and not sure if I want to do more than necessary.
The correction is perfect.
Regarding NOTE1, I think I expressed myself wrong, as it is not supposed to highlight functions in quotation marks. I just wanted to make it clear that this was not supposed to change with this fix :)
from lexilla.
Why is this patch styling goto
targets in SCE_BAT_COMMAND
as if they were commands? There is a difference in the current lexer between goto
and call
but that is OK since call
runs an external file command and goto
is just internal flow control.
from lexilla.
@GabrielFrigo4 Keywords may look good. What follows the keywords is questionable. Thanks for the reply to clarify NOTE1.
@nyamatongwe call
can be passed both an external command or a label as the label is recognized by the colon. It certainly is debatable about which direction to go with it as being command style or label as default style. Either go with command style or try to prevent it and use default style if a label. And goto
followed the same logic as the decision as made with call
. Some objection was expected about my decision and perhaps should be done the other way.
goto
is always followed by label or sometimes I have seen (goto)
with no label which IIRC alters the stack, which the latter seems OK as it terminates at )
. goto
might be easier to fix than call
which as mentioned can be followed by label or command so might need special handling.
I'll try the other way of striving for default styling for label and see what can come up with. Might take alittle while as I have some other matters to attend to first. I may need to allocate more time into the other way as it might need more attention to correct the styling.
Test Gtihub styling:
call file.bat
call "file.bat"
call :label
goto :label
goto label
echo: %var%
echo: text
echo text
(goto)
and for those who cannot locate the spacebar:
call:label
goto:label
echo:%var%
echo:text
and to consider that colon is not needed for label
after goto
makes this invalid:
gotolabel
Seems worse with label
styled as keyword. (goto)
incorrect style. LexBatch has no string style to compare evenly and Github seems missing a command style so uses a default style unless quoted. Little inspiration there. LexBatch might be able to do better.
from lexilla.
Version 2.
This might be less colourful for labels, though the keywords are fixed. IMO it is more technically correct.
call
can handle internal commands, external commands and labels.- A label is not a command so it should never have been styled as a command previously after
goto
orcall
.
Perhaps thoughts are I gone too much the other way. Consider that people claim that a called label is a function or subroutine. CMD with goto
or call
, stops and goes to the label and continues execution. The difference is that call
processes arguments and returns back to the position of the caller. I see no clear evidence that a label can be a command.
Before and after fix displayed in SciTE.
from lexilla.
Related Issues (20)
- [HTML] Update comment highlighting to match WHATWG HTML standard HOT 4
- [Ruby] Correct DBCS character handling HOT 2
- [Ruby] Allow non-ASCII character as heredoc delimiter initial character. HOT 2
- Folding incorrect for Python scripts in ASP HTML
- [Ruby] Allow modifier if, unless, while and until after heredoc delimiter
- [lexer] [feature request] add Zig support
- LexRaku confuses an object attribute named y with the y/// operator HOT 1
- Rust: raw identifiers are marked as errors. HOT 1
- [Feature request] Add JSON5 support HOT 1
- LexLua Unicode identifier issue HOT 6
- XML / XSL Lexer HOT 9
- Add single file input for compiler in lexilla.mak HOT 5
- Add Linden Script Language (LSL) as built-in language in Notepad++ HOT 6
- Add User-defined keywords in HTML HOT 3
- Incorrect folding for multi-line literal strings and block comments when performed incrementally HOT 1
- Respect DIR_O for .res files in lexilla.mak
- [HTML, CPP] Add `>` and space into `setOKBeforeJSRE` to fix regex highlighting HOT 2
- [HTML] Add separate keywords for attributes HOT 6
- [HTML, XML] Don't interpret `<?` and `<%` inside CDATA section HOT 14
- Missing shebang support in JavaScript HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lexilla.