Invalid grammar after container #20

Open
opened 2023-06-21 17:02:26 +03:00 by pleshevskiy · 0 comments
Owner

If we declare container in the end of the D2 file without trailing empty line we'll get an error in the grammar MISSING ""

Example

container: {
  _.foo: baz
}

Expected

(sourcefile
  (container
    (containerkey)
    (block
      (container
        (containerkey (keywordunderscore))
        (dot)
        (shape (shapekey) (label))
      )
    )
  )
)

Actual

(source_file
      (container
        (container_key)
        (block
          (container
            (container_key
              (keyword_underscore))
            (dot)
            (shape
              (shape_key)
              (label)))))
      (MISSING ""))
If we declare container in the end of the D2 file without trailing empty line we'll get an error in the grammar `MISSING ""` ### Example ``` container: { _.foo: baz } ``` ### Expected ``` (sourcefile (container (containerkey) (block (container (containerkey (keywordunderscore)) (dot) (shape (shapekey) (label)) ) ) ) ) ``` ### Actual ``` (source_file (container (container_key) (block (container (container_key (keyword_underscore)) (dot) (shape (shape_key) (label))))) (MISSING "")) ```
pleshevskiy added the
C
bug
A
grammars
labels 2023-06-21 17:02:26 +03:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: pleshevskiy/tree-sitter-d2#20
No description provided.