ScintillaOrg / lexilla

A library of language lexers for use with Scintilla
https://www.scintilla.org/Lexilla.html
Other
187 stars 67 forks source link

[ASP.NET, JSP] Two bugs for server side comment block #191

Closed zufuliu closed 1 year ago

zufuliu commented 1 year ago

Here are two bugs for server side comment <%-- ... --%> (maybe SCE_H_XCCOMMENT could be renamed? as it's not unique to XCode/JSP): https://learn.microsoft.com/en-us/troubleshoot/developer/webapps/aspnet/development/inline-expressions#--------server-side-comments-block https://github.com/ScintillaOrg/lexilla/blob/157f28ef9fe019558a572dd1532f9f63a9c2dd01/lexers/LexHTML.cxx#L801-L803 https://github.com/ScintillaOrg/lexilla/blob/157f28ef9fe019558a572dd1532f9f63a9c2dd01/include/LexicalStyles.iface#L287-L288

First bug is code folding, I think fold whole script block should be promoted before if (chNext2 == '@') {: https://github.com/ScintillaOrg/lexilla/blob/157f28ef9fe019558a572dd1532f9f63a9c2dd01/lexers/LexHTML.cxx#L1516-L1541

Second bug is scriptLanguage lost on editing inside multiline comment block (e.g. press Enter before --%>), which cause comment block not terminated at handle the end of a pre-processor = Non-HTML. this is same for multiline SCE_H_ASPAT. Change ScriptOfState() to return eScriptVBS for SCE_H_XCCOMMENT and SCE_H_ASPAT fixed the problem. also ScriptOfState() likely has bug for SCE_HPHP_COMPLEX_VARIABLE.

nyamatongwe commented 1 year ago

<%-- wasn't allowed in old ASP but is in ASP.NET:

Warning: File /ServerBasic.asp Line 4 Expected statement. .

Changing names can be a problem for projects using these definitions.

First bug is code folding; scriptLanguage lost on editing inside multiline comment block; same for multiline 1SCE_H_ASPAT1

OK