Skip to content

enumeration parse error #28

@JohnC32

Description

@JohnC32

Given this enumeration, from https://www.mathworks.com/help/matlab/matlab_oop/expressions-in-class-definitions.html

classdef FlowRate < int32
   enumeration
      Low    (10)
      Medium (FlowRate.Low*5)
      High   (FlowRate.Low*10)
   end
end

it doesn't parse correctly. Using M-x treesit-export-mode RET matlab RET we see:

(source_file
 (ERROR classdef (identifier)
  (superclasses <
   (property_name (identifier)))
  \n enumeration \n
  (enum (identifier) ( (number) ))
  \n (identifier) (
  (ERROR
   (binary_operator
    left: (field_expression object: (identifier) . field: (identifier))
    * right: (number))
   ))
  (function_call name: (identifier) (
   (arguments
    argument: 
     (binary_operator
      left: (field_expression object: (identifier) . field: (identifier))
      * right: (number)))
   ))
  (identifier) end))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions