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

Template literals for server JavaScript use wrong style #286

Open
nyamatongwe opened this issue Oct 21, 2024 · 1 comment
Open

Template literals for server JavaScript use wrong style #286

nyamatongwe opened this issue Oct 21, 2024 · 1 comment
Labels
committed Issue fixed in repository but not in release html Caused by the hypertext lexer javascript Caused for JavaScript by the cpp or html lexer

Comments

@nyamatongwe
Copy link
Member

#280 added basic template literal support but it only works for client-side scripts, not server-side where it produces client style SCE_HJ_TEMPLATELITERAL (53) instead of server-side SCE_HJA_TEMPLATELITERAL (68).

<html>
<%@language=JScript%>
<%`template ${2+2}`%>
</html>

statePrintForState needs to be updated to allow for SCE_HJ_TEMPLATELITERAL:

@@ -147,7 +147,7 @@ constexpr int statePrintForState(int state, script_mode inScriptType) noexcept {
 			StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_PYTHON);
 		} else if ((state >= SCE_HB_START) && (state <= SCE_HB_STRINGEOL)) {
 			StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_VBS);
-		} else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_REGEX)) {
+		} else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_TEMPLATELITERAL)) {
 			StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_JS);
 		}
 	}

This will be committed in a couple of days.

@nyamatongwe nyamatongwe added html Caused by the hypertext lexer javascript Caused for JavaScript by the cpp or html lexer labels Oct 21, 2024
@zufuliu
Copy link
Contributor

zufuliu commented Oct 21, 2024

The test case can be added into ServerJavaScript.aspx to reduce files inside hypertext folder.

nyamatongwe added a commit that referenced this issue Oct 22, 2024
literals in HTML instead of client-side style.
@nyamatongwe nyamatongwe added the committed Issue fixed in repository but not in release label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
committed Issue fixed in repository but not in release html Caused by the hypertext lexer javascript Caused for JavaScript by the cpp or html lexer
Projects
None yet
Development

No branches or pull requests

2 participants