~npalix/coccinelle/upstream

« back to all changes in this revision

Viewing changes to parsing_c/unparse_cocci.ml

  • Committer: Julia Lawall
  • Author(s): Jaskaran Singh
  • Date: 2020-08-01 20:32:45 UTC
  • Revision ID: git-v1:04f36d537b9f6c0c127d05184cccd21f1a46b952
Add meta attributes

Introduce changes to parse meta attributes and meta attribute
declarations in SmPL rules. Currently, meta attributes are only parsed
in context and minus code.

Signed-off-by: Jaskaran Singh <jaskaran.singh@collabora.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
714
714
and print_attribute attr =
715
715
  match Ast.unwrap attr with
716
716
    Ast.Attribute(a) -> mcode print_string a
 
717
  | Ast.MetaAttribute(name,_,_,_) ->
 
718
      handle_metavar name
 
719
        (function
 
720
            Ast_c.MetaAttributeVal a ->
 
721
              pretty_print_c.Pretty_print_c.attribute a
 
722
          | _ -> error name attr "attribute value expected")
717
723
 
718
724
and typeC ty =
719
725
  match Ast.unwrap ty with