Skip to content

Cannot parse half brackets in doctests #342

@singularitti

Description

@singularitti

For example, I have code like this:

"""
    Lattice(data::AbstractMatrix)

Construct a `Lattice` from a matrix.

!!! note
    The basis vectors of the matrix are stored as columns.

# Examples
```jldoctest
julia> Lattice([
    1.2 4.5 7.8
    2.3 5.6 8.9
    3.4 6.7 9.1
])
3×3 Lattice{Float64}
 1.2  4.5  7.8
 2.3  5.6  8.9
 3.4  6.7  9.1
```
"""

and getting errors like this:

│ Subexpression:
│ 
│ Lattice([
│ 
│ Evaluated output:
│ 
│ ERROR: syntax: incomplete: premature end of input
│ Stacktrace:
│  [1] top-level scope
│    @ none:1
│ 
│ Expected output:
│ 
│     1.2 4.5 7.8
│     2.3 5.6 8.9
│     3.4 6.7 9.1
│ ])
│ 3×3 Lattice{Float64}
│  1.2  4.5  7.8
│  2.3  5.6  8.9
│  3.4  6.7  9.1
│ 
│   diff =
│    Warning: Diff output requires color.
│        1.2 4.5 7.8
│        2.3 5.6 8.9
│        3.4 6.7 9.1
│    ])
│    3×3 Lattice{Float64}
│     1.2  4.5  7.8
│     2.3  5.6  8.9
│     3.4  6.7  9.1ERROR: syntax: incomplete: premature end of input
│    Stacktrace:
│     [1] top-level scope
│       @ none:1

Similar to #328

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