010 module annotations

✓ Passing This code compiles and runs correctly.

Code

~[comptime]

// Test that module annotations are captured in the AST
~pub event test.event { value: u32 }
| result { output: u32 }
input.kz

Expected AST

{
  "module_annotations": [
    "comptime"
  ],
  "items": [
    {
      "type": "import_decl",
      "path": "$std/compiler",
      "location": {
        "file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_010_module_annotations/input.kz",
        "line": 2,
        "col": 0
      }
    },
    {
      "type": "host_line",
      "module": "input",
      "location": {
        "file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_010_module_annotations/input.kz",
        "line": 4,
        "col": 0
      }
    },
    {
      "type": "event_decl",
      "name": "event",
      "path": [
        "test",
        "event"
      ],
      "module": "input",
      "input": {
        "fields": [
          {
            "name": "value",
            "type": "u32",
            "is_source": false,
            "is_file": false,
            "is_embed_file": false,
            "is_expression": false,
            "is_invocation_meta": false
          }
        ]
      },
      "branches": [
        {
          "name": "result",
          "payload": {
            "fields": [
              {
                "name": "output",
                "type": "u32",
                "is_source": false,
                "is_file": false,
                "is_embed_file": false,
                "is_expression": false,
                "is_invocation_meta": false
              }
            ]
          }
        }
      ],
      "location": {
        "file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_010_module_annotations/input.kz",
        "line": 7,
        "col": 0
      }
    }
  ]
}

Test Configuration

PARSER_TEST