Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Multiline comments are parsed wrong and break line numbers #13

@AlexanderZeilmann

Description

@AlexanderZeilmann

If the CSS contains a multiline comment, only the first line of the comment is parsed. The rest of the comment is ignored. This also breaks the line numbers of the tokens after it.

/*
  Multiline comments like
  this one break the line 
  numbers of the tokens
  after them.
*/
div {
  color: red;
}

produces the following ast

[
  {
    "ln": 1
  },
  "stylesheet",
  [
    {
      "ln": 1
    },
    "comment",
    "Multiline comments like"
  ],
  [
    {
      "ln": 1
    },
    "s",
    "\n"
  ],
  [
    {
      "ln": 2
    },
    "ruleset",
    [
      {
        "ln": 2
      },
      "selector",
      [
        {
          "ln": 2
        },
        "simpleselector",
        [
          {
            "ln": 2
          },
          "ident",
          "div"
        ],
        [
          {
            "ln": 2
          },
          "s",
          " "
        ]
      ]
    ],
    [
      {
        "ln": 2
      },
      "block",
      [
        {
          "ln": 2
        },
        "s",
        "\n  "
      ],
      [
        {
          "ln": 3
        },
        "declaration",
        [
          {
            "ln": 3
          },
          "property",
          [
            {
              "ln": 3
            },
            "ident",
            "color"
          ]
        ],
        [
          {
            "ln": 3
          },
          "value",
          [
            {
              "ln": 3
            },
            "s",
            " "
          ],
          [
            {
              "ln": 3
            },
            "ident",
            "red"
          ]
        ]
      ],
      [
        {
          "ln": 3
        },
        "decldelim"
      ],
      [
        {
          "ln": 3
        },
        "s",
        "\n"
      ]
    ]
  ],
  [
    {
      "ln": 4
    },
    "s",
    "\n"
  ]
]

Is there any possibility, that this will be fixed in the near future? And that open pull requests like #12 are accepted? Or is this project as dead as it seems?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions