2020 BaseModelicaForEquation (index, equations)
2121 BaseModelicaIfEquation (ifs, thens)
2222 BaseModelicaAnyEquation (equation, description)
23+ BaseModelicaAnnotation (annotation_content)
2324 BaseModelicaForIndex (ident, expression)
2425 BaseModelicaComposition (components, equations, initial_equations)
2526 BaseModelicaLongClass (name, description, composition)
@@ -301,6 +302,7 @@ function BaseModelicaComposition(input_list)
301302 push! (initial_equations, input)
302303 elseif input isa BaseModelicaAnyEquation
303304 push! (equations, input)
305+ elseif input isa BaseModelicaAnnotation
304306 end
305307 end
306308 BaseModelicaComposition (components, equations, initial_equations)
@@ -437,7 +439,7 @@ spc = Drop(Star(Space()))
437439 subscript = (E " :" > BMColon) | expression
438440 array_subscripts. matcher = E " [" + subscript + Star (E " ," + subscript) + E " ]" |>
439441 BaseModelicaArraySubscripts
440- annotation_comment = E " annotation" + class_modification
442+ annotation_comment = E " annotation" + class_modification |> BaseModelicaAnnotation
441443 comment. matcher = (string_comment + annotation_comment[0 : 1 ]) |> (x -> length (x) == 1 ? x[1 ] : BaseModelicaString (join ([string (elem) for elem in x], " " )))
442444
443445 enumeration_literal = IDENT + comment
@@ -463,9 +465,9 @@ spc = Drop(Star(Space()))
463465 statement = Delayed ()
464466 base_partition = Delayed ()
465467 composition = Star (decoration[0 : 1 ] + generic_element + E " ;" + spc) + spc +
466- Star ((spc + e " equation" + spc + Star (spc + equation + E " ;" + spc)) |
468+ Star ((spc + e " equation" + spc + Star (spc + ( equation | annotation_comment) + E " ;" + spc)) |
467469 (e " initial equation" + spc +
468- Star (spc + initial_equation + E " ;" + spc)) |
470+ Star (spc + ( initial_equation | annotation_comment) + E " ;" + spc)) |
469471 (e " initial" [0 : 1 ] + e " algorithm" + Star (statement + E " ;" ))) +
470472 (decoration[0 : 1 ] + E " external" + language_specification[0 : 1 ] + external_function_call[0 : 1 ] + annotation_comment[0 : 1 ] + E " ;" )[0 : 1 ] +
471473 Star (base_partition) + (annotation_comment + E " ;" )[0 : 1 ] |>
0 commit comments