Skip to content

Regression in parsing XML syntax #16458

Closed
@WojciechMazur

Description

@WojciechMazur

Compiler version

3.2.1

Minimized code

//> using lib "org.scala-lang.modules::scala-xml:2.1.0"

@main def Test() =
  val x = <div>FooBar</div><!-- /.modal-content -->
  println(x)

Output

[error] ./test.sc:5:29: in XML literal: name expected, but char '!' cannot start a name
[error]   val x = <div>FooBar</div><!-- /.modal-content -->
[error]                             ^
[error] ./test.sc:5:30: in XML literal: '>' expected instead of '-'
[error]   val x = <div>FooBar</div><!-- /.modal-content -->
[error]                              ^
[error] ./test.sc:7:11: in XML literal: expected closing tag of 
[error] ./test.sc:7:14: expression expected but end of statement found

Expectation

Should compile, Scala 2 output:

NodeBuffer(<div>FooBar</div>, <!-- /.modal-content -->)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions