Skip to content

Line comments in ASP scripts do not terminate #185

@rdipardo

Description

@rdipardo

When the value of asp.default.language is 2 ("assume scripts are ASP"),1 line comments are not terminated inside legacy-style code blocks (<%...%>), e.g.

Text
<html>
  <% 'comment %>
</html>
Styles
{1}<html>{0}
  {15}<%{81} {82}'comment %>{81}
</{86}html{81}>

The same occurs within ASP string-interpolation tags, data-binding tags, and so-called expression builders.
The exceptions are directive expressions and server-side comments, apparently because they activate states which don't permit nested styles; SCE_H_ASPAT (16) in the former's case:

{1}<html>{0}
  {15}<%@{16} 'comment {15}%>{0}
{1}</html>{0}

SCE_H_XCCOMMENT (20) in the latter:

{1}<html>{0}
  {15}<%--{20} 'comment --{15}%>{0}
{1}</html>{0}

Footnotes

  1. Given the default option value ("assume scripts are JS"), line comments are (correctly) taken for single-quoted JavaScript strings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    aspCaused by ASP or ASP.NET for the html lexerhtmlCaused by the hypertext lexer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions