slackhq / tree-sitter-hack

Hack grammar for tree-sitter
MIT License
33 stars 15 forks source link

Support for contexts and capabilities #47

Closed 4e554c4c closed 2 years ago

4e554c4c commented 2 years ago

Description

See https://docs.hhvm.com/hack/contexts-and-capabilities/introduction Contexts and capabilities are a new language feature, and have been default since HHVM 4.93. They include a syntax extension which tree-sitter-hack currently cannot parse.

Minimal example

code sample

function empty_context()[]: void {}

parser output

function_declaration [0, 0] - [0, 35]
  name: identifier [0, 9] - [0, 22]
  parameters [0, 22] - [0, 24]
  ERROR [0, 24] - [0, 26]
  return_type: type_specifier [0, 28] - [0, 32]
  body: compound_statement [0, 33] - [0, 35]

Requirements (place an x in each of the [ ])