From e7926b89d5d71c3fc37e742ab4d7c851f76e3011 Mon Sep 17 00:00:00 2001 From: Jordan Mecom Date: Sun, 28 Dec 2025 16:04:48 -0800 Subject: [PATCH 1/5] Add capability keyword and enforce attenuation rules --- ATTENUATION.md | 21 +- TUTORIAL.md | 24 +- capc/src/ast.rs | 1 + capc/src/lexer.rs | 2 + capc/src/parser.rs | 36 +- capc/src/typeck/check.rs | 4 +- capc/src/typeck/collect.rs | 7 +- capc/src/typeck/lower.rs | 6 +- capc/src/typeck/mod.rs | 86 +- .../parser__snapshot_doc_comments.snap | 1 + .../parser__snapshot_struct_literal.snap | 1 + capc/tests/typecheck.rs | 32 +- docs/ARCHITECTURE.md | 2 +- docs/POLICY.md | 2 +- docs/caps.md | 10 +- docs/memory_safety.md | 2 +- docs/slice_design.md | 8 +- stdlib/sys/args.cap | 2 +- stdlib/sys/buffer.cap | 8 +- stdlib/sys/console.cap | 2 +- stdlib/sys/fs.cap | 8 +- stdlib/sys/stdin.cap | 2 +- stdlib/sys/system.cap | 2 +- stdlib/sys/vec.cap | 6 +- .../should_fail_affine_branch_merge.cap | 2 +- .../should_fail_affine_call_moves.cap | 2 +- .../programs/should_fail_affine_loop_move.cap | 2 +- .../should_fail_affine_match_merge.cap | 2 +- .../should_fail_affine_nested_field.cap | 2 +- .../should_fail_affine_temp_field.cap | 2 +- .../should_fail_affine_use_after_move.cap | 2 +- .../should_fail_borrow_local_assign.cap | 2 +- .../should_fail_borrow_local_move.cap | 2 +- .../should_fail_borrow_local_temp.cap | 2 +- tests/programs/should_fail_borrow_return.cap | 2 +- .../should_fail_capability_borrow_return.cap | 14 + ...d_fail_capability_borrow_return_result.cap | 14 + .../should_fail_copy_struct_move_field.cap | 2 +- .../programs/should_fail_dup_affine_field.cap | 2 +- .../should_fail_linear_branch_merge.cap | 2 +- .../should_fail_linear_drop_twice.cap | 2 +- .../programs/should_fail_linear_loop_move.cap | 2 +- .../should_fail_linear_match_merge.cap | 2 +- .../should_fail_linear_not_consumed.cap | 2 +- tests/programs/should_fail_move_opaque.cap | 2 +- ...uld_pass_affine_non_affine_field_reads.cap | 2 +- tests/programs/should_pass_borrow_local.cap | 2 +- tests/programs/should_pass_borrow_self.cap | 2 +- .../should_pass_capability_return.cap | 16 + tests/programs/should_pass_linear_drop.cap | 2 +- tests/programs/should_pass_linear_return.cap | 2 +- tree-sitter-capable/grammar.js | 2 +- tree-sitter-capable/queries/highlights.scm | 1 + tree-sitter-capable/src/grammar.json | 4 + tree-sitter-capable/src/node-types.json | 4 + tree-sitter-capable/src/parser.c | 4563 +++++++++-------- vscode/syntaxes/capable.tmLanguage.json | 2 +- 57 files changed, 2616 insertions(+), 2327 deletions(-) create mode 100644 tests/programs/should_fail_capability_borrow_return.cap create mode 100644 tests/programs/should_fail_capability_borrow_return_result.cap create mode 100644 tests/programs/should_pass_capability_return.cap diff --git a/ATTENUATION.md b/ATTENUATION.md index c35ab59..4f639a9 100644 --- a/ATTENUATION.md +++ b/ATTENUATION.md @@ -4,12 +4,11 @@ Here’s a clean way to model the same thing in capc with what you’ve already 1) Make “caps” affine + non-forgeable -Keep using opaque struct as “this is a capability/handle.” That gives you: +Use `capability struct` as “this is a capability/handle.” That gives you: • cannot copy (your Token test) - • cannot fabricate (opaque means no public fields / no user construction unless you allow Cap{} for opaques — you probably shouldn’t) + • cannot fabricate (capability types are opaque: no public fields / no user construction outside the defining module) -Also: your current is_affine_type doesn’t automatically make sys.* opaque types affine. If RootCap is supposed to be the “source of authority,” it should be affine too (Austral’s root capability is special and is threaded through main).  -So: add it to AFFINE_ROOTS (whatever its fully-qualified name is in your world, e.g. "sys.RootCap" or "rc.RootCap"). +Capability types default to affine unless marked `copy` or `linear`. 2) Encode attenuation as “only downward constructors” @@ -17,11 +16,11 @@ Design the stdlib so the only way to get a capability is from a stronger one, an A minimal pattern: -opaque struct RootCap -opaque struct Filesystem -opaque struct Dir -opaque struct FileRead -opaque struct FileWrite +capability struct RootCap +capability struct Filesystem +capability struct Dir +capability struct FileRead +capability struct FileWrite module fs { // mint broad cap from root (borrow root so you can mint others too) @@ -49,7 +48,7 @@ Notes: For a capability/handle, this is exactly the point: -opaque struct Token +capability struct Token pub fn main() -> i32 { let t = Token{} @@ -58,7 +57,7 @@ pub fn main() -> i32 { return 0 } -It’s only “too restrictive” if Token is meant to be data (copyable value). In that case, don’t make it opaque, or give it a non-affine representation (plain struct of copyable fields). +It’s only “too restrictive” if Token is meant to be data (copyable value). In that case, don’t make it capability/opaque, or give it a non-affine representation (plain struct of copyable fields). 4) The tests that actually prove “caps can’t be reused” diff --git a/TUTORIAL.md b/TUTORIAL.md index 931b457..aeeb59c 100644 --- a/TUTORIAL.md +++ b/TUTORIAL.md @@ -125,7 +125,7 @@ match flag { ## 6) Capabilities and attenuation -Capabilities live in `sys.*` and are opaque. You can only get them from `RootCap`. +Capabilities live in `sys.*` and are declared with the `capability` keyword (capability types are opaque). You can only get them from `RootCap`. ```cap module read_config @@ -146,28 +146,34 @@ pub fn main(rc: RootCap) -> i32 { This is attenuation: each step narrows authority. There is no safe API to widen back. -## 7) Opaque, copy, affine, linear +To make attenuation one-way at compile time, any method that returns a capability must take `self` by value. Methods that take `&self` cannot return capabilities. + +## 7) Capability, opaque, copy, affine, linear + +`capability struct` is the explicit “this is an authority token” marker. Capability types are always opaque (no public fields, no user construction) and default to affine unless marked `copy` or `linear`. This exists so the capability surface is obvious in code and the compiler can enforce one‑way attenuation (methods returning capabilities must take `self` by value). Structs can declare their kind: ```cap -opaque struct Token // affine by default (move-only) -copy opaque struct RootCap // unrestricted (copyable) -linear opaque struct FileRead // must be consumed +capability struct Token // affine by default (move-only) +copy capability struct RootCap // unrestricted (copyable) +linear capability struct FileRead // must be consumed ``` Kinds: - **Unrestricted** (copy): can be reused freely. -- **Affine** (default for opaque): move-only, dropping is OK. +- **Affine** (default for capability/opaque): move-only, dropping is OK. - **Linear**: move-only and must be consumed on all paths. +Use `capability struct` for authority-bearing tokens. Use `opaque struct` for unforgeable data types that aren’t capabilities. + ## 8) Moves and use-after-move ```cap module moves -opaque struct Token +capability struct Token pub fn main() -> i32 { let t = Token{} @@ -184,7 +190,7 @@ Affine and linear values cannot be used after move. If you move in one branch, i ```cap module linear -linear opaque struct Ticket +linear capability struct Ticket pub fn main() -> i32 { let t = Ticket{} @@ -202,7 +208,7 @@ There is a small borrow feature for read-only access in function parameters and ```cap module borrow -opaque struct Cap +capability struct Cap impl Cap { pub fn ping(self: &Cap) -> i32 { return 1 } diff --git a/capc/src/ast.rs b/capc/src/ast.rs index a8f4fd7..36dd25f 100644 --- a/capc/src/ast.rs +++ b/capc/src/ast.rs @@ -99,6 +99,7 @@ pub struct StructDecl { pub is_opaque: bool, pub is_linear: bool, pub is_copy: bool, + pub is_capability: bool, pub doc: Option, pub span: Span, } diff --git a/capc/src/lexer.rs b/capc/src/lexer.rs index 009e440..3121d8c 100644 --- a/capc/src/lexer.rs +++ b/capc/src/lexer.rs @@ -49,6 +49,8 @@ pub enum TokenKind { Impl, #[token("opaque")] Opaque, + #[token("capability")] + Capability, #[token("copy")] Copy, #[token("linear")] diff --git a/capc/src/parser.rs b/capc/src/parser.rs index 2a8ad6c..a54d90d 100644 --- a/capc/src/parser.rs +++ b/capc/src/parser.rs @@ -117,6 +117,7 @@ impl Parser { let mut is_linear = false; let mut is_copy = false; let mut is_opaque = false; + let mut is_capability = false; loop { match self.peek_kind() { Some(TokenKind::Pub) => { @@ -155,6 +156,15 @@ impl Parser { self.bump(); is_opaque = true; } + Some(TokenKind::Capability) => { + if is_capability { + return Err(self.error_current( + "duplicate `capability` modifier".to_string(), + )); + } + self.bump(); + is_capability = true; + } _ => break, } } @@ -164,18 +174,19 @@ impl Parser { )); } if self.peek_kind() == Some(TokenKind::Extern) { - if is_opaque || is_linear || is_copy { + if is_opaque || is_linear || is_copy || is_capability { return Err(self.error_current( - "linear/copy/opaque applies only to struct declarations".to_string(), + "linear/copy/opaque/capability applies only to struct declarations".to_string(), )); } return Ok(Item::ExternFunction(self.parse_extern_function(is_pub, doc)?)); } match self.peek_kind() { Some(TokenKind::Fn) => { - if is_opaque || is_linear || is_copy { + if is_opaque || is_linear || is_copy || is_capability { return Err(self.error_current( - "linear/copy/opaque applies only to struct declarations".to_string(), + "linear/copy/opaque/capability applies only to struct declarations" + .to_string(), )); } Ok(Item::Function(self.parse_function(is_pub, doc)?)) @@ -185,12 +196,14 @@ impl Parser { is_opaque, is_linear, is_copy, + is_capability, doc, )?)), Some(TokenKind::Enum) => { - if is_opaque || is_linear || is_copy { + if is_opaque || is_linear || is_copy || is_capability { return Err(self.error_current( - "linear/copy/opaque applies only to struct declarations".to_string(), + "linear/copy/opaque/capability applies only to struct declarations" + .to_string(), )); } Ok(Item::Enum(self.parse_enum(is_pub, doc)?)) @@ -201,9 +214,10 @@ impl Parser { "impl blocks cannot be marked pub".to_string(), )); } - if is_opaque || is_linear || is_copy { + if is_opaque || is_linear || is_copy || is_capability { return Err(self.error_current( - "linear/copy/opaque applies only to struct declarations".to_string(), + "linear/copy/opaque/capability applies only to struct declarations" + .to_string(), )); } Ok(Item::Impl(self.parse_impl_block(doc)?)) @@ -330,6 +344,7 @@ impl Parser { is_opaque: bool, is_linear: bool, is_copy: bool, + is_capability: bool, doc: Option, ) -> Result { let start = self.expect(TokenKind::Struct)?.span.start; @@ -355,10 +370,10 @@ impl Parser { } } let end = self.expect(TokenKind::RBrace)?.span.end; - if is_opaque && !fields.is_empty() { + if (is_opaque || is_capability) && !fields.is_empty() { return Err(self.error_at( Span::new(start, end), - "opaque struct cannot declare fields".to_string(), + "opaque/capability struct cannot declare fields".to_string(), )); } end @@ -372,6 +387,7 @@ impl Parser { is_opaque, is_linear, is_copy, + is_capability, doc, span: Span::new(start, end), }) diff --git a/capc/src/typeck/check.rs b/capc/src/typeck/check.rs index 28d0b13..fdaedac 100644 --- a/capc/src/typeck/check.rs +++ b/capc/src/typeck/check.rs @@ -1594,7 +1594,7 @@ pub(super) fn check_expr( if info.is_opaque && info.module != module_name { return Err(TypeError::new( format!( - "cannot access fields of opaque type `{struct_name}` outside module `{}`", + "cannot access fields of opaque/capability type `{struct_name}` outside module `{}`", info.module ), field_access.span, @@ -1976,7 +1976,7 @@ fn check_struct_literal( if info.is_opaque && info.module != module_name { return Err(TypeError::new( format!( - "cannot construct opaque type `{}` outside module `{}`", + "cannot construct opaque/capability type `{}` outside module `{}`", key, info.module ), lit.span, diff --git a/capc/src/typeck/collect.rs b/capc/src/typeck/collect.rs index 48e26ec..6cc87ed 100644 --- a/capc/src/typeck/collect.rs +++ b/capc/src/typeck/collect.rs @@ -37,6 +37,7 @@ pub(super) fn collect_functions( entry_name: &str, stdlib: &StdlibIndex, struct_map: &HashMap, + enum_map: &HashMap, ) -> Result, TypeError> { let mut functions = HashMap::new(); for module in modules { @@ -118,6 +119,7 @@ pub(super) fn collect_functions( &local_use, stdlib, struct_map, + enum_map, )?; for method in methods { if let Some((impl_ty, method_name)) = method.name.item.split_once("__") { @@ -195,14 +197,15 @@ pub(super) fn collect_structs( TypeKind::Linear } else if decl.is_copy { TypeKind::Unrestricted - } else if decl.is_opaque { + } else if decl.is_opaque || decl.is_capability { TypeKind::Affine } else { TypeKind::Unrestricted }; let info = StructInfo { fields, - is_opaque: decl.is_opaque, + is_opaque: decl.is_opaque || decl.is_capability, + is_capability: decl.is_capability, kind: declared_kind, module: module_name.clone(), }; diff --git a/capc/src/typeck/lower.rs b/capc/src/typeck/lower.rs index eddea65..466103a 100644 --- a/capc/src/typeck/lower.rs +++ b/capc/src/typeck/lower.rs @@ -121,6 +121,7 @@ pub(super) fn lower_module( use_map, stdlib, structs, + enums, )?; for method in methods { let hir_func = lower_function(&method, &mut ctx)?; @@ -175,7 +176,7 @@ pub(super) fn lower_module( hir_structs.push(HirStruct { name: decl.name.item.clone(), fields: fields?, - is_opaque: decl.is_opaque, + is_opaque: decl.is_opaque || decl.is_capability, }); } } @@ -826,7 +827,7 @@ fn lower_expr(expr: &Expr, ctx: &mut LoweringCtx, ret_ty: &Ty) -> Result, is_opaque: bool, + is_capability: bool, kind: TypeKind, module: String, } @@ -418,6 +419,8 @@ fn validate_impl_method( method: &Function, use_map: &UseMap, stdlib: &StdlibIndex, + struct_map: &HashMap, + enum_map: &HashMap, _span: Span, ) -> Result, TypeError> { if method.name.item.contains("__") { @@ -444,6 +447,7 @@ fn validate_impl_method( let expected = target_ty.clone(); let expected_ptr = Ty::Ptr(Box::new(target_ty.clone())); let expected_ref = Ty::Ref(Box::new(target_ty.clone())); + let mut receiver_is_ref = false; if let Some(ty) = &first_param.ty { let lowered = lower_type(ty, use_map, stdlib)?; @@ -455,6 +459,7 @@ fn validate_impl_method( ty.span(), )); } + receiver_is_ref = lowered == expected_ref; } else { params[0].ty = Some(target_ast.clone()); } @@ -468,6 +473,14 @@ fn validate_impl_method( } } + let ret_ty = lower_type(&method.ret, use_map, stdlib)?; + if receiver_is_ref && type_contains_capability(&ret_ty, struct_map, enum_map) { + return Err(TypeError::new( + "methods returning capabilities must take `self` by value".to_string(), + method.ret.span(), + )); + } + Ok(params) } @@ -493,6 +506,7 @@ fn desugar_impl_methods( use_map: &UseMap, stdlib: &StdlibIndex, struct_map: &HashMap, + enum_map: &HashMap, ) -> Result, TypeError> { let (_impl_module, type_name, target_ty) = resolve_impl_target( &impl_block.target, @@ -519,6 +533,8 @@ fn desugar_impl_methods( method, use_map, stdlib, + struct_map, + enum_map, method.span, )?; methods.push(desugar_impl_method(&type_name, method, params)); @@ -622,6 +638,67 @@ fn type_contains_ref(ty: &Type) -> Option { } } +fn type_contains_capability( + ty: &Ty, + struct_map: &HashMap, + enum_map: &HashMap, +) -> bool { + let mut visiting = HashSet::new(); + type_contains_capability_inner(ty, struct_map, enum_map, &mut visiting) +} + +fn type_contains_capability_inner( + ty: &Ty, + struct_map: &HashMap, + enum_map: &HashMap, + visiting: &mut HashSet, +) -> bool { + match ty { + Ty::Builtin(_) | Ty::Ptr(_) | Ty::Ref(_) => false, + Ty::Path(name, args) => { + if name == "Result" { + return args + .iter() + .any(|arg| type_contains_capability_inner(arg, struct_map, enum_map, visiting)); + } + if args + .iter() + .any(|arg| type_contains_capability_inner(arg, struct_map, enum_map, visiting)) + { + return true; + } + if let Some(info) = struct_map.get(name) { + if info.is_capability { + return true; + } + if !visiting.insert(name.clone()) { + return false; + } + let contains = info.fields.values().any(|field| { + type_contains_capability_inner(field, struct_map, enum_map, visiting) + }); + visiting.remove(name); + return contains; + } + if let Some(info) = enum_map.get(name) { + if !visiting.insert(name.clone()) { + return false; + } + let contains = info.payloads.values().any(|payload| { + if let Some(payload_ty) = payload { + type_contains_capability_inner(payload_ty, struct_map, enum_map, visiting) + } else { + false + } + }); + visiting.remove(name); + return contains; + } + false + } + } +} + /// Move-only types are anything not unrestricted. fn is_affine_type( ty: &Ty, @@ -723,7 +800,13 @@ pub fn type_check_program( .map_err(|err| err.with_context("while collecting enums"))?; collect::validate_copy_structs(&modules, &struct_map, &enum_map, &stdlib_index) .map_err(|err| err.with_context("while validating copy structs"))?; - let functions = collect::collect_functions(&modules, &module_name, &stdlib_index, &struct_map) + let functions = collect::collect_functions( + &modules, + &module_name, + &stdlib_index, + &struct_map, + &enum_map, + ) .map_err(|err| err.with_context("while collecting functions"))?; let mut type_tables: FunctionTypeTables = HashMap::new(); @@ -755,6 +838,7 @@ pub fn type_check_program( &module_use, &stdlib_index, &struct_map, + &enum_map, )?; for method in methods { let mut table = TypeTable::default(); diff --git a/capc/tests/snapshots/parser__snapshot_doc_comments.snap b/capc/tests/snapshots/parser__snapshot_doc_comments.snap index 0e1546b..23c9b5e 100644 --- a/capc/tests/snapshots/parser__snapshot_doc_comments.snap +++ b/capc/tests/snapshots/parser__snapshot_doc_comments.snap @@ -74,6 +74,7 @@ Module { is_opaque: false, is_linear: false, is_copy: false, + is_capability: false, doc: None, span: Span { start: 90, diff --git a/capc/tests/snapshots/parser__snapshot_struct_literal.snap b/capc/tests/snapshots/parser__snapshot_struct_literal.snap index 699028e..e44682f 100644 --- a/capc/tests/snapshots/parser__snapshot_struct_literal.snap +++ b/capc/tests/snapshots/parser__snapshot_struct_literal.snap @@ -98,6 +98,7 @@ Module { is_opaque: false, is_linear: false, is_copy: false, + is_capability: false, doc: None, span: Span { start: 23, diff --git a/capc/tests/typecheck.rs b/capc/tests/typecheck.rs index 67eb902..a38f684 100644 --- a/capc/tests/typecheck.rs +++ b/capc/tests/typecheck.rs @@ -202,7 +202,7 @@ fn typecheck_opaque_console_constructor_fails() { let err = type_check_program(&module, &stdlib, &[]).expect_err("expected type error"); assert!( err.to_string() - .contains("cannot construct opaque type `sys.console.Console` outside module `sys.console`") + .contains("cannot construct opaque/capability type `sys.console.Console` outside module `sys.console`") ); } @@ -478,6 +478,14 @@ fn typecheck_borrow_local_ok() { type_check_program(&module, &stdlib, &[]).expect("typecheck module"); } +#[test] +fn typecheck_capability_return_ok() { + let source = load_program("should_pass_capability_return.cap"); + let module = parse_module(&source).expect("parse module"); + let stdlib = load_stdlib().expect("load stdlib"); + type_check_program(&module, &stdlib, &[]).expect("typecheck module"); +} + #[test] fn typecheck_borrow_return_fails() { let source = load_program("should_fail_borrow_return.cap"); @@ -489,6 +497,28 @@ fn typecheck_borrow_return_fails() { .contains("reference types cannot be returned")); } +#[test] +fn typecheck_capability_borrow_return_fails() { + let source = load_program("should_fail_capability_borrow_return.cap"); + let module = parse_module(&source).expect("parse module"); + let stdlib = load_stdlib().expect("load stdlib"); + let err = type_check_program(&module, &stdlib, &[]).expect_err("expected type error"); + assert!(err + .to_string() + .contains("methods returning capabilities must take `self` by value")); +} + +#[test] +fn typecheck_capability_borrow_return_result_fails() { + let source = load_program("should_fail_capability_borrow_return_result.cap"); + let module = parse_module(&source).expect("parse module"); + let stdlib = load_stdlib().expect("load stdlib"); + let err = type_check_program(&module, &stdlib, &[]).expect_err("expected type error"); + assert!(err + .to_string() + .contains("methods returning capabilities must take `self` by value")); +} + #[test] fn typecheck_borrow_local_temp_fails() { let source = load_program("should_fail_borrow_local_temp.cap"); diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 2dd5635..b9f7956 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -67,7 +67,7 @@ lexer ──> parser ──> AST ## Invariants (Keep These True) - No implicit conversions or calls. -- Capabilities are opaque; authority must flow through values. +- Capabilities are declared with `capability struct` (opaque tokens); authority must flow through values. - Move/linear rules are enforced in `check.rs`. - HIR is fully typed and is the only input to codegen. diff --git a/docs/POLICY.md b/docs/POLICY.md index 9192852..248ed43 100644 --- a/docs/POLICY.md +++ b/docs/POLICY.md @@ -25,7 +25,7 @@ This is a compact policy reference for language invariants and safety boundaries ## Capabilities -- Capabilities are opaque (`opaque struct`) and cannot be forged. +- Capabilities are opaque (`capability struct`) and cannot be forged. - Attenuation APIs consume the stronger capability. - Runtime enforces root/relative path checks. diff --git a/docs/caps.md b/docs/caps.md index d66e18d..67af2b4 100644 --- a/docs/caps.md +++ b/docs/caps.md @@ -31,8 +31,8 @@ No global “OS object” exists in safe code. Authority flows only via: ## The three moving parts -### 1) Opaque capability types (unforgeable tokens) -Capabilities are **opaque structs** defined in `sys.*`: +### 1) Capability types (unforgeable tokens) +Capabilities are declared with the `capability` keyword in `sys.*` (capability types are always opaque and declare no fields): - user code can hold/pass/store them - user code cannot construct them (`Console{}` is illegal outside `sys.console`) @@ -48,6 +48,8 @@ All privileged operations live under `sys.*` as methods on capability types: So if you don’t have a `Console`, you cannot call `println`. The compiler will reject it. +For one-way attenuation, any method that returns a capability must take `self` by value. Methods that take `&self` cannot return capabilities. + ### 3) Root authority comes from `RootCap` The entrypoint receives a root capability: @@ -148,9 +150,9 @@ Examples: * calling `c.println(...)` without any `c` bound from `rc.mint_console()` should fail. -2. Forging opaque cap: +2. Forging a capability: -* `let c = Console{}` should fail: “cannot construct opaque type.” +* `let c = Console{}` should fail: “cannot construct opaque/capability type.” These tests validate the unforgeability + explicit passing model. diff --git a/docs/memory_safety.md b/docs/memory_safety.md index debfe37..6b23520 100644 --- a/docs/memory_safety.md +++ b/docs/memory_safety.md @@ -17,7 +17,7 @@ We intentionally do **not** implement a full Rust-style borrow checker. ## 1. Why memory safety matters for capabilities The capability model relies on: -- capability types being **unforgeable** in safe code (opaque, no constructors) +- capability types being **unforgeable** in safe code (`capability struct`, no constructors) - privileged operations happening only through `sys.*`, which enforces attenuation checks If safe code can do out-of-bounds writes / UAF / double-free, it may: diff --git a/docs/slice_design.md b/docs/slice_design.md index ea7f6a0..14f23c6 100644 --- a/docs/slice_design.md +++ b/docs/slice_design.md @@ -51,8 +51,8 @@ Implementation detail: Allocation is explicit (Zig-like). Functions that allocate accept an allocator value. ```cap -opaque struct Alloc -opaque struct Buffer // move-only owner +capability struct Alloc +capability struct Buffer // move-only owner fn buffer_new(a: Alloc, initial_len: usize) -> Result[Buffer, AllocErr] fn buffer_len(b: &Buffer) -> usize @@ -63,8 +63,8 @@ fn buffer_free(a: Alloc, b: Buffer) -> unit // consumes b ### 3.2 Views ```cap -opaque struct Slice[T] -opaque struct MutSlice[T] +capability struct Slice[T] +capability struct MutSlice[T] fn buffer_as_slice(b: &Buffer) -> Slice[u8] fn buffer_as_mut_slice(b: &mut Buffer) -> MutSlice[u8] diff --git a/stdlib/sys/args.cap b/stdlib/sys/args.cap index 2784769..5cf7d17 100644 --- a/stdlib/sys/args.cap +++ b/stdlib/sys/args.cap @@ -1,7 +1,7 @@ package safe module sys::args -pub copy opaque struct Args +pub copy capability struct Args pub enum ArgsErr { OutOfRange diff --git a/stdlib/sys/buffer.cap b/stdlib/sys/buffer.cap index 4f1bad6..224bd63 100644 --- a/stdlib/sys/buffer.cap +++ b/stdlib/sys/buffer.cap @@ -2,10 +2,10 @@ package safe module sys::buffer use sys::vec -pub copy opaque struct Alloc -pub copy opaque struct Buffer -pub copy opaque struct Slice -pub copy opaque struct MutSlice +pub copy capability struct Alloc +pub copy capability struct Buffer +pub copy capability struct Slice +pub copy capability struct MutSlice pub enum AllocErr { Oom diff --git a/stdlib/sys/console.cap b/stdlib/sys/console.cap index 13aeea5..a1ceb20 100644 --- a/stdlib/sys/console.cap +++ b/stdlib/sys/console.cap @@ -1,7 +1,7 @@ package unsafe module sys::console -pub copy opaque struct Console +pub copy capability struct Console impl Console { pub fn print(self, s: string) -> unit { diff --git a/stdlib/sys/fs.cap b/stdlib/sys/fs.cap index d70217d..69bebcf 100644 --- a/stdlib/sys/fs.cap +++ b/stdlib/sys/fs.cap @@ -1,10 +1,10 @@ package unsafe module sys::fs -pub opaque struct ReadFS -pub opaque struct Filesystem -pub opaque struct Dir -pub linear opaque struct FileRead +pub capability struct ReadFS +pub capability struct Filesystem +pub capability struct Dir +pub linear capability struct FileRead pub enum FsErr { NotFound, PermissionDenied, InvalidPath, IoError } diff --git a/stdlib/sys/stdin.cap b/stdlib/sys/stdin.cap index 4358355..38faf70 100644 --- a/stdlib/sys/stdin.cap +++ b/stdlib/sys/stdin.cap @@ -3,7 +3,7 @@ module sys::stdin use sys::io -pub opaque struct Stdin +pub capability struct Stdin impl Stdin { pub fn read_to_string(self) -> Result[string, io::IoErr] { diff --git a/stdlib/sys/system.cap b/stdlib/sys/system.cap index 4eb7a29..10c1551 100644 --- a/stdlib/sys/system.cap +++ b/stdlib/sys/system.cap @@ -6,7 +6,7 @@ use sys::args use sys::stdin use sys::buffer -pub copy opaque struct RootCap +pub copy capability struct RootCap impl RootCap { pub fn mint_console(self) -> console::Console { diff --git a/stdlib/sys/vec.cap b/stdlib/sys/vec.cap index 1e4a76f..4606e3a 100644 --- a/stdlib/sys/vec.cap +++ b/stdlib/sys/vec.cap @@ -3,9 +3,9 @@ module sys::vec use sys::buffer -pub copy opaque struct VecU8 -pub copy opaque struct VecI32 -pub copy opaque struct VecString +pub copy capability struct VecU8 +pub copy capability struct VecI32 +pub copy capability struct VecString pub enum VecErr { OutOfRange, diff --git a/tests/programs/should_fail_affine_branch_merge.cap b/tests/programs/should_fail_affine_branch_merge.cap index ae59d29..2f5c007 100644 --- a/tests/programs/should_fail_affine_branch_merge.cap +++ b/tests/programs/should_fail_affine_branch_merge.cap @@ -1,7 +1,7 @@ package safe module should_fail_affine_branch_merge -opaque struct Cap +capability struct Cap pub fn main() -> i32 { let c = Cap{} diff --git a/tests/programs/should_fail_affine_call_moves.cap b/tests/programs/should_fail_affine_call_moves.cap index 74acb97..7d5eaf7 100644 --- a/tests/programs/should_fail_affine_call_moves.cap +++ b/tests/programs/should_fail_affine_call_moves.cap @@ -1,7 +1,7 @@ package safe module should_fail_affine_call_moves -opaque struct Cap +capability struct Cap pub fn takes(c: Cap) -> i32 { return 0 diff --git a/tests/programs/should_fail_affine_loop_move.cap b/tests/programs/should_fail_affine_loop_move.cap index 7c2e8c4..dc1834a 100644 --- a/tests/programs/should_fail_affine_loop_move.cap +++ b/tests/programs/should_fail_affine_loop_move.cap @@ -1,7 +1,7 @@ package safe module should_fail_affine_loop_move -opaque struct Cap +capability struct Cap pub fn main() -> i32 { let c = Cap{} diff --git a/tests/programs/should_fail_affine_match_merge.cap b/tests/programs/should_fail_affine_match_merge.cap index 4de0cdc..f7b9bd3 100644 --- a/tests/programs/should_fail_affine_match_merge.cap +++ b/tests/programs/should_fail_affine_match_merge.cap @@ -1,7 +1,7 @@ package safe module should_fail_affine_match_merge -opaque struct Cap +capability struct Cap pub fn main() -> i32 { let c = Cap{} diff --git a/tests/programs/should_fail_affine_nested_field.cap b/tests/programs/should_fail_affine_nested_field.cap index 8ddb2e8..eb753cd 100644 --- a/tests/programs/should_fail_affine_nested_field.cap +++ b/tests/programs/should_fail_affine_nested_field.cap @@ -1,7 +1,7 @@ package safe module should_fail_affine_nested_field -opaque struct Cap +capability struct Cap struct Inner { cap: Cap diff --git a/tests/programs/should_fail_affine_temp_field.cap b/tests/programs/should_fail_affine_temp_field.cap index 846ce94..c3238d7 100644 --- a/tests/programs/should_fail_affine_temp_field.cap +++ b/tests/programs/should_fail_affine_temp_field.cap @@ -1,7 +1,7 @@ package safe module should_fail_affine_temp_field -opaque struct Cap +capability struct Cap struct Holder { cap: Cap diff --git a/tests/programs/should_fail_affine_use_after_move.cap b/tests/programs/should_fail_affine_use_after_move.cap index 19b8617..31c42b2 100644 --- a/tests/programs/should_fail_affine_use_after_move.cap +++ b/tests/programs/should_fail_affine_use_after_move.cap @@ -1,7 +1,7 @@ package safe module should_fail_affine_use_after_move -opaque struct Cap +capability struct Cap pub fn main() -> i32 { let c = Cap{} diff --git a/tests/programs/should_fail_borrow_local_assign.cap b/tests/programs/should_fail_borrow_local_assign.cap index a23d3bd..aaf0c84 100644 --- a/tests/programs/should_fail_borrow_local_assign.cap +++ b/tests/programs/should_fail_borrow_local_assign.cap @@ -1,7 +1,7 @@ package safe module should_fail_borrow_local_assign -opaque struct Cap +capability struct Cap pub fn main() -> i32 { let c = Cap{} diff --git a/tests/programs/should_fail_borrow_local_move.cap b/tests/programs/should_fail_borrow_local_move.cap index 1a9510a..f3cecb5 100644 --- a/tests/programs/should_fail_borrow_local_move.cap +++ b/tests/programs/should_fail_borrow_local_move.cap @@ -1,7 +1,7 @@ package safe module should_fail_borrow_local_move -opaque struct Cap +capability struct Cap fn takes(c: Cap) -> i32 { return 1 diff --git a/tests/programs/should_fail_borrow_local_temp.cap b/tests/programs/should_fail_borrow_local_temp.cap index dcab39e..5a0040e 100644 --- a/tests/programs/should_fail_borrow_local_temp.cap +++ b/tests/programs/should_fail_borrow_local_temp.cap @@ -1,7 +1,7 @@ package safe module should_fail_borrow_local_temp -opaque struct Cap +capability struct Cap fn mk() -> Cap { return Cap{} diff --git a/tests/programs/should_fail_borrow_return.cap b/tests/programs/should_fail_borrow_return.cap index f340d89..a823645 100644 --- a/tests/programs/should_fail_borrow_return.cap +++ b/tests/programs/should_fail_borrow_return.cap @@ -1,7 +1,7 @@ package safe module should_fail_borrow_return -opaque struct Cap +capability struct Cap pub fn main() -> &Cap { let c = Cap{} diff --git a/tests/programs/should_fail_capability_borrow_return.cap b/tests/programs/should_fail_capability_borrow_return.cap new file mode 100644 index 0000000..6c6805f --- /dev/null +++ b/tests/programs/should_fail_capability_borrow_return.cap @@ -0,0 +1,14 @@ +package safe +module should_fail_capability_borrow_return + +capability struct Cap + +impl Cap { + pub fn dup(self: &Cap) -> Cap { + return Cap{} + } +} + +pub fn main() -> i32 { + return 0 +} diff --git a/tests/programs/should_fail_capability_borrow_return_result.cap b/tests/programs/should_fail_capability_borrow_return_result.cap new file mode 100644 index 0000000..6dc0357 --- /dev/null +++ b/tests/programs/should_fail_capability_borrow_return_result.cap @@ -0,0 +1,14 @@ +package safe +module should_fail_capability_borrow_return_result + +capability struct Cap + +impl Cap { + pub fn try_dup(self: &Cap) -> Result[Cap, i32] { + return Ok(Cap{}) + } +} + +pub fn main() -> i32 { + return 0 +} diff --git a/tests/programs/should_fail_copy_struct_move_field.cap b/tests/programs/should_fail_copy_struct_move_field.cap index 82460fe..07c1824 100644 --- a/tests/programs/should_fail_copy_struct_move_field.cap +++ b/tests/programs/should_fail_copy_struct_move_field.cap @@ -1,7 +1,7 @@ package safe module should_fail_copy_struct_move_field -linear opaque struct Token +linear capability struct Token copy struct Holder { cap: Token, diff --git a/tests/programs/should_fail_dup_affine_field.cap b/tests/programs/should_fail_dup_affine_field.cap index 55adebb..69bce79 100644 --- a/tests/programs/should_fail_dup_affine_field.cap +++ b/tests/programs/should_fail_dup_affine_field.cap @@ -1,7 +1,7 @@ package safe module should_fail_dup_affine_field -opaque struct Cap +capability struct Cap struct Holder { cap: Cap diff --git a/tests/programs/should_fail_linear_branch_merge.cap b/tests/programs/should_fail_linear_branch_merge.cap index 4b0d6d1..73b1929 100644 --- a/tests/programs/should_fail_linear_branch_merge.cap +++ b/tests/programs/should_fail_linear_branch_merge.cap @@ -1,7 +1,7 @@ package safe module should_fail_linear_branch_merge -linear opaque struct Token +linear capability struct Token pub fn main() -> i32 { let t = Token{} diff --git a/tests/programs/should_fail_linear_drop_twice.cap b/tests/programs/should_fail_linear_drop_twice.cap index e57b2ce..49dcf2c 100644 --- a/tests/programs/should_fail_linear_drop_twice.cap +++ b/tests/programs/should_fail_linear_drop_twice.cap @@ -1,7 +1,7 @@ package safe module should_fail_linear_drop_twice -linear opaque struct Token +linear capability struct Token pub fn main() -> i32 { let t = Token{} diff --git a/tests/programs/should_fail_linear_loop_move.cap b/tests/programs/should_fail_linear_loop_move.cap index 1494909..e26963a 100644 --- a/tests/programs/should_fail_linear_loop_move.cap +++ b/tests/programs/should_fail_linear_loop_move.cap @@ -1,7 +1,7 @@ package safe module should_fail_linear_loop_move -linear opaque struct Token +linear capability struct Token pub fn main() -> i32 { let t = Token{} diff --git a/tests/programs/should_fail_linear_match_merge.cap b/tests/programs/should_fail_linear_match_merge.cap index e19865b..b251f7f 100644 --- a/tests/programs/should_fail_linear_match_merge.cap +++ b/tests/programs/should_fail_linear_match_merge.cap @@ -1,7 +1,7 @@ package safe module should_fail_linear_match_merge -linear opaque struct Token +linear capability struct Token enum Choice { A, B } diff --git a/tests/programs/should_fail_linear_not_consumed.cap b/tests/programs/should_fail_linear_not_consumed.cap index 4c72871..896f6e6 100644 --- a/tests/programs/should_fail_linear_not_consumed.cap +++ b/tests/programs/should_fail_linear_not_consumed.cap @@ -1,7 +1,7 @@ package safe module should_fail_linear_not_consumed -linear opaque struct Token +linear capability struct Token pub fn main() -> i32 { let t = Token{} diff --git a/tests/programs/should_fail_move_opaque.cap b/tests/programs/should_fail_move_opaque.cap index 5a041b7..b4ee420 100644 --- a/tests/programs/should_fail_move_opaque.cap +++ b/tests/programs/should_fail_move_opaque.cap @@ -1,7 +1,7 @@ package safe module should_fail_move_opaque -opaque struct Token +capability struct Token pub fn main() -> i32 { let t = Token{} diff --git a/tests/programs/should_pass_affine_non_affine_field_reads.cap b/tests/programs/should_pass_affine_non_affine_field_reads.cap index 125d12f..c97407d 100644 --- a/tests/programs/should_pass_affine_non_affine_field_reads.cap +++ b/tests/programs/should_pass_affine_non_affine_field_reads.cap @@ -1,7 +1,7 @@ package safe module should_pass_affine_non_affine_field_reads -opaque struct Cap +capability struct Cap struct Holder { cap: Cap, diff --git a/tests/programs/should_pass_borrow_local.cap b/tests/programs/should_pass_borrow_local.cap index f38db0e..539f858 100644 --- a/tests/programs/should_pass_borrow_local.cap +++ b/tests/programs/should_pass_borrow_local.cap @@ -1,7 +1,7 @@ package safe module should_pass_borrow_local -opaque struct Cap +capability struct Cap impl Cap { pub fn ping(self: &Cap) -> i32 { diff --git a/tests/programs/should_pass_borrow_self.cap b/tests/programs/should_pass_borrow_self.cap index a469b85..68dda3b 100644 --- a/tests/programs/should_pass_borrow_self.cap +++ b/tests/programs/should_pass_borrow_self.cap @@ -1,7 +1,7 @@ package safe module should_pass_borrow_self -opaque struct Cap +capability struct Cap impl Cap { pub fn ping(self: &Cap) -> i32 { diff --git a/tests/programs/should_pass_capability_return.cap b/tests/programs/should_pass_capability_return.cap new file mode 100644 index 0000000..321dba6 --- /dev/null +++ b/tests/programs/should_pass_capability_return.cap @@ -0,0 +1,16 @@ +package safe +module should_pass_capability_return + +capability struct Cap + +impl Cap { + pub fn rewrap(self) -> Cap { + return Cap{} + } +} + +pub fn main() -> i32 { + let c = Cap{} + let d = c.rewrap() + return 0 +} diff --git a/tests/programs/should_pass_linear_drop.cap b/tests/programs/should_pass_linear_drop.cap index 488d602..b9ff97d 100644 --- a/tests/programs/should_pass_linear_drop.cap +++ b/tests/programs/should_pass_linear_drop.cap @@ -1,7 +1,7 @@ package safe module should_pass_linear_drop -linear opaque struct Token +linear capability struct Token pub fn main() -> i32 { let t = Token{} diff --git a/tests/programs/should_pass_linear_return.cap b/tests/programs/should_pass_linear_return.cap index 8897cd0..dc18b81 100644 --- a/tests/programs/should_pass_linear_return.cap +++ b/tests/programs/should_pass_linear_return.cap @@ -1,7 +1,7 @@ package safe module should_pass_linear_return -linear opaque struct Token +linear capability struct Token pub fn make() -> Token { let t = Token{} diff --git a/tree-sitter-capable/grammar.js b/tree-sitter-capable/grammar.js index 7aada5f..892b30e 100644 --- a/tree-sitter-capable/grammar.js +++ b/tree-sitter-capable/grammar.js @@ -67,7 +67,7 @@ module.exports = grammar({ struct_decl: ($) => seq( - repeat(choice("pub", "linear", "copy", "opaque")), + repeat(choice("pub", "linear", "copy", "opaque", "capability")), "struct", field("name", $.identifier), "{", diff --git a/tree-sitter-capable/queries/highlights.scm b/tree-sitter-capable/queries/highlights.scm index ca6ab43..c946c69 100644 --- a/tree-sitter-capable/queries/highlights.scm +++ b/tree-sitter-capable/queries/highlights.scm @@ -18,6 +18,7 @@ "opaque" "linear" "copy" + "capability" "match" "true" "false" diff --git a/tree-sitter-capable/src/grammar.json b/tree-sitter-capable/src/grammar.json index a307b57..ed1b88b 100644 --- a/tree-sitter-capable/src/grammar.json +++ b/tree-sitter-capable/src/grammar.json @@ -299,6 +299,10 @@ { "type": "STRING", "value": "opaque" + }, + { + "type": "STRING", + "value": "capability" } ] } diff --git a/tree-sitter-capable/src/node-types.json b/tree-sitter-capable/src/node-types.json index 393d04a..fb16376 100644 --- a/tree-sitter-capable/src/node-types.json +++ b/tree-sitter-capable/src/node-types.json @@ -1042,6 +1042,10 @@ "type": "_", "named": false }, + { + "type": "capability", + "named": false + }, { "type": "comment", "named": true, diff --git a/tree-sitter-capable/src/parser.c b/tree-sitter-capable/src/parser.c index 8367943..e616f29 100644 --- a/tree-sitter-capable/src/parser.c +++ b/tree-sitter-capable/src/parser.c @@ -9,9 +9,9 @@ #define LANGUAGE_VERSION 14 #define STATE_COUNT 284 #define LARGE_STATE_COUNT 2 -#define SYMBOL_COUNT 118 +#define SYMBOL_COUNT 119 #define ALIAS_COUNT 0 -#define TOKEN_COUNT 60 +#define TOKEN_COUNT 61 #define EXTERNAL_TOKEN_COUNT 0 #define FIELD_COUNT 7 #define MAX_ALIAS_SEQUENCE_LENGTH 8 @@ -35,108 +35,109 @@ enum ts_symbol_identifiers { anon_sym_linear = 13, anon_sym_copy = 14, anon_sym_opaque = 15, - anon_sym_struct = 16, - anon_sym_LBRACE = 17, - anon_sym_RBRACE = 18, - anon_sym_enum = 19, - anon_sym_impl = 20, - anon_sym_COMMA = 21, - anon_sym_COLON = 22, - anon_sym_LPAREN = 23, - anon_sym_RPAREN = 24, - sym_self_param = 25, - anon_sym_STAR = 26, - anon_sym_AMP = 27, - anon_sym_LBRACK = 28, - anon_sym_RBRACK = 29, - anon_sym_let = 30, - anon_sym_EQ = 31, - anon_sym_return = 32, - anon_sym_if = 33, - anon_sym_else = 34, - anon_sym_while = 35, - anon_sym_match = 36, - anon_sym_EQ_GT = 37, - anon_sym__ = 38, - anon_sym_QMARK = 39, - anon_sym_DOT = 40, - anon_sym_BANG = 41, - anon_sym_DASH = 42, - anon_sym_PIPE_PIPE = 43, - anon_sym_AMP_AMP = 44, - anon_sym_EQ_EQ = 45, - anon_sym_BANG_EQ = 46, - anon_sym_LT = 47, - anon_sym_LT_EQ = 48, - anon_sym_GT = 49, - anon_sym_GT_EQ = 50, - anon_sym_PLUS = 51, - anon_sym_SLASH = 52, - anon_sym_true = 53, - anon_sym_false = 54, - anon_sym_unit = 55, - sym_int_lit = 56, - sym_u8_lit = 57, - sym_string_lit = 58, - sym_comment = 59, - sym_source_file = 60, - sym_package_decl = 61, - sym_module_decl = 62, - sym_use_decl = 63, - sym_module_path = 64, - sym__item = 65, - sym_function_decl = 66, - sym_extern_function_decl = 67, - sym_struct_decl = 68, - sym_enum_decl = 69, - sym_impl_block = 70, - sym_method_decl = 71, - sym_field_list = 72, - sym_field = 73, - sym_enum_variants = 74, - sym_enum_variant = 75, - sym_param_list = 76, - sym_param = 77, - sym_type = 78, - sym_type_path = 79, - sym_type_args = 80, - sym_block = 81, - sym_statement = 82, - sym_let_stmt = 83, - sym_assign_stmt = 84, - sym_return_stmt = 85, - sym_if_stmt = 86, - sym_while_stmt = 87, - sym_expr_stmt = 88, - sym_expression = 89, - sym_match_expr = 90, - sym_match_arm = 91, - sym_pattern = 92, - sym_pattern_call = 93, - sym_call_expr = 94, - sym_try_expr = 95, - sym_arg_list = 96, - sym_struct_literal = 97, - sym_struct_field = 98, - sym_path_expr = 99, - sym_unary_expr = 100, - sym_binary_expr = 101, - sym_grouping = 102, - sym_literal = 103, - aux_sym_source_file_repeat1 = 104, - aux_sym_source_file_repeat2 = 105, - aux_sym_module_path_repeat1 = 106, - aux_sym_struct_decl_repeat1 = 107, - aux_sym_impl_block_repeat1 = 108, - aux_sym_field_list_repeat1 = 109, - aux_sym_enum_variants_repeat1 = 110, - aux_sym_param_list_repeat1 = 111, - aux_sym_type_args_repeat1 = 112, - aux_sym_block_repeat1 = 113, - aux_sym_match_expr_repeat1 = 114, - aux_sym_arg_list_repeat1 = 115, - aux_sym_struct_literal_repeat1 = 116, - aux_sym_path_expr_repeat1 = 117, + anon_sym_capability = 16, + anon_sym_struct = 17, + anon_sym_LBRACE = 18, + anon_sym_RBRACE = 19, + anon_sym_enum = 20, + anon_sym_impl = 21, + anon_sym_COMMA = 22, + anon_sym_COLON = 23, + anon_sym_LPAREN = 24, + anon_sym_RPAREN = 25, + sym_self_param = 26, + anon_sym_STAR = 27, + anon_sym_AMP = 28, + anon_sym_LBRACK = 29, + anon_sym_RBRACK = 30, + anon_sym_let = 31, + anon_sym_EQ = 32, + anon_sym_return = 33, + anon_sym_if = 34, + anon_sym_else = 35, + anon_sym_while = 36, + anon_sym_match = 37, + anon_sym_EQ_GT = 38, + anon_sym__ = 39, + anon_sym_QMARK = 40, + anon_sym_DOT = 41, + anon_sym_BANG = 42, + anon_sym_DASH = 43, + anon_sym_PIPE_PIPE = 44, + anon_sym_AMP_AMP = 45, + anon_sym_EQ_EQ = 46, + anon_sym_BANG_EQ = 47, + anon_sym_LT = 48, + anon_sym_LT_EQ = 49, + anon_sym_GT = 50, + anon_sym_GT_EQ = 51, + anon_sym_PLUS = 52, + anon_sym_SLASH = 53, + anon_sym_true = 54, + anon_sym_false = 55, + anon_sym_unit = 56, + sym_int_lit = 57, + sym_u8_lit = 58, + sym_string_lit = 59, + sym_comment = 60, + sym_source_file = 61, + sym_package_decl = 62, + sym_module_decl = 63, + sym_use_decl = 64, + sym_module_path = 65, + sym__item = 66, + sym_function_decl = 67, + sym_extern_function_decl = 68, + sym_struct_decl = 69, + sym_enum_decl = 70, + sym_impl_block = 71, + sym_method_decl = 72, + sym_field_list = 73, + sym_field = 74, + sym_enum_variants = 75, + sym_enum_variant = 76, + sym_param_list = 77, + sym_param = 78, + sym_type = 79, + sym_type_path = 80, + sym_type_args = 81, + sym_block = 82, + sym_statement = 83, + sym_let_stmt = 84, + sym_assign_stmt = 85, + sym_return_stmt = 86, + sym_if_stmt = 87, + sym_while_stmt = 88, + sym_expr_stmt = 89, + sym_expression = 90, + sym_match_expr = 91, + sym_match_arm = 92, + sym_pattern = 93, + sym_pattern_call = 94, + sym_call_expr = 95, + sym_try_expr = 96, + sym_arg_list = 97, + sym_struct_literal = 98, + sym_struct_field = 99, + sym_path_expr = 100, + sym_unary_expr = 101, + sym_binary_expr = 102, + sym_grouping = 103, + sym_literal = 104, + aux_sym_source_file_repeat1 = 105, + aux_sym_source_file_repeat2 = 106, + aux_sym_module_path_repeat1 = 107, + aux_sym_struct_decl_repeat1 = 108, + aux_sym_impl_block_repeat1 = 109, + aux_sym_field_list_repeat1 = 110, + aux_sym_enum_variants_repeat1 = 111, + aux_sym_param_list_repeat1 = 112, + aux_sym_type_args_repeat1 = 113, + aux_sym_block_repeat1 = 114, + aux_sym_match_expr_repeat1 = 115, + aux_sym_arg_list_repeat1 = 116, + aux_sym_struct_literal_repeat1 = 117, + aux_sym_path_expr_repeat1 = 118, }; static const char * const ts_symbol_names[] = { @@ -156,6 +157,7 @@ static const char * const ts_symbol_names[] = { [anon_sym_linear] = "linear", [anon_sym_copy] = "copy", [anon_sym_opaque] = "opaque", + [anon_sym_capability] = "capability", [anon_sym_struct] = "struct", [anon_sym_LBRACE] = "{", [anon_sym_RBRACE] = "}", @@ -277,6 +279,7 @@ static const TSSymbol ts_symbol_map[] = { [anon_sym_linear] = anon_sym_linear, [anon_sym_copy] = anon_sym_copy, [anon_sym_opaque] = anon_sym_opaque, + [anon_sym_capability] = anon_sym_capability, [anon_sym_struct] = anon_sym_struct, [anon_sym_LBRACE] = anon_sym_LBRACE, [anon_sym_RBRACE] = anon_sym_RBRACE, @@ -446,6 +449,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = false, }, + [anon_sym_capability] = { + .visible = true, + .named = false, + }, [anon_sym_struct] = { .visible = true, .named = false, @@ -997,35 +1004,35 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [51] = 51, [52] = 52, [53] = 53, - [54] = 44, - [55] = 55, + [54] = 54, + [55] = 44, [56] = 56, [57] = 57, [58] = 58, - [59] = 53, - [60] = 50, + [59] = 59, + [60] = 60, [61] = 61, - [62] = 47, - [63] = 45, - [64] = 49, - [65] = 55, - [66] = 66, - [67] = 67, + [62] = 54, + [63] = 51, + [64] = 56, + [65] = 65, + [66] = 49, + [67] = 52, [68] = 68, [69] = 69, - [70] = 70, + [70] = 59, [71] = 71, [72] = 72, [73] = 73, [74] = 74, [75] = 75, - [76] = 2, + [76] = 76, [77] = 77, [78] = 78, [79] = 79, [80] = 80, [81] = 81, - [82] = 82, + [82] = 2, [83] = 83, [84] = 84, [85] = 85, @@ -1034,25 +1041,25 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [88] = 88, [89] = 89, [90] = 90, - [91] = 91, + [91] = 12, [92] = 92, - [93] = 12, + [93] = 93, [94] = 94, - [95] = 95, - [96] = 96, + [95] = 18, + [96] = 23, [97] = 97, [98] = 98, [99] = 99, [100] = 100, [101] = 101, - [102] = 24, - [103] = 25, - [104] = 18, + [102] = 102, + [103] = 103, + [104] = 104, [105] = 105, [106] = 106, - [107] = 23, - [108] = 108, - [109] = 19, + [107] = 24, + [108] = 19, + [109] = 25, [110] = 110, [111] = 111, [112] = 112, @@ -1066,9 +1073,9 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [120] = 120, [121] = 121, [122] = 122, - [123] = 123, - [124] = 78, - [125] = 75, + [123] = 76, + [124] = 81, + [125] = 125, [126] = 126, [127] = 127, [128] = 128, @@ -1225,7 +1232,7 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [279] = 279, [280] = 280, [281] = 281, - [282] = 264, + [282] = 258, [283] = 283, }; @@ -1542,307 +1549,335 @@ static bool ts_lex_keywords(TSLexer *lexer, TSStateId state) { ACCEPT_TOKEN(anon_sym__); END_STATE(); case 2: - if (lookahead == 'o') ADVANCE(15); + if (lookahead == 'a') ADVANCE(15); + if (lookahead == 'o') ADVANCE(16); END_STATE(); case 3: - if (lookahead == 'l') ADVANCE(16); - if (lookahead == 'n') ADVANCE(17); - if (lookahead == 'x') ADVANCE(18); + if (lookahead == 'l') ADVANCE(17); + if (lookahead == 'n') ADVANCE(18); + if (lookahead == 'x') ADVANCE(19); END_STATE(); case 4: - if (lookahead == 'a') ADVANCE(19); - if (lookahead == 'n') ADVANCE(20); + if (lookahead == 'a') ADVANCE(20); + if (lookahead == 'n') ADVANCE(21); END_STATE(); case 5: - if (lookahead == 'f') ADVANCE(21); - if (lookahead == 'm') ADVANCE(22); + if (lookahead == 'f') ADVANCE(22); + if (lookahead == 'm') ADVANCE(23); END_STATE(); case 6: - if (lookahead == 'e') ADVANCE(23); - if (lookahead == 'i') ADVANCE(24); + if (lookahead == 'e') ADVANCE(24); + if (lookahead == 'i') ADVANCE(25); END_STATE(); case 7: - if (lookahead == 'a') ADVANCE(25); - if (lookahead == 'o') ADVANCE(26); + if (lookahead == 'a') ADVANCE(26); + if (lookahead == 'o') ADVANCE(27); END_STATE(); case 8: - if (lookahead == 'p') ADVANCE(27); + if (lookahead == 'p') ADVANCE(28); END_STATE(); case 9: - if (lookahead == 'a') ADVANCE(28); - if (lookahead == 'u') ADVANCE(29); + if (lookahead == 'a') ADVANCE(29); + if (lookahead == 'u') ADVANCE(30); END_STATE(); case 10: - if (lookahead == 'e') ADVANCE(30); + if (lookahead == 'e') ADVANCE(31); END_STATE(); case 11: - if (lookahead == 'a') ADVANCE(31); - if (lookahead == 'e') ADVANCE(32); - if (lookahead == 't') ADVANCE(33); + if (lookahead == 'a') ADVANCE(32); + if (lookahead == 'e') ADVANCE(33); + if (lookahead == 't') ADVANCE(34); END_STATE(); case 12: - if (lookahead == 'r') ADVANCE(34); + if (lookahead == 'r') ADVANCE(35); END_STATE(); case 13: - if (lookahead == 'n') ADVANCE(35); - if (lookahead == 's') ADVANCE(36); + if (lookahead == 'n') ADVANCE(36); + if (lookahead == 's') ADVANCE(37); END_STATE(); case 14: - if (lookahead == 'h') ADVANCE(37); + if (lookahead == 'h') ADVANCE(38); END_STATE(); case 15: - if (lookahead == 'p') ADVANCE(38); + if (lookahead == 'p') ADVANCE(39); END_STATE(); case 16: - if (lookahead == 's') ADVANCE(39); + if (lookahead == 'p') ADVANCE(40); END_STATE(); case 17: - if (lookahead == 'u') ADVANCE(40); + if (lookahead == 's') ADVANCE(41); END_STATE(); case 18: - if (lookahead == 't') ADVANCE(41); + if (lookahead == 'u') ADVANCE(42); END_STATE(); case 19: - if (lookahead == 'l') ADVANCE(42); + if (lookahead == 't') ADVANCE(43); END_STATE(); case 20: - ACCEPT_TOKEN(anon_sym_fn); + if (lookahead == 'l') ADVANCE(44); END_STATE(); case 21: - ACCEPT_TOKEN(anon_sym_if); + ACCEPT_TOKEN(anon_sym_fn); END_STATE(); case 22: - if (lookahead == 'p') ADVANCE(43); + ACCEPT_TOKEN(anon_sym_if); END_STATE(); case 23: - if (lookahead == 't') ADVANCE(44); + if (lookahead == 'p') ADVANCE(45); END_STATE(); case 24: - if (lookahead == 'n') ADVANCE(45); + if (lookahead == 't') ADVANCE(46); END_STATE(); case 25: - if (lookahead == 't') ADVANCE(46); + if (lookahead == 'n') ADVANCE(47); END_STATE(); case 26: - if (lookahead == 'd') ADVANCE(47); + if (lookahead == 't') ADVANCE(48); END_STATE(); case 27: - if (lookahead == 'a') ADVANCE(48); + if (lookahead == 'd') ADVANCE(49); END_STATE(); case 28: - if (lookahead == 'c') ADVANCE(49); + if (lookahead == 'a') ADVANCE(50); END_STATE(); case 29: - if (lookahead == 'b') ADVANCE(50); + if (lookahead == 'c') ADVANCE(51); END_STATE(); case 30: - if (lookahead == 't') ADVANCE(51); + if (lookahead == 'b') ADVANCE(52); END_STATE(); case 31: - if (lookahead == 'f') ADVANCE(52); + if (lookahead == 't') ADVANCE(53); END_STATE(); case 32: - if (lookahead == 'l') ADVANCE(53); + if (lookahead == 'f') ADVANCE(54); END_STATE(); case 33: - if (lookahead == 'r') ADVANCE(54); + if (lookahead == 'l') ADVANCE(55); END_STATE(); case 34: - if (lookahead == 'u') ADVANCE(55); + if (lookahead == 'r') ADVANCE(56); END_STATE(); case 35: - if (lookahead == 'i') ADVANCE(56); - if (lookahead == 's') ADVANCE(57); + if (lookahead == 'u') ADVANCE(57); END_STATE(); case 36: - if (lookahead == 'e') ADVANCE(58); + if (lookahead == 'i') ADVANCE(58); + if (lookahead == 's') ADVANCE(59); END_STATE(); case 37: - if (lookahead == 'i') ADVANCE(59); + if (lookahead == 'e') ADVANCE(60); END_STATE(); case 38: - if (lookahead == 'y') ADVANCE(60); + if (lookahead == 'i') ADVANCE(61); END_STATE(); case 39: - if (lookahead == 'e') ADVANCE(61); + if (lookahead == 'a') ADVANCE(62); END_STATE(); case 40: - if (lookahead == 'm') ADVANCE(62); + if (lookahead == 'y') ADVANCE(63); END_STATE(); case 41: - if (lookahead == 'e') ADVANCE(63); + if (lookahead == 'e') ADVANCE(64); END_STATE(); case 42: - if (lookahead == 's') ADVANCE(64); + if (lookahead == 'm') ADVANCE(65); END_STATE(); case 43: - if (lookahead == 'l') ADVANCE(65); + if (lookahead == 'e') ADVANCE(66); END_STATE(); case 44: - ACCEPT_TOKEN(anon_sym_let); + if (lookahead == 's') ADVANCE(67); END_STATE(); case 45: - if (lookahead == 'e') ADVANCE(66); + if (lookahead == 'l') ADVANCE(68); END_STATE(); case 46: - if (lookahead == 'c') ADVANCE(67); + ACCEPT_TOKEN(anon_sym_let); END_STATE(); case 47: - if (lookahead == 'u') ADVANCE(68); + if (lookahead == 'e') ADVANCE(69); END_STATE(); case 48: - if (lookahead == 'q') ADVANCE(69); + if (lookahead == 'c') ADVANCE(70); END_STATE(); case 49: - if (lookahead == 'k') ADVANCE(70); + if (lookahead == 'u') ADVANCE(71); END_STATE(); case 50: - ACCEPT_TOKEN(anon_sym_pub); + if (lookahead == 'q') ADVANCE(72); END_STATE(); case 51: - if (lookahead == 'u') ADVANCE(71); + if (lookahead == 'k') ADVANCE(73); END_STATE(); case 52: - if (lookahead == 'e') ADVANCE(72); + ACCEPT_TOKEN(anon_sym_pub); END_STATE(); case 53: - if (lookahead == 'f') ADVANCE(73); + if (lookahead == 'u') ADVANCE(74); END_STATE(); case 54: - if (lookahead == 'u') ADVANCE(74); + if (lookahead == 'e') ADVANCE(75); END_STATE(); case 55: - if (lookahead == 'e') ADVANCE(75); + if (lookahead == 'f') ADVANCE(76); END_STATE(); case 56: - if (lookahead == 't') ADVANCE(76); + if (lookahead == 'u') ADVANCE(77); END_STATE(); case 57: - if (lookahead == 'a') ADVANCE(77); + if (lookahead == 'e') ADVANCE(78); END_STATE(); case 58: - ACCEPT_TOKEN(anon_sym_use); + if (lookahead == 't') ADVANCE(79); END_STATE(); case 59: - if (lookahead == 'l') ADVANCE(78); + if (lookahead == 'a') ADVANCE(80); END_STATE(); case 60: - ACCEPT_TOKEN(anon_sym_copy); + ACCEPT_TOKEN(anon_sym_use); END_STATE(); case 61: - ACCEPT_TOKEN(anon_sym_else); + if (lookahead == 'l') ADVANCE(81); END_STATE(); case 62: - ACCEPT_TOKEN(anon_sym_enum); + if (lookahead == 'b') ADVANCE(82); END_STATE(); case 63: - if (lookahead == 'r') ADVANCE(79); + ACCEPT_TOKEN(anon_sym_copy); END_STATE(); case 64: - if (lookahead == 'e') ADVANCE(80); + ACCEPT_TOKEN(anon_sym_else); END_STATE(); case 65: - ACCEPT_TOKEN(anon_sym_impl); + ACCEPT_TOKEN(anon_sym_enum); END_STATE(); case 66: - if (lookahead == 'a') ADVANCE(81); + if (lookahead == 'r') ADVANCE(83); END_STATE(); case 67: - if (lookahead == 'h') ADVANCE(82); + if (lookahead == 'e') ADVANCE(84); END_STATE(); case 68: - if (lookahead == 'l') ADVANCE(83); + ACCEPT_TOKEN(anon_sym_impl); END_STATE(); case 69: - if (lookahead == 'u') ADVANCE(84); + if (lookahead == 'a') ADVANCE(85); END_STATE(); case 70: - if (lookahead == 'a') ADVANCE(85); + if (lookahead == 'h') ADVANCE(86); END_STATE(); case 71: - if (lookahead == 'r') ADVANCE(86); + if (lookahead == 'l') ADVANCE(87); END_STATE(); case 72: - ACCEPT_TOKEN(anon_sym_safe); + if (lookahead == 'u') ADVANCE(88); END_STATE(); case 73: - ACCEPT_TOKEN(sym_self_param); + if (lookahead == 'a') ADVANCE(89); END_STATE(); case 74: - if (lookahead == 'c') ADVANCE(87); + if (lookahead == 'r') ADVANCE(90); END_STATE(); case 75: - ACCEPT_TOKEN(anon_sym_true); + ACCEPT_TOKEN(anon_sym_safe); END_STATE(); case 76: - ACCEPT_TOKEN(anon_sym_unit); + ACCEPT_TOKEN(sym_self_param); END_STATE(); case 77: - if (lookahead == 'f') ADVANCE(88); + if (lookahead == 'c') ADVANCE(91); END_STATE(); case 78: - if (lookahead == 'e') ADVANCE(89); + ACCEPT_TOKEN(anon_sym_true); END_STATE(); case 79: - if (lookahead == 'n') ADVANCE(90); + ACCEPT_TOKEN(anon_sym_unit); END_STATE(); case 80: - ACCEPT_TOKEN(anon_sym_false); + if (lookahead == 'f') ADVANCE(92); END_STATE(); case 81: - if (lookahead == 'r') ADVANCE(91); + if (lookahead == 'e') ADVANCE(93); END_STATE(); case 82: - ACCEPT_TOKEN(anon_sym_match); + if (lookahead == 'i') ADVANCE(94); END_STATE(); case 83: - if (lookahead == 'e') ADVANCE(92); + if (lookahead == 'n') ADVANCE(95); END_STATE(); case 84: - if (lookahead == 'e') ADVANCE(93); + ACCEPT_TOKEN(anon_sym_false); END_STATE(); case 85: - if (lookahead == 'g') ADVANCE(94); + if (lookahead == 'r') ADVANCE(96); END_STATE(); case 86: - if (lookahead == 'n') ADVANCE(95); + ACCEPT_TOKEN(anon_sym_match); END_STATE(); case 87: - if (lookahead == 't') ADVANCE(96); + if (lookahead == 'e') ADVANCE(97); END_STATE(); case 88: - if (lookahead == 'e') ADVANCE(97); + if (lookahead == 'e') ADVANCE(98); END_STATE(); case 89: - ACCEPT_TOKEN(anon_sym_while); + if (lookahead == 'g') ADVANCE(99); END_STATE(); case 90: - ACCEPT_TOKEN(anon_sym_extern); + if (lookahead == 'n') ADVANCE(100); END_STATE(); case 91: - ACCEPT_TOKEN(anon_sym_linear); + if (lookahead == 't') ADVANCE(101); END_STATE(); case 92: - ACCEPT_TOKEN(anon_sym_module); + if (lookahead == 'e') ADVANCE(102); END_STATE(); case 93: - ACCEPT_TOKEN(anon_sym_opaque); + ACCEPT_TOKEN(anon_sym_while); END_STATE(); case 94: - if (lookahead == 'e') ADVANCE(98); + if (lookahead == 'l') ADVANCE(103); END_STATE(); case 95: - ACCEPT_TOKEN(anon_sym_return); + ACCEPT_TOKEN(anon_sym_extern); END_STATE(); case 96: - ACCEPT_TOKEN(anon_sym_struct); + ACCEPT_TOKEN(anon_sym_linear); END_STATE(); case 97: - ACCEPT_TOKEN(anon_sym_unsafe); + ACCEPT_TOKEN(anon_sym_module); END_STATE(); case 98: + ACCEPT_TOKEN(anon_sym_opaque); + END_STATE(); + case 99: + if (lookahead == 'e') ADVANCE(104); + END_STATE(); + case 100: + ACCEPT_TOKEN(anon_sym_return); + END_STATE(); + case 101: + ACCEPT_TOKEN(anon_sym_struct); + END_STATE(); + case 102: + ACCEPT_TOKEN(anon_sym_unsafe); + END_STATE(); + case 103: + if (lookahead == 'i') ADVANCE(105); + END_STATE(); + case 104: ACCEPT_TOKEN(anon_sym_package); END_STATE(); + case 105: + if (lookahead == 't') ADVANCE(106); + END_STATE(); + case 106: + if (lookahead == 'y') ADVANCE(107); + END_STATE(); + case 107: + ACCEPT_TOKEN(anon_sym_capability); + END_STATE(); default: return false; } @@ -1894,9 +1929,9 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [42] = {.lex_state = 10}, [43] = {.lex_state = 10}, [44] = {.lex_state = 10}, - [45] = {.lex_state = 10}, + [45] = {.lex_state = 0}, [46] = {.lex_state = 10}, - [47] = {.lex_state = 10}, + [47] = {.lex_state = 0}, [48] = {.lex_state = 10}, [49] = {.lex_state = 10}, [50] = {.lex_state = 10}, @@ -1909,38 +1944,38 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [57] = {.lex_state = 10}, [58] = {.lex_state = 10}, [59] = {.lex_state = 10}, - [60] = {.lex_state = 10}, + [60] = {.lex_state = 0}, [61] = {.lex_state = 10}, [62] = {.lex_state = 10}, [63] = {.lex_state = 10}, [64] = {.lex_state = 10}, [65] = {.lex_state = 10}, [66] = {.lex_state = 10}, - [67] = {.lex_state = 0}, - [68] = {.lex_state = 0}, + [67] = {.lex_state = 10}, + [68] = {.lex_state = 11}, [69] = {.lex_state = 0}, - [70] = {.lex_state = 11}, - [71] = {.lex_state = 0}, + [70] = {.lex_state = 10}, + [71] = {.lex_state = 10}, [72] = {.lex_state = 11}, [73] = {.lex_state = 11}, [74] = {.lex_state = 11}, - [75] = {.lex_state = 10}, + [75] = {.lex_state = 11}, [76] = {.lex_state = 10}, - [77] = {.lex_state = 11}, - [78] = {.lex_state = 10}, + [77] = {.lex_state = 0}, + [78] = {.lex_state = 0}, [79] = {.lex_state = 0}, [80] = {.lex_state = 0}, - [81] = {.lex_state = 0}, - [82] = {.lex_state = 0}, - [83] = {.lex_state = 10}, - [84] = {.lex_state = 10}, + [81] = {.lex_state = 10}, + [82] = {.lex_state = 10}, + [83] = {.lex_state = 11}, + [84] = {.lex_state = 11}, [85] = {.lex_state = 11}, - [86] = {.lex_state = 10}, + [86] = {.lex_state = 11}, [87] = {.lex_state = 10}, - [88] = {.lex_state = 11}, + [88] = {.lex_state = 10}, [89] = {.lex_state = 10}, - [90] = {.lex_state = 11}, - [91] = {.lex_state = 11}, + [90] = {.lex_state = 10}, + [91] = {.lex_state = 10}, [92] = {.lex_state = 10}, [93] = {.lex_state = 10}, [94] = {.lex_state = 10}, @@ -1962,13 +1997,13 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [110] = {.lex_state = 0}, [111] = {.lex_state = 0}, [112] = {.lex_state = 0}, - [113] = {.lex_state = 10}, - [114] = {.lex_state = 12}, + [113] = {.lex_state = 0}, + [114] = {.lex_state = 10}, [115] = {.lex_state = 12}, [116] = {.lex_state = 12}, - [117] = {.lex_state = 10}, - [118] = {.lex_state = 12}, - [119] = {.lex_state = 0}, + [117] = {.lex_state = 12}, + [118] = {.lex_state = 10}, + [119] = {.lex_state = 12}, [120] = {.lex_state = 12}, [121] = {.lex_state = 12}, [122] = {.lex_state = 0}, @@ -2015,8 +2050,8 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [163] = {.lex_state = 0}, [164] = {.lex_state = 0}, [165] = {.lex_state = 0}, - [166] = {.lex_state = 0}, - [167] = {.lex_state = 10}, + [166] = {.lex_state = 10}, + [167] = {.lex_state = 0}, [168] = {.lex_state = 0}, [169] = {.lex_state = 0}, [170] = {.lex_state = 0}, @@ -2030,14 +2065,14 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [178] = {.lex_state = 0}, [179] = {.lex_state = 0}, [180] = {.lex_state = 0}, - [181] = {.lex_state = 0}, + [181] = {.lex_state = 12}, [182] = {.lex_state = 0}, [183] = {.lex_state = 0}, [184] = {.lex_state = 0}, [185] = {.lex_state = 12}, [186] = {.lex_state = 0}, [187] = {.lex_state = 0}, - [188] = {.lex_state = 12}, + [188] = {.lex_state = 0}, [189] = {.lex_state = 0}, [190] = {.lex_state = 0}, [191] = {.lex_state = 0}, @@ -2057,21 +2092,21 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [205] = {.lex_state = 0}, [206] = {.lex_state = 0}, [207] = {.lex_state = 0}, - [208] = {.lex_state = 12}, + [208] = {.lex_state = 0}, [209] = {.lex_state = 0}, [210] = {.lex_state = 0}, [211] = {.lex_state = 0}, - [212] = {.lex_state = 0}, + [212] = {.lex_state = 12}, [213] = {.lex_state = 0}, [214] = {.lex_state = 12}, [215] = {.lex_state = 0}, [216] = {.lex_state = 0}, [217] = {.lex_state = 0}, - [218] = {.lex_state = 0}, - [219] = {.lex_state = 0}, + [218] = {.lex_state = 10}, + [219] = {.lex_state = 12}, [220] = {.lex_state = 0}, [221] = {.lex_state = 0}, - [222] = {.lex_state = 10}, + [222] = {.lex_state = 0}, [223] = {.lex_state = 0}, [224] = {.lex_state = 0}, [225] = {.lex_state = 0}, @@ -2091,18 +2126,18 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [239] = {.lex_state = 0}, [240] = {.lex_state = 0}, [241] = {.lex_state = 0}, - [242] = {.lex_state = 12}, + [242] = {.lex_state = 0}, [243] = {.lex_state = 0}, - [244] = {.lex_state = 0}, - [245] = {.lex_state = 10}, + [244] = {.lex_state = 10}, + [245] = {.lex_state = 0}, [246] = {.lex_state = 0}, [247] = {.lex_state = 0}, [248] = {.lex_state = 0}, - [249] = {.lex_state = 0}, - [250] = {.lex_state = 0}, + [249] = {.lex_state = 12}, + [250] = {.lex_state = 12}, [251] = {.lex_state = 0}, [252] = {.lex_state = 0}, - [253] = {.lex_state = 12}, + [253] = {.lex_state = 0}, [254] = {.lex_state = 0}, [255] = {.lex_state = 10}, [256] = {.lex_state = 0}, @@ -2111,24 +2146,24 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [259] = {.lex_state = 0}, [260] = {.lex_state = 0}, [261] = {.lex_state = 0}, - [262] = {.lex_state = 0}, - [263] = {.lex_state = 10}, + [262] = {.lex_state = 10}, + [263] = {.lex_state = 0}, [264] = {.lex_state = 0}, [265] = {.lex_state = 0}, [266] = {.lex_state = 0}, [267] = {.lex_state = 0}, - [268] = {.lex_state = 0}, - [269] = {.lex_state = 12}, + [268] = {.lex_state = 12}, + [269] = {.lex_state = 0}, [270] = {.lex_state = 0}, [271] = {.lex_state = 0}, [272] = {.lex_state = 0}, - [273] = {.lex_state = 11}, + [273] = {.lex_state = 0}, [274] = {.lex_state = 0}, [275] = {.lex_state = 0}, [276] = {.lex_state = 0}, - [277] = {.lex_state = 0}, - [278] = {.lex_state = 12}, - [279] = {.lex_state = 10}, + [277] = {.lex_state = 10}, + [278] = {.lex_state = 11}, + [279] = {.lex_state = 0}, [280] = {.lex_state = 0}, [281] = {.lex_state = 0}, [282] = {.lex_state = 0}, @@ -2153,6 +2188,7 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_linear] = ACTIONS(1), [anon_sym_copy] = ACTIONS(1), [anon_sym_opaque] = ACTIONS(1), + [anon_sym_capability] = ACTIONS(1), [anon_sym_struct] = ACTIONS(1), [anon_sym_LBRACE] = ACTIONS(1), [anon_sym_RBRACE] = ACTIONS(1), @@ -2198,9 +2234,9 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [sym_comment] = ACTIONS(3), }, [STATE(1)] = { - [sym_source_file] = STATE(258), - [sym_package_decl] = STATE(237), - [sym_module_decl] = STATE(67), + [sym_source_file] = STATE(271), + [sym_package_decl] = STATE(228), + [sym_module_decl] = STATE(45), [anon_sym_package] = ACTIONS(5), [anon_sym_module] = ACTIONS(7), [sym_comment] = ACTIONS(3), @@ -2361,7 +2397,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_match, STATE(38), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(46), 2, anon_sym_BANG, @@ -2377,7 +2413,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_false, anon_sym_unit, sym_int_lit, - STATE(99), 6, + STATE(101), 6, sym_let_stmt, sym_assign_stmt, sym_return_stmt, @@ -2415,7 +2451,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_RBRACE, STATE(38), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(46), 2, anon_sym_BANG, @@ -2431,7 +2467,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_false, anon_sym_unit, sym_int_lit, - STATE(99), 6, + STATE(101), 6, sym_let_stmt, sym_assign_stmt, sym_return_stmt, @@ -2469,7 +2505,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_match, STATE(38), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(77), 2, anon_sym_BANG, @@ -2485,7 +2521,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_false, anon_sym_unit, sym_int_lit, - STATE(99), 6, + STATE(101), 6, sym_let_stmt, sym_assign_stmt, sym_return_stmt, @@ -2609,7 +2645,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_RBRACE, STATE(38), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(46), 2, anon_sym_BANG, @@ -2625,7 +2661,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_false, anon_sym_unit, sym_int_lit, - STATE(99), 6, + STATE(101), 6, sym_let_stmt, sym_assign_stmt, sym_return_stmt, @@ -2663,7 +2699,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_RBRACE, STATE(38), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(46), 2, anon_sym_BANG, @@ -2679,7 +2715,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_false, anon_sym_unit, sym_int_lit, - STATE(99), 6, + STATE(101), 6, sym_let_stmt, sym_assign_stmt, sym_return_stmt, @@ -3848,7 +3884,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_match, STATE(37), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(230), 2, anon_sym_BANG, @@ -3887,9 +3923,9 @@ static const uint16_t ts_small_parse_table[] = { sym_identifier, ACTIONS(241), 1, anon_sym_RPAREN, - STATE(83), 1, + STATE(87), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(46), 2, anon_sym_BANG, @@ -3923,9 +3959,9 @@ static const uint16_t ts_small_parse_table[] = { sym_identifier, ACTIONS(243), 1, anon_sym_RPAREN, - STATE(84), 1, + STATE(93), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(46), 2, anon_sym_BANG, @@ -3959,9 +3995,9 @@ static const uint16_t ts_small_parse_table[] = { sym_identifier, ACTIONS(245), 1, anon_sym_RPAREN, - STATE(84), 1, + STATE(93), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(46), 2, anon_sym_BANG, @@ -3993,9 +4029,9 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_match, ACTIONS(247), 1, sym_identifier, - STATE(107), 1, + STATE(95), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(50), 2, sym_u8_lit, @@ -4018,7 +4054,44 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [2171] = 10, + [2171] = 13, + ACTIONS(3), 1, + sym_comment, + ACTIONS(251), 1, + ts_builtin_sym_end, + ACTIONS(253), 1, + anon_sym_use, + ACTIONS(255), 1, + anon_sym_pub, + ACTIONS(257), 1, + anon_sym_fn, + ACTIONS(259), 1, + anon_sym_extern, + ACTIONS(263), 1, + anon_sym_struct, + ACTIONS(265), 1, + anon_sym_enum, + ACTIONS(267), 1, + anon_sym_impl, + STATE(151), 1, + aux_sym_struct_decl_repeat1, + STATE(47), 2, + sym_use_decl, + aux_sym_source_file_repeat1, + ACTIONS(261), 4, + anon_sym_linear, + anon_sym_copy, + anon_sym_opaque, + anon_sym_capability, + STATE(77), 7, + sym__item, + sym_function_decl, + sym_extern_function_decl, + sym_struct_decl, + sym_enum_decl, + sym_impl_block, + aux_sym_source_file_repeat2, + [2221] = 10, ACTIONS(3), 1, sym_comment, ACTIONS(34), 1, @@ -4027,9 +4100,9 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_match, ACTIONS(239), 1, sym_identifier, - STATE(24), 1, + STATE(35), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(46), 2, anon_sym_BANG, @@ -4052,7 +4125,44 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [2215] = 10, + [2265] = 13, + ACTIONS(3), 1, + sym_comment, + ACTIONS(253), 1, + anon_sym_use, + ACTIONS(255), 1, + anon_sym_pub, + ACTIONS(257), 1, + anon_sym_fn, + ACTIONS(259), 1, + anon_sym_extern, + ACTIONS(263), 1, + anon_sym_struct, + ACTIONS(265), 1, + anon_sym_enum, + ACTIONS(267), 1, + anon_sym_impl, + ACTIONS(269), 1, + ts_builtin_sym_end, + STATE(151), 1, + aux_sym_struct_decl_repeat1, + STATE(113), 2, + sym_use_decl, + aux_sym_source_file_repeat1, + ACTIONS(261), 4, + anon_sym_linear, + anon_sym_copy, + anon_sym_opaque, + anon_sym_capability, + STATE(78), 7, + sym__item, + sym_function_decl, + sym_extern_function_decl, + sym_struct_decl, + sym_enum_decl, + sym_impl_block, + aux_sym_source_file_repeat2, + [2315] = 10, ACTIONS(3), 1, sym_comment, ACTIONS(34), 1, @@ -4061,9 +4171,9 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_match, ACTIONS(247), 1, sym_identifier, - STATE(87), 1, + STATE(88), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(50), 2, sym_u8_lit, @@ -4086,7 +4196,7 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [2259] = 10, + [2359] = 10, ACTIONS(3), 1, sym_comment, ACTIONS(34), 1, @@ -4097,7 +4207,7 @@ static const uint16_t ts_small_parse_table[] = { sym_identifier, STATE(15), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(46), 2, anon_sym_BANG, @@ -4120,7 +4230,7 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [2303] = 10, + [2403] = 10, ACTIONS(3), 1, sym_comment, ACTIONS(34), 1, @@ -4129,9 +4239,9 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_match, ACTIONS(247), 1, sym_identifier, - STATE(94), 1, + STATE(90), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(50), 2, sym_u8_lit, @@ -4154,7 +4264,7 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [2347] = 10, + [2447] = 10, ACTIONS(3), 1, sym_comment, ACTIONS(34), 1, @@ -4163,9 +4273,9 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_match, ACTIONS(239), 1, sym_identifier, - STATE(19), 1, + STATE(24), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(46), 2, anon_sym_BANG, @@ -4188,7 +4298,7 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [2391] = 10, + [2491] = 10, ACTIONS(3), 1, sym_comment, ACTIONS(34), 1, @@ -4199,7 +4309,7 @@ static const uint16_t ts_small_parse_table[] = { sym_identifier, STATE(25), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(46), 2, anon_sym_BANG, @@ -4222,7 +4332,7 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [2435] = 10, + [2535] = 10, ACTIONS(3), 1, sym_comment, ACTIONS(34), 1, @@ -4231,9 +4341,9 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_match, ACTIONS(239), 1, sym_identifier, - STATE(39), 1, + STATE(92), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(46), 2, anon_sym_BANG, @@ -4256,7 +4366,7 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [2479] = 10, + [2579] = 10, ACTIONS(3), 1, sym_comment, ACTIONS(34), 1, @@ -4265,9 +4375,9 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_match, ACTIONS(239), 1, sym_identifier, - STATE(92), 1, + STATE(19), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(46), 2, anon_sym_BANG, @@ -4290,7 +4400,7 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [2523] = 10, + [2623] = 10, ACTIONS(3), 1, sym_comment, ACTIONS(34), 1, @@ -4301,7 +4411,7 @@ static const uint16_t ts_small_parse_table[] = { sym_identifier, STATE(18), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(46), 2, anon_sym_BANG, @@ -4324,7 +4434,7 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [2567] = 10, + [2667] = 10, ACTIONS(3), 1, sym_comment, ACTIONS(34), 1, @@ -4335,7 +4445,7 @@ static const uint16_t ts_small_parse_table[] = { sym_identifier, STATE(23), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(46), 2, anon_sym_BANG, @@ -4358,7 +4468,7 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [2611] = 10, + [2711] = 10, ACTIONS(3), 1, sym_comment, ACTIONS(34), 1, @@ -4367,9 +4477,9 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_match, ACTIONS(239), 1, sym_identifier, - STATE(13), 1, + STATE(39), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(46), 2, anon_sym_BANG, @@ -4392,25 +4502,25 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [2655] = 10, + [2755] = 10, ACTIONS(3), 1, sym_comment, ACTIONS(34), 1, anon_sym_LPAREN, ACTIONS(44), 1, anon_sym_match, - ACTIONS(239), 1, + ACTIONS(247), 1, sym_identifier, - STATE(36), 1, + STATE(105), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, - ACTIONS(46), 2, - anon_sym_BANG, - anon_sym_DASH, ACTIONS(50), 2, sym_u8_lit, sym_string_lit, + ACTIONS(249), 2, + anon_sym_BANG, + anon_sym_DASH, ACTIONS(48), 4, anon_sym_true, anon_sym_false, @@ -4426,7 +4536,7 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [2699] = 10, + [2799] = 10, ACTIONS(3), 1, sym_comment, ACTIONS(34), 1, @@ -4435,9 +4545,9 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_match, ACTIONS(239), 1, sym_identifier, - STATE(35), 1, + STATE(13), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(46), 2, anon_sym_BANG, @@ -4460,7 +4570,44 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [2743] = 10, + [2843] = 13, + ACTIONS(3), 1, + sym_comment, + ACTIONS(253), 1, + anon_sym_use, + ACTIONS(255), 1, + anon_sym_pub, + ACTIONS(257), 1, + anon_sym_fn, + ACTIONS(259), 1, + anon_sym_extern, + ACTIONS(263), 1, + anon_sym_struct, + ACTIONS(265), 1, + anon_sym_enum, + ACTIONS(267), 1, + anon_sym_impl, + ACTIONS(271), 1, + ts_builtin_sym_end, + STATE(151), 1, + aux_sym_struct_decl_repeat1, + STATE(113), 2, + sym_use_decl, + aux_sym_source_file_repeat1, + ACTIONS(261), 4, + anon_sym_linear, + anon_sym_copy, + anon_sym_opaque, + anon_sym_capability, + STATE(79), 7, + sym__item, + sym_function_decl, + sym_extern_function_decl, + sym_struct_decl, + sym_enum_decl, + sym_impl_block, + aux_sym_source_file_repeat2, + [2893] = 10, ACTIONS(3), 1, sym_comment, ACTIONS(34), 1, @@ -4469,9 +4616,9 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_match, ACTIONS(239), 1, sym_identifier, - STATE(106), 1, + STATE(36), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(46), 2, anon_sym_BANG, @@ -4494,7 +4641,7 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [2787] = 10, + [2937] = 10, ACTIONS(3), 1, sym_comment, ACTIONS(34), 1, @@ -4503,9 +4650,9 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_match, ACTIONS(247), 1, sym_identifier, - STATE(104), 1, + STATE(108), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(50), 2, sym_u8_lit, @@ -4528,7 +4675,7 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [2831] = 10, + [2981] = 10, ACTIONS(3), 1, sym_comment, ACTIONS(34), 1, @@ -4537,9 +4684,9 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_match, ACTIONS(247), 1, sym_identifier, - STATE(103), 1, + STATE(107), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(50), 2, sym_u8_lit, @@ -4562,41 +4709,7 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [2875] = 10, - ACTIONS(3), 1, - sym_comment, - ACTIONS(34), 1, - anon_sym_LPAREN, - ACTIONS(44), 1, - anon_sym_match, - ACTIONS(239), 1, - sym_identifier, - STATE(84), 1, - sym_expression, - STATE(268), 1, - sym_type_path, - ACTIONS(46), 2, - anon_sym_BANG, - anon_sym_DASH, - ACTIONS(50), 2, - sym_u8_lit, - sym_string_lit, - ACTIONS(48), 4, - anon_sym_true, - anon_sym_false, - anon_sym_unit, - sym_int_lit, - STATE(32), 9, - sym_match_expr, - sym_call_expr, - sym_try_expr, - sym_struct_literal, - sym_path_expr, - sym_unary_expr, - sym_binary_expr, - sym_grouping, - sym_literal, - [2919] = 10, + [3025] = 10, ACTIONS(3), 1, sym_comment, ACTIONS(34), 1, @@ -4605,9 +4718,9 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_match, ACTIONS(247), 1, sym_identifier, - STATE(15), 1, + STATE(96), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(50), 2, sym_u8_lit, @@ -4630,25 +4743,25 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [2963] = 10, + [3069] = 10, ACTIONS(3), 1, sym_comment, ACTIONS(34), 1, anon_sym_LPAREN, ACTIONS(44), 1, anon_sym_match, - ACTIONS(247), 1, + ACTIONS(239), 1, sym_identifier, - STATE(102), 1, + STATE(93), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, + ACTIONS(46), 2, + anon_sym_BANG, + anon_sym_DASH, ACTIONS(50), 2, sym_u8_lit, sym_string_lit, - ACTIONS(249), 2, - anon_sym_BANG, - anon_sym_DASH, ACTIONS(48), 4, anon_sym_true, anon_sym_false, @@ -4664,7 +4777,7 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [3007] = 10, + [3113] = 10, ACTIONS(3), 1, sym_comment, ACTIONS(34), 1, @@ -4673,9 +4786,9 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_match, ACTIONS(247), 1, sym_identifier, - STATE(109), 1, + STATE(15), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(50), 2, sym_u8_lit, @@ -4698,7 +4811,7 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [3051] = 10, + [3157] = 10, ACTIONS(3), 1, sym_comment, ACTIONS(34), 1, @@ -4707,9 +4820,9 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_match, ACTIONS(247), 1, sym_identifier, - STATE(13), 1, + STATE(109), 1, sym_expression, - STATE(268), 1, + STATE(260), 1, sym_type_path, ACTIONS(50), 2, sym_u8_lit, @@ -4732,156 +4845,14 @@ static const uint16_t ts_small_parse_table[] = { sym_binary_expr, sym_grouping, sym_literal, - [3095] = 10, - ACTIONS(3), 1, - sym_comment, - ACTIONS(34), 1, - anon_sym_LPAREN, - ACTIONS(44), 1, - anon_sym_match, - ACTIONS(247), 1, - sym_identifier, - STATE(86), 1, - sym_expression, - STATE(268), 1, - sym_type_path, - ACTIONS(50), 2, - sym_u8_lit, - sym_string_lit, - ACTIONS(249), 2, - anon_sym_BANG, - anon_sym_DASH, - ACTIONS(48), 4, - anon_sym_true, - anon_sym_false, - anon_sym_unit, - sym_int_lit, - STATE(32), 9, - sym_match_expr, - sym_call_expr, - sym_try_expr, - sym_struct_literal, - sym_path_expr, - sym_unary_expr, - sym_binary_expr, - sym_grouping, - sym_literal, - [3139] = 13, - ACTIONS(3), 1, - sym_comment, - ACTIONS(251), 1, - ts_builtin_sym_end, - ACTIONS(253), 1, - anon_sym_use, - ACTIONS(255), 1, - anon_sym_pub, - ACTIONS(257), 1, - anon_sym_fn, - ACTIONS(259), 1, - anon_sym_extern, - ACTIONS(263), 1, - anon_sym_struct, - ACTIONS(265), 1, - anon_sym_enum, - ACTIONS(267), 1, - anon_sym_impl, - STATE(153), 1, - aux_sym_struct_decl_repeat1, - STATE(71), 2, - sym_use_decl, - aux_sym_source_file_repeat1, - ACTIONS(261), 3, - anon_sym_linear, - anon_sym_copy, - anon_sym_opaque, - STATE(79), 7, - sym__item, - sym_function_decl, - sym_extern_function_decl, - sym_struct_decl, - sym_enum_decl, - sym_impl_block, - aux_sym_source_file_repeat2, - [3188] = 13, - ACTIONS(3), 1, - sym_comment, - ACTIONS(253), 1, - anon_sym_use, - ACTIONS(255), 1, - anon_sym_pub, - ACTIONS(257), 1, - anon_sym_fn, - ACTIONS(259), 1, - anon_sym_extern, - ACTIONS(263), 1, - anon_sym_struct, - ACTIONS(265), 1, - anon_sym_enum, - ACTIONS(267), 1, - anon_sym_impl, - ACTIONS(269), 1, - ts_builtin_sym_end, - STATE(153), 1, - aux_sym_struct_decl_repeat1, - STATE(119), 2, - sym_use_decl, - aux_sym_source_file_repeat1, - ACTIONS(261), 3, - anon_sym_linear, - anon_sym_copy, - anon_sym_opaque, - STATE(82), 7, - sym__item, - sym_function_decl, - sym_extern_function_decl, - sym_struct_decl, - sym_enum_decl, - sym_impl_block, - aux_sym_source_file_repeat2, - [3237] = 13, - ACTIONS(3), 1, - sym_comment, - ACTIONS(253), 1, - anon_sym_use, - ACTIONS(255), 1, - anon_sym_pub, - ACTIONS(257), 1, - anon_sym_fn, - ACTIONS(259), 1, - anon_sym_extern, - ACTIONS(263), 1, - anon_sym_struct, - ACTIONS(265), 1, - anon_sym_enum, - ACTIONS(267), 1, - anon_sym_impl, - ACTIONS(271), 1, - ts_builtin_sym_end, - STATE(153), 1, - aux_sym_struct_decl_repeat1, - STATE(68), 2, - sym_use_decl, - aux_sym_source_file_repeat1, - ACTIONS(261), 3, - anon_sym_linear, - anon_sym_copy, - anon_sym_opaque, - STATE(80), 7, - sym__item, - sym_function_decl, - sym_extern_function_decl, - sym_struct_decl, - sym_enum_decl, - sym_impl_block, - aux_sym_source_file_repeat2, - [3286] = 4, + [3201] = 4, ACTIONS(3), 1, sym_comment, ACTIONS(273), 1, anon_sym_COLON_COLON, - STATE(70), 1, + STATE(68), 1, aux_sym_module_path_repeat1, - ACTIONS(95), 19, + ACTIONS(95), 20, ts_builtin_sym_end, anon_sym_use, anon_sym_pub, @@ -4891,6 +4862,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_LBRACE, anon_sym_RBRACE, @@ -4901,7 +4873,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_LBRACK, anon_sym_RBRACK, anon_sym_EQ, - [3317] = 13, + [3233] = 13, ACTIONS(3), 1, sym_comment, ACTIONS(253), 1, @@ -4918,18 +4890,19 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_enum, ACTIONS(267), 1, anon_sym_impl, - ACTIONS(271), 1, + ACTIONS(269), 1, ts_builtin_sym_end, - STATE(153), 1, + STATE(151), 1, aux_sym_struct_decl_repeat1, - STATE(119), 2, + STATE(60), 2, sym_use_decl, aux_sym_source_file_repeat1, - ACTIONS(261), 3, + ACTIONS(261), 4, anon_sym_linear, anon_sym_copy, anon_sym_opaque, - STATE(80), 7, + anon_sym_capability, + STATE(78), 7, sym__item, sym_function_decl, sym_extern_function_decl, @@ -4937,14 +4910,82 @@ static const uint16_t ts_small_parse_table[] = { sym_enum_decl, sym_impl_block, aux_sym_source_file_repeat2, - [3366] = 4, + [3283] = 10, + ACTIONS(3), 1, + sym_comment, + ACTIONS(34), 1, + anon_sym_LPAREN, + ACTIONS(44), 1, + anon_sym_match, + ACTIONS(247), 1, + sym_identifier, + STATE(13), 1, + sym_expression, + STATE(260), 1, + sym_type_path, + ACTIONS(50), 2, + sym_u8_lit, + sym_string_lit, + ACTIONS(249), 2, + anon_sym_BANG, + anon_sym_DASH, + ACTIONS(48), 4, + anon_sym_true, + anon_sym_false, + anon_sym_unit, + sym_int_lit, + STATE(32), 9, + sym_match_expr, + sym_call_expr, + sym_try_expr, + sym_struct_literal, + sym_path_expr, + sym_unary_expr, + sym_binary_expr, + sym_grouping, + sym_literal, + [3327] = 10, + ACTIONS(3), 1, + sym_comment, + ACTIONS(34), 1, + anon_sym_LPAREN, + ACTIONS(44), 1, + anon_sym_match, + ACTIONS(239), 1, + sym_identifier, + STATE(97), 1, + sym_expression, + STATE(260), 1, + sym_type_path, + ACTIONS(46), 2, + anon_sym_BANG, + anon_sym_DASH, + ACTIONS(50), 2, + sym_u8_lit, + sym_string_lit, + ACTIONS(48), 4, + anon_sym_true, + anon_sym_false, + anon_sym_unit, + sym_int_lit, + STATE(32), 9, + sym_match_expr, + sym_call_expr, + sym_try_expr, + sym_struct_literal, + sym_path_expr, + sym_unary_expr, + sym_binary_expr, + sym_grouping, + sym_literal, + [3371] = 4, ACTIONS(3), 1, sym_comment, ACTIONS(276), 1, anon_sym_COLON_COLON, STATE(73), 1, aux_sym_module_path_repeat1, - ACTIONS(15), 18, + ACTIONS(15), 19, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -4953,6 +4994,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_LBRACE, anon_sym_RBRACE, @@ -4963,14 +5005,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_LBRACK, anon_sym_RBRACK, anon_sym_EQ, - [3396] = 4, + [3402] = 4, ACTIONS(3), 1, sym_comment, ACTIONS(276), 1, anon_sym_COLON_COLON, - STATE(70), 1, + STATE(68), 1, aux_sym_module_path_repeat1, - ACTIONS(278), 18, + ACTIONS(278), 19, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -4979,6 +5021,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_LBRACE, anon_sym_RBRACE, @@ -4989,10 +5032,10 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_LBRACK, anon_sym_RBRACK, anon_sym_EQ, - [3426] = 2, + [3433] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(95), 20, + ACTIONS(95), 21, ts_builtin_sym_end, anon_sym_use, anon_sym_COLON_COLON, @@ -5003,6 +5046,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_LBRACE, anon_sym_RBRACE, @@ -5013,67 +5057,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_LBRACK, anon_sym_RBRACK, anon_sym_EQ, - [3452] = 3, - ACTIONS(3), 1, - sym_comment, - ACTIONS(282), 7, - anon_sym_RBRACE, - anon_sym_COMMA, - anon_sym_LPAREN, - anon_sym_BANG, - anon_sym_DASH, - sym_u8_lit, - sym_string_lit, - ACTIONS(280), 12, - anon_sym_let, - anon_sym_return, - anon_sym_if, - anon_sym_else, - anon_sym_while, - anon_sym_match, - anon_sym__, - anon_sym_true, - anon_sym_false, - anon_sym_unit, - sym_int_lit, - sym_identifier, - [3479] = 8, - ACTIONS(3), 1, - sym_comment, - ACTIONS(17), 1, - anon_sym_DOT, - ACTIONS(284), 1, - anon_sym_COLON_COLON, - ACTIONS(286), 1, - anon_sym_LBRACE, - STATE(3), 1, - aux_sym_path_expr_repeat1, - STATE(73), 1, - aux_sym_module_path_repeat1, - ACTIONS(9), 3, - anon_sym_LT, - anon_sym_GT, - anon_sym_SLASH, - ACTIONS(13), 11, - anon_sym_LPAREN, - anon_sym_STAR, - anon_sym_QMARK, - anon_sym_DASH, - anon_sym_PIPE_PIPE, - anon_sym_AMP_AMP, - anon_sym_EQ_EQ, - anon_sym_BANG_EQ, - anon_sym_LT_EQ, - anon_sym_GT_EQ, - anon_sym_PLUS, - [3516] = 4, + [3460] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(291), 1, + ACTIONS(282), 1, anon_sym_LBRACK, - STATE(91), 1, + STATE(83), 1, sym_type_args, - ACTIONS(289), 17, + ACTIONS(280), 18, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -5082,6 +5073,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_LBRACE, anon_sym_RBRACE, @@ -5091,10 +5083,10 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_RPAREN, anon_sym_RBRACK, anon_sym_EQ, - [3545] = 3, + [3490] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(295), 7, + ACTIONS(286), 7, anon_sym_RBRACE, anon_sym_COMMA, anon_sym_LPAREN, @@ -5102,7 +5094,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_DASH, sym_u8_lit, sym_string_lit, - ACTIONS(293), 12, + ACTIONS(284), 12, anon_sym_let, anon_sym_return, anon_sym_if, @@ -5115,7 +5107,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_unit, sym_int_lit, sym_identifier, - [3572] = 11, + [3517] = 11, ACTIONS(3), 1, sym_comment, ACTIONS(255), 1, @@ -5130,15 +5122,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_enum, ACTIONS(267), 1, anon_sym_impl, - ACTIONS(271), 1, + ACTIONS(269), 1, ts_builtin_sym_end, - STATE(153), 1, + STATE(151), 1, aux_sym_struct_decl_repeat1, - ACTIONS(261), 3, + ACTIONS(261), 4, anon_sym_linear, anon_sym_copy, anon_sym_opaque, - STATE(81), 7, + anon_sym_capability, + STATE(80), 7, sym__item, sym_function_decl, sym_extern_function_decl, @@ -5146,7 +5139,7 @@ static const uint16_t ts_small_parse_table[] = { sym_enum_decl, sym_impl_block, aux_sym_source_file_repeat2, - [3614] = 11, + [3560] = 11, ACTIONS(3), 1, sym_comment, ACTIONS(255), 1, @@ -5161,15 +5154,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_enum, ACTIONS(267), 1, anon_sym_impl, - ACTIONS(269), 1, + ACTIONS(271), 1, ts_builtin_sym_end, - STATE(153), 1, + STATE(151), 1, aux_sym_struct_decl_repeat1, - ACTIONS(261), 3, + ACTIONS(261), 4, anon_sym_linear, anon_sym_copy, anon_sym_opaque, - STATE(81), 7, + anon_sym_capability, + STATE(80), 7, sym__item, sym_function_decl, sym_extern_function_decl, @@ -5177,30 +5171,31 @@ static const uint16_t ts_small_parse_table[] = { sym_enum_decl, sym_impl_block, aux_sym_source_file_repeat2, - [3656] = 11, + [3603] = 11, ACTIONS(3), 1, sym_comment, - ACTIONS(297), 1, - ts_builtin_sym_end, - ACTIONS(299), 1, + ACTIONS(255), 1, anon_sym_pub, - ACTIONS(302), 1, + ACTIONS(257), 1, anon_sym_fn, - ACTIONS(305), 1, + ACTIONS(259), 1, anon_sym_extern, - ACTIONS(311), 1, + ACTIONS(263), 1, anon_sym_struct, - ACTIONS(314), 1, + ACTIONS(265), 1, anon_sym_enum, - ACTIONS(317), 1, + ACTIONS(267), 1, anon_sym_impl, - STATE(153), 1, + ACTIONS(288), 1, + ts_builtin_sym_end, + STATE(151), 1, aux_sym_struct_decl_repeat1, - ACTIONS(308), 3, + ACTIONS(261), 4, anon_sym_linear, anon_sym_copy, anon_sym_opaque, - STATE(81), 7, + anon_sym_capability, + STATE(80), 7, sym__item, sym_function_decl, sym_extern_function_decl, @@ -5208,30 +5203,31 @@ static const uint16_t ts_small_parse_table[] = { sym_enum_decl, sym_impl_block, aux_sym_source_file_repeat2, - [3698] = 11, + [3646] = 11, ACTIONS(3), 1, sym_comment, - ACTIONS(255), 1, + ACTIONS(290), 1, + ts_builtin_sym_end, + ACTIONS(292), 1, anon_sym_pub, - ACTIONS(257), 1, + ACTIONS(295), 1, anon_sym_fn, - ACTIONS(259), 1, + ACTIONS(298), 1, anon_sym_extern, - ACTIONS(263), 1, + ACTIONS(304), 1, anon_sym_struct, - ACTIONS(265), 1, + ACTIONS(307), 1, anon_sym_enum, - ACTIONS(267), 1, + ACTIONS(310), 1, anon_sym_impl, - ACTIONS(320), 1, - ts_builtin_sym_end, - STATE(153), 1, + STATE(151), 1, aux_sym_struct_decl_repeat1, - ACTIONS(261), 3, + ACTIONS(301), 4, anon_sym_linear, anon_sym_copy, anon_sym_opaque, - STATE(81), 7, + anon_sym_capability, + STATE(80), 7, sym__item, sym_function_decl, sym_extern_function_decl, @@ -5239,77 +5235,63 @@ static const uint16_t ts_small_parse_table[] = { sym_enum_decl, sym_impl_block, aux_sym_source_file_repeat2, - [3740] = 15, + [3689] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(101), 1, - anon_sym_LPAREN, - ACTIONS(103), 1, - anon_sym_QMARK, - ACTIONS(121), 1, - anon_sym_STAR, - ACTIONS(129), 1, - anon_sym_SLASH, - ACTIONS(145), 1, - anon_sym_AMP_AMP, - ACTIONS(189), 1, - anon_sym_PIPE_PIPE, - ACTIONS(322), 1, + ACTIONS(315), 7, + anon_sym_RBRACE, anon_sym_COMMA, - ACTIONS(324), 1, - anon_sym_RPAREN, - STATE(21), 1, - sym_arg_list, - STATE(194), 1, - aux_sym_arg_list_repeat1, - ACTIONS(123), 2, + anon_sym_LPAREN, + anon_sym_BANG, anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(125), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(127), 2, - anon_sym_LT_EQ, - anon_sym_GT_EQ, - ACTIONS(131), 2, - anon_sym_EQ_EQ, - anon_sym_BANG_EQ, - [3790] = 13, + sym_u8_lit, + sym_string_lit, + ACTIONS(313), 12, + anon_sym_let, + anon_sym_return, + anon_sym_if, + anon_sym_else, + anon_sym_while, + anon_sym_match, + anon_sym__, + anon_sym_true, + anon_sym_false, + anon_sym_unit, + sym_int_lit, + sym_identifier, + [3716] = 8, ACTIONS(3), 1, sym_comment, - ACTIONS(101), 1, + ACTIONS(17), 1, + anon_sym_DOT, + ACTIONS(317), 1, + anon_sym_COLON_COLON, + ACTIONS(319), 1, + anon_sym_LBRACE, + STATE(3), 1, + aux_sym_path_expr_repeat1, + STATE(73), 1, + aux_sym_module_path_repeat1, + ACTIONS(9), 3, + anon_sym_LT, + anon_sym_GT, + anon_sym_SLASH, + ACTIONS(13), 11, anon_sym_LPAREN, - ACTIONS(103), 1, - anon_sym_QMARK, - ACTIONS(121), 1, anon_sym_STAR, - ACTIONS(129), 1, - anon_sym_SLASH, - ACTIONS(145), 1, - anon_sym_AMP_AMP, - ACTIONS(189), 1, - anon_sym_PIPE_PIPE, - STATE(21), 1, - sym_arg_list, - ACTIONS(123), 2, + anon_sym_QMARK, anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(125), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(127), 2, - anon_sym_LT_EQ, - anon_sym_GT_EQ, - ACTIONS(131), 2, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, anon_sym_EQ_EQ, anon_sym_BANG_EQ, - ACTIONS(326), 2, - anon_sym_COMMA, - anon_sym_RPAREN, - [3835] = 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_PLUS, + [3753] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(328), 17, + ACTIONS(322), 18, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -5318,6 +5300,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_LBRACE, anon_sym_RBRACE, @@ -5327,76 +5310,10 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_RPAREN, anon_sym_RBRACK, anon_sym_EQ, - [3858] = 14, - ACTIONS(3), 1, - sym_comment, - ACTIONS(101), 1, - anon_sym_LPAREN, - ACTIONS(103), 1, - anon_sym_QMARK, - ACTIONS(330), 1, - anon_sym_LBRACE, - ACTIONS(332), 1, - anon_sym_STAR, - ACTIONS(336), 1, - anon_sym_PIPE_PIPE, - ACTIONS(338), 1, - anon_sym_AMP_AMP, - ACTIONS(346), 1, - anon_sym_SLASH, - STATE(21), 1, - sym_arg_list, - STATE(89), 1, - sym_block, - ACTIONS(334), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(340), 2, - anon_sym_EQ_EQ, - anon_sym_BANG_EQ, - ACTIONS(342), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(344), 2, - anon_sym_LT_EQ, - anon_sym_GT_EQ, - [3905] = 14, - ACTIONS(3), 1, - sym_comment, - ACTIONS(101), 1, - anon_sym_LPAREN, - ACTIONS(103), 1, - anon_sym_QMARK, - ACTIONS(330), 1, - anon_sym_LBRACE, - ACTIONS(332), 1, - anon_sym_STAR, - ACTIONS(336), 1, - anon_sym_PIPE_PIPE, - ACTIONS(338), 1, - anon_sym_AMP_AMP, - ACTIONS(346), 1, - anon_sym_SLASH, - STATE(21), 1, - sym_arg_list, - STATE(97), 1, - sym_block, - ACTIONS(334), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(340), 2, - anon_sym_EQ_EQ, - anon_sym_BANG_EQ, - ACTIONS(342), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(344), 2, - anon_sym_LT_EQ, - anon_sym_GT_EQ, - [3952] = 2, + [3777] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(348), 17, + ACTIONS(324), 18, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -5405,6 +5322,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_LBRACE, anon_sym_RBRACE, @@ -5414,33 +5332,10 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_RPAREN, anon_sym_RBRACK, anon_sym_EQ, - [3975] = 4, - ACTIONS(3), 1, - sym_comment, - ACTIONS(354), 1, - anon_sym_else, - ACTIONS(352), 6, - anon_sym_RBRACE, - anon_sym_LPAREN, - anon_sym_BANG, - anon_sym_DASH, - sym_u8_lit, - sym_string_lit, - ACTIONS(350), 10, - anon_sym_let, - anon_sym_return, - anon_sym_if, - anon_sym_while, - anon_sym_match, - anon_sym_true, - anon_sym_false, - anon_sym_unit, - sym_int_lit, - sym_identifier, - [4002] = 2, + [3801] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(356), 17, + ACTIONS(326), 18, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -5449,6 +5344,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_LBRACE, anon_sym_RBRACE, @@ -5458,10 +5354,10 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_RPAREN, anon_sym_RBRACK, anon_sym_EQ, - [4025] = 2, + [3825] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(358), 17, + ACTIONS(328), 18, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -5470,6 +5366,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_LBRACE, anon_sym_RBRACE, @@ -5479,7 +5376,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_RPAREN, anon_sym_RBRACK, anon_sym_EQ, - [4048] = 13, + [3849] = 15, ACTIONS(3), 1, sym_comment, ACTIONS(101), 1, @@ -5494,8 +5391,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_AMP_AMP, ACTIONS(189), 1, anon_sym_PIPE_PIPE, + ACTIONS(330), 1, + anon_sym_COMMA, + ACTIONS(332), 1, + anon_sym_RPAREN, STATE(21), 1, sym_arg_list, + STATE(186), 1, + aux_sym_arg_list_repeat1, ACTIONS(123), 2, anon_sym_DASH, anon_sym_PLUS, @@ -5508,74 +5411,52 @@ static const uint16_t ts_small_parse_table[] = { ACTIONS(131), 2, anon_sym_EQ_EQ, anon_sym_BANG_EQ, - ACTIONS(360), 2, - anon_sym_RBRACE, - anon_sym_COMMA, - [4093] = 4, - ACTIONS(3), 1, - sym_comment, - ACTIONS(92), 2, - anon_sym_COLON_COLON, - anon_sym_LBRACE, - ACTIONS(23), 3, - anon_sym_LT, - anon_sym_GT, - anon_sym_SLASH, - ACTIONS(28), 12, - anon_sym_LPAREN, - anon_sym_STAR, - anon_sym_QMARK, - anon_sym_DOT, - anon_sym_DASH, - anon_sym_PIPE_PIPE, - anon_sym_AMP_AMP, - anon_sym_EQ_EQ, - anon_sym_BANG_EQ, - anon_sym_LT_EQ, - anon_sym_GT_EQ, - anon_sym_PLUS, - [4120] = 13, + [3899] = 14, ACTIONS(3), 1, sym_comment, ACTIONS(101), 1, anon_sym_LPAREN, ACTIONS(103), 1, anon_sym_QMARK, - ACTIONS(332), 1, - anon_sym_STAR, + ACTIONS(334), 1, + anon_sym_LBRACE, ACTIONS(336), 1, + anon_sym_STAR, + ACTIONS(340), 1, anon_sym_PIPE_PIPE, - ACTIONS(338), 1, + ACTIONS(342), 1, anon_sym_AMP_AMP, - ACTIONS(346), 1, + ACTIONS(350), 1, anon_sym_SLASH, - ACTIONS(362), 1, - anon_sym_LBRACE, STATE(21), 1, sym_arg_list, - ACTIONS(334), 2, + STATE(89), 1, + sym_block, + ACTIONS(338), 2, anon_sym_DASH, anon_sym_PLUS, - ACTIONS(340), 2, + ACTIONS(344), 2, anon_sym_EQ_EQ, anon_sym_BANG_EQ, - ACTIONS(342), 2, + ACTIONS(346), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(344), 2, + ACTIONS(348), 2, anon_sym_LT_EQ, anon_sym_GT_EQ, - [4164] = 3, + [3946] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(366), 6, + ACTIONS(356), 1, + anon_sym_else, + ACTIONS(354), 6, anon_sym_RBRACE, anon_sym_LPAREN, anon_sym_BANG, anon_sym_DASH, sym_u8_lit, sym_string_lit, - ACTIONS(364), 10, + ACTIONS(352), 10, anon_sym_let, anon_sym_return, anon_sym_if, @@ -5586,41 +5467,140 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_unit, sym_int_lit, sym_identifier, - [4188] = 3, + [3973] = 14, ACTIONS(3), 1, sym_comment, - ACTIONS(370), 6, - anon_sym_RBRACE, + ACTIONS(101), 1, anon_sym_LPAREN, - anon_sym_BANG, + ACTIONS(103), 1, + anon_sym_QMARK, + ACTIONS(334), 1, + anon_sym_LBRACE, + ACTIONS(336), 1, + anon_sym_STAR, + ACTIONS(340), 1, + anon_sym_PIPE_PIPE, + ACTIONS(342), 1, + anon_sym_AMP_AMP, + ACTIONS(350), 1, + anon_sym_SLASH, + STATE(21), 1, + sym_arg_list, + STATE(98), 1, + sym_block, + ACTIONS(338), 2, anon_sym_DASH, - sym_u8_lit, - sym_string_lit, - ACTIONS(368), 10, - anon_sym_let, - anon_sym_return, - anon_sym_if, - anon_sym_while, - anon_sym_match, - anon_sym_true, - anon_sym_false, - anon_sym_unit, - sym_int_lit, - sym_identifier, - [4212] = 3, + anon_sym_PLUS, + ACTIONS(344), 2, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + ACTIONS(346), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(348), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [4020] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(374), 6, - anon_sym_RBRACE, + ACTIONS(92), 2, + anon_sym_COLON_COLON, + anon_sym_LBRACE, + ACTIONS(23), 3, + anon_sym_LT, + anon_sym_GT, + anon_sym_SLASH, + ACTIONS(28), 12, anon_sym_LPAREN, - anon_sym_BANG, + anon_sym_STAR, + anon_sym_QMARK, + anon_sym_DOT, anon_sym_DASH, - sym_u8_lit, - sym_string_lit, - ACTIONS(372), 10, - anon_sym_let, - anon_sym_return, - anon_sym_if, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_PLUS, + [4047] = 13, + ACTIONS(3), 1, + sym_comment, + ACTIONS(101), 1, + anon_sym_LPAREN, + ACTIONS(103), 1, + anon_sym_QMARK, + ACTIONS(121), 1, + anon_sym_STAR, + ACTIONS(129), 1, + anon_sym_SLASH, + ACTIONS(145), 1, + anon_sym_AMP_AMP, + ACTIONS(189), 1, + anon_sym_PIPE_PIPE, + STATE(21), 1, + sym_arg_list, + ACTIONS(123), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(125), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(127), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(131), 2, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + ACTIONS(358), 2, + anon_sym_RBRACE, + anon_sym_COMMA, + [4092] = 13, + ACTIONS(3), 1, + sym_comment, + ACTIONS(101), 1, + anon_sym_LPAREN, + ACTIONS(103), 1, + anon_sym_QMARK, + ACTIONS(121), 1, + anon_sym_STAR, + ACTIONS(129), 1, + anon_sym_SLASH, + ACTIONS(145), 1, + anon_sym_AMP_AMP, + ACTIONS(189), 1, + anon_sym_PIPE_PIPE, + STATE(21), 1, + sym_arg_list, + ACTIONS(123), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(125), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(127), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(131), 2, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + ACTIONS(360), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [4137] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(364), 6, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_BANG, + anon_sym_DASH, + sym_u8_lit, + sym_string_lit, + ACTIONS(362), 10, + anon_sym_let, + anon_sym_return, + anon_sym_if, anon_sym_while, anon_sym_match, anon_sym_true, @@ -5628,17 +5608,103 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_unit, sym_int_lit, sym_identifier, - [4236] = 3, + [4161] = 10, ACTIONS(3), 1, sym_comment, - ACTIONS(201), 6, + ACTIONS(101), 1, + anon_sym_LPAREN, + ACTIONS(103), 1, + anon_sym_QMARK, + ACTIONS(336), 1, + anon_sym_STAR, + ACTIONS(350), 1, + anon_sym_SLASH, + STATE(21), 1, + sym_arg_list, + ACTIONS(338), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(346), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(348), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(111), 5, + anon_sym_LBRACE, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + [4199] = 9, + ACTIONS(3), 1, + sym_comment, + ACTIONS(101), 1, + anon_sym_LPAREN, + ACTIONS(103), 1, + anon_sym_QMARK, + ACTIONS(336), 1, + anon_sym_STAR, + ACTIONS(350), 1, + anon_sym_SLASH, + STATE(21), 1, + sym_arg_list, + ACTIONS(109), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(338), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(111), 7, + anon_sym_LBRACE, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [4235] = 13, + ACTIONS(3), 1, + sym_comment, + ACTIONS(101), 1, + anon_sym_LPAREN, + ACTIONS(103), 1, + anon_sym_QMARK, + ACTIONS(121), 1, + anon_sym_STAR, + ACTIONS(129), 1, + anon_sym_SLASH, + ACTIONS(145), 1, + anon_sym_AMP_AMP, + ACTIONS(189), 1, + anon_sym_PIPE_PIPE, + ACTIONS(366), 1, + anon_sym_RPAREN, + STATE(21), 1, + sym_arg_list, + ACTIONS(123), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(125), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(127), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(131), 2, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + [4279] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(370), 6, anon_sym_RBRACE, anon_sym_LPAREN, anon_sym_BANG, anon_sym_DASH, sym_u8_lit, sym_string_lit, - ACTIONS(197), 10, + ACTIONS(368), 10, anon_sym_let, anon_sym_return, anon_sym_if, @@ -5649,17 +5715,17 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_unit, sym_int_lit, sym_identifier, - [4260] = 3, + [4303] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(378), 6, + ACTIONS(374), 6, anon_sym_RBRACE, anon_sym_LPAREN, anon_sym_BANG, anon_sym_DASH, sym_u8_lit, sym_string_lit, - ACTIONS(376), 10, + ACTIONS(372), 10, anon_sym_let, anon_sym_return, anon_sym_if, @@ -5670,17 +5736,17 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_unit, sym_int_lit, sym_identifier, - [4284] = 3, + [4327] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(382), 6, + ACTIONS(201), 6, anon_sym_RBRACE, anon_sym_LPAREN, anon_sym_BANG, anon_sym_DASH, sym_u8_lit, sym_string_lit, - ACTIONS(380), 10, + ACTIONS(197), 10, anon_sym_let, anon_sym_return, anon_sym_if, @@ -5691,17 +5757,17 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_unit, sym_int_lit, sym_identifier, - [4308] = 3, + [4351] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(386), 6, + ACTIONS(378), 6, anon_sym_RBRACE, anon_sym_LPAREN, anon_sym_BANG, anon_sym_DASH, sym_u8_lit, sym_string_lit, - ACTIONS(384), 10, + ACTIONS(376), 10, anon_sym_let, anon_sym_return, anon_sym_if, @@ -5712,91 +5778,49 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_unit, sym_int_lit, sym_identifier, - [4332] = 8, + [4375] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(101), 1, - anon_sym_LPAREN, - ACTIONS(103), 1, - anon_sym_QMARK, - ACTIONS(332), 1, - anon_sym_STAR, - ACTIONS(346), 1, - anon_sym_SLASH, - STATE(21), 1, - sym_arg_list, - ACTIONS(109), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(111), 9, - anon_sym_LBRACE, - anon_sym_DASH, - anon_sym_PIPE_PIPE, - anon_sym_AMP_AMP, - anon_sym_EQ_EQ, - anon_sym_BANG_EQ, - anon_sym_LT_EQ, - anon_sym_GT_EQ, - anon_sym_PLUS, - [4366] = 12, - ACTIONS(3), 1, - sym_comment, - ACTIONS(101), 1, + ACTIONS(382), 6, + anon_sym_RBRACE, anon_sym_LPAREN, - ACTIONS(103), 1, - anon_sym_QMARK, - ACTIONS(332), 1, - anon_sym_STAR, - ACTIONS(338), 1, - anon_sym_AMP_AMP, - ACTIONS(346), 1, - anon_sym_SLASH, - STATE(21), 1, - sym_arg_list, - ACTIONS(111), 2, - anon_sym_LBRACE, - anon_sym_PIPE_PIPE, - ACTIONS(334), 2, + anon_sym_BANG, anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(340), 2, - anon_sym_EQ_EQ, - anon_sym_BANG_EQ, - ACTIONS(342), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(344), 2, - anon_sym_LT_EQ, - anon_sym_GT_EQ, - [4408] = 10, + sym_u8_lit, + sym_string_lit, + ACTIONS(380), 10, + anon_sym_let, + anon_sym_return, + anon_sym_if, + anon_sym_while, + anon_sym_match, + anon_sym_true, + anon_sym_false, + anon_sym_unit, + sym_int_lit, + sym_identifier, + [4399] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(101), 1, + ACTIONS(386), 6, + anon_sym_RBRACE, anon_sym_LPAREN, - ACTIONS(103), 1, - anon_sym_QMARK, - ACTIONS(332), 1, - anon_sym_STAR, - ACTIONS(346), 1, - anon_sym_SLASH, - STATE(21), 1, - sym_arg_list, - ACTIONS(334), 2, + anon_sym_BANG, anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(342), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(344), 2, - anon_sym_LT_EQ, - anon_sym_GT_EQ, - ACTIONS(111), 5, - anon_sym_LBRACE, - anon_sym_PIPE_PIPE, - anon_sym_AMP_AMP, - anon_sym_EQ_EQ, - anon_sym_BANG_EQ, - [4446] = 3, + sym_u8_lit, + sym_string_lit, + ACTIONS(384), 10, + anon_sym_let, + anon_sym_return, + anon_sym_if, + anon_sym_while, + anon_sym_match, + anon_sym_true, + anon_sym_false, + anon_sym_unit, + sym_int_lit, + sym_identifier, + [4423] = 3, ACTIONS(3), 1, sym_comment, ACTIONS(390), 6, @@ -5817,65 +5841,38 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_unit, sym_int_lit, sym_identifier, - [4470] = 13, + [4447] = 13, ACTIONS(3), 1, sym_comment, ACTIONS(101), 1, anon_sym_LPAREN, ACTIONS(103), 1, anon_sym_QMARK, - ACTIONS(121), 1, + ACTIONS(336), 1, anon_sym_STAR, - ACTIONS(129), 1, - anon_sym_SLASH, - ACTIONS(145), 1, - anon_sym_AMP_AMP, - ACTIONS(189), 1, + ACTIONS(340), 1, anon_sym_PIPE_PIPE, - ACTIONS(392), 1, - anon_sym_RPAREN, - STATE(21), 1, - sym_arg_list, - ACTIONS(123), 2, - anon_sym_DASH, - anon_sym_PLUS, - ACTIONS(125), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(127), 2, - anon_sym_LT_EQ, - anon_sym_GT_EQ, - ACTIONS(131), 2, - anon_sym_EQ_EQ, - anon_sym_BANG_EQ, - [4514] = 9, - ACTIONS(3), 1, - sym_comment, - ACTIONS(101), 1, - anon_sym_LPAREN, - ACTIONS(103), 1, - anon_sym_QMARK, - ACTIONS(332), 1, - anon_sym_STAR, - ACTIONS(346), 1, + ACTIONS(342), 1, + anon_sym_AMP_AMP, + ACTIONS(350), 1, anon_sym_SLASH, + ACTIONS(392), 1, + anon_sym_LBRACE, STATE(21), 1, sym_arg_list, - ACTIONS(109), 2, - anon_sym_LT, - anon_sym_GT, - ACTIONS(334), 2, + ACTIONS(338), 2, anon_sym_DASH, anon_sym_PLUS, - ACTIONS(111), 7, - anon_sym_LBRACE, - anon_sym_PIPE_PIPE, - anon_sym_AMP_AMP, + ACTIONS(344), 2, anon_sym_EQ_EQ, anon_sym_BANG_EQ, + ACTIONS(346), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(348), 2, anon_sym_LT_EQ, anon_sym_GT_EQ, - [4550] = 3, + [4491] = 3, ACTIONS(3), 1, sym_comment, ACTIONS(396), 6, @@ -5896,36 +5893,92 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_unit, sym_int_lit, sym_identifier, - [4574] = 11, + [4515] = 8, ACTIONS(3), 1, sym_comment, ACTIONS(101), 1, anon_sym_LPAREN, ACTIONS(103), 1, anon_sym_QMARK, - ACTIONS(332), 1, + ACTIONS(336), 1, + anon_sym_STAR, + ACTIONS(350), 1, + anon_sym_SLASH, + STATE(21), 1, + sym_arg_list, + ACTIONS(109), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(111), 9, + anon_sym_LBRACE, + anon_sym_DASH, + anon_sym_PIPE_PIPE, + anon_sym_AMP_AMP, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_PLUS, + [4549] = 11, + ACTIONS(3), 1, + sym_comment, + ACTIONS(101), 1, + anon_sym_LPAREN, + ACTIONS(103), 1, + anon_sym_QMARK, + ACTIONS(336), 1, anon_sym_STAR, - ACTIONS(346), 1, + ACTIONS(350), 1, anon_sym_SLASH, STATE(21), 1, sym_arg_list, - ACTIONS(334), 2, + ACTIONS(338), 2, anon_sym_DASH, anon_sym_PLUS, - ACTIONS(340), 2, + ACTIONS(344), 2, anon_sym_EQ_EQ, anon_sym_BANG_EQ, - ACTIONS(342), 2, + ACTIONS(346), 2, anon_sym_LT, anon_sym_GT, - ACTIONS(344), 2, + ACTIONS(348), 2, anon_sym_LT_EQ, anon_sym_GT_EQ, ACTIONS(111), 3, anon_sym_LBRACE, anon_sym_PIPE_PIPE, anon_sym_AMP_AMP, - [4614] = 11, + [4589] = 12, + ACTIONS(3), 1, + sym_comment, + ACTIONS(101), 1, + anon_sym_LPAREN, + ACTIONS(103), 1, + anon_sym_QMARK, + ACTIONS(336), 1, + anon_sym_STAR, + ACTIONS(342), 1, + anon_sym_AMP_AMP, + ACTIONS(350), 1, + anon_sym_SLASH, + STATE(21), 1, + sym_arg_list, + ACTIONS(111), 2, + anon_sym_LBRACE, + anon_sym_PIPE_PIPE, + ACTIONS(338), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(344), 2, + anon_sym_EQ_EQ, + anon_sym_BANG_EQ, + ACTIONS(346), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(348), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + [4631] = 11, ACTIONS(3), 1, sym_comment, ACTIONS(398), 1, @@ -5936,16 +5989,16 @@ static const uint16_t ts_small_parse_table[] = { anon_sym__, STATE(112), 1, aux_sym_match_expr_repeat1, - STATE(137), 1, + STATE(146), 1, sym_match_arm, - STATE(222), 1, + STATE(218), 1, sym_path_expr, - STATE(245), 1, + STATE(262), 1, sym_pattern, ACTIONS(50), 2, sym_u8_lit, sym_string_lit, - STATE(279), 2, + STATE(277), 2, sym_pattern_call, sym_literal, ACTIONS(48), 4, @@ -5953,70 +6006,90 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_false, anon_sym_unit, sym_int_lit, - [4653] = 11, + [4670] = 11, ACTIONS(3), 1, sym_comment, - ACTIONS(404), 1, + ACTIONS(398), 1, sym_identifier, - ACTIONS(407), 1, - anon_sym_RBRACE, - ACTIONS(409), 1, + ACTIONS(402), 1, anon_sym__, - STATE(111), 1, + ACTIONS(404), 1, + anon_sym_RBRACE, + STATE(110), 1, aux_sym_match_expr_repeat1, - STATE(137), 1, + STATE(146), 1, sym_match_arm, - STATE(222), 1, + STATE(218), 1, sym_path_expr, - STATE(245), 1, + STATE(262), 1, sym_pattern, - ACTIONS(415), 2, + ACTIONS(50), 2, sym_u8_lit, sym_string_lit, - STATE(279), 2, + STATE(277), 2, sym_pattern_call, sym_literal, - ACTIONS(412), 4, + ACTIONS(48), 4, anon_sym_true, anon_sym_false, anon_sym_unit, sym_int_lit, - [4692] = 11, + [4709] = 11, ACTIONS(3), 1, sym_comment, - ACTIONS(398), 1, + ACTIONS(406), 1, sym_identifier, - ACTIONS(402), 1, - anon_sym__, - ACTIONS(418), 1, + ACTIONS(409), 1, anon_sym_RBRACE, - STATE(111), 1, + ACTIONS(411), 1, + anon_sym__, + STATE(112), 1, aux_sym_match_expr_repeat1, - STATE(137), 1, + STATE(146), 1, sym_match_arm, - STATE(222), 1, + STATE(218), 1, sym_path_expr, - STATE(245), 1, + STATE(262), 1, sym_pattern, - ACTIONS(50), 2, + ACTIONS(417), 2, sym_u8_lit, sym_string_lit, - STATE(279), 2, + STATE(277), 2, sym_pattern_call, sym_literal, - ACTIONS(48), 4, + ACTIONS(414), 4, anon_sym_true, anon_sym_false, anon_sym_unit, sym_int_lit, - [4731] = 4, + [4748] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(422), 1, + anon_sym_use, + STATE(113), 2, + sym_use_decl, + aux_sym_source_file_repeat1, + ACTIONS(420), 11, + ts_builtin_sym_end, + anon_sym_pub, + anon_sym_fn, + anon_sym_extern, + anon_sym_linear, + anon_sym_copy, + anon_sym_opaque, + anon_sym_capability, + anon_sym_struct, + anon_sym_enum, + anon_sym_impl, + [4772] = 4, ACTIONS(3), 1, sym_comment, ACTIONS(276), 1, anon_sym_COLON_COLON, - STATE(117), 1, + STATE(118), 1, aux_sym_module_path_repeat1, - ACTIONS(420), 11, + ACTIONS(425), 12, ts_builtin_sym_end, anon_sym_use, anon_sym_pub, @@ -6025,13 +6098,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [4754] = 2, + [4796] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(422), 13, + ACTIONS(427), 14, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6041,14 +6115,15 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_LBRACE, anon_sym_enum, anon_sym_impl, - [4773] = 2, + [4816] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(424), 13, + ACTIONS(429), 14, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6058,14 +6133,15 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_LBRACE, anon_sym_enum, anon_sym_impl, - [4792] = 2, + [4836] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(426), 13, + ACTIONS(431), 14, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6075,18 +6151,19 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_LBRACE, anon_sym_enum, anon_sym_impl, - [4811] = 4, + [4856] = 4, ACTIONS(3), 1, sym_comment, ACTIONS(276), 1, anon_sym_COLON_COLON, - STATE(70), 1, + STATE(68), 1, aux_sym_module_path_repeat1, - ACTIONS(428), 11, + ACTIONS(433), 12, ts_builtin_sym_end, anon_sym_use, anon_sym_pub, @@ -6095,13 +6172,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [4834] = 2, + [4880] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(430), 13, + ACTIONS(435), 14, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6111,37 +6189,19 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_LBRACE, anon_sym_enum, anon_sym_impl, - [4853] = 4, - ACTIONS(3), 1, - sym_comment, - ACTIONS(434), 1, - anon_sym_use, - STATE(119), 2, - sym_use_decl, - aux_sym_source_file_repeat1, - ACTIONS(432), 10, - ts_builtin_sym_end, - anon_sym_pub, - anon_sym_fn, - anon_sym_extern, - anon_sym_linear, - anon_sym_copy, - anon_sym_opaque, - anon_sym_struct, - anon_sym_enum, - anon_sym_impl, - [4876] = 4, + [4900] = 4, ACTIONS(3), 1, sym_comment, ACTIONS(439), 1, anon_sym_DASH_GT, ACTIONS(441), 1, anon_sym_SEMI, - ACTIONS(437), 10, + ACTIONS(437), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6149,17 +6209,18 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [4898] = 4, + [4923] = 4, ACTIONS(3), 1, sym_comment, ACTIONS(445), 1, anon_sym_DASH_GT, ACTIONS(447), 1, anon_sym_SEMI, - ACTIONS(443), 10, + ACTIONS(443), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6167,31 +6228,30 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [4920] = 3, + [4946] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(451), 1, - anon_sym_SEMI, - ACTIONS(449), 10, + ACTIONS(449), 12, ts_builtin_sym_end, + anon_sym_use, anon_sym_pub, anon_sym_fn, anon_sym_extern, anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [4939] = 3, + [4964] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(455), 1, - anon_sym_SEMI, - ACTIONS(453), 10, + ACTIONS(286), 12, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6199,13 +6259,15 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, + anon_sym_RBRACE, anon_sym_enum, anon_sym_impl, - [4958] = 2, + [4982] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(295), 11, + ACTIONS(315), 12, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6213,14 +6275,17 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_RBRACE, anon_sym_enum, anon_sym_impl, - [4975] = 2, + [5000] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(282), 11, + ACTIONS(453), 1, + anon_sym_SEMI, + ACTIONS(451), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6228,29 +6293,31 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, - anon_sym_RBRACE, anon_sym_enum, anon_sym_impl, - [4992] = 2, + [5020] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(457), 11, + ACTIONS(457), 1, + anon_sym_SEMI, + ACTIONS(455), 11, ts_builtin_sym_end, - anon_sym_use, anon_sym_pub, anon_sym_fn, anon_sym_extern, anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [5009] = 2, + [5040] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(459), 11, + ACTIONS(459), 12, ts_builtin_sym_end, anon_sym_use, anon_sym_pub, @@ -6259,13 +6326,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [5026] = 2, + [5058] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(461), 10, + ACTIONS(461), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6273,13 +6341,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [5042] = 2, + [5075] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(463), 10, + ACTIONS(463), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6287,13 +6356,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [5058] = 2, + [5092] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(465), 10, + ACTIONS(465), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6301,13 +6371,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [5074] = 2, + [5109] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(467), 10, + ACTIONS(467), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6315,13 +6386,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [5090] = 2, + [5126] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(469), 10, + ACTIONS(469), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6329,13 +6401,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [5106] = 2, + [5143] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(471), 10, + ACTIONS(471), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6343,13 +6416,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [5122] = 2, + [5160] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(473), 10, + ACTIONS(473), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6357,13 +6431,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [5138] = 2, + [5177] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(475), 10, + ACTIONS(475), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6371,13 +6446,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [5154] = 2, + [5194] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(477), 10, + ACTIONS(477), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6385,29 +6461,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [5170] = 4, - ACTIONS(3), 1, - sym_comment, - ACTIONS(483), 1, - anon_sym_COMMA, - ACTIONS(481), 3, - anon_sym_RBRACE, - sym_u8_lit, - sym_string_lit, - ACTIONS(479), 6, - anon_sym__, - anon_sym_true, - anon_sym_false, - anon_sym_unit, - sym_int_lit, - sym_identifier, - [5190] = 2, + [5211] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(485), 10, + ACTIONS(479), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6415,13 +6476,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [5206] = 2, + [5228] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(487), 10, + ACTIONS(481), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6429,13 +6491,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [5222] = 2, + [5245] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(489), 10, + ACTIONS(483), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6443,28 +6506,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [5238] = 3, - ACTIONS(3), 1, - sym_comment, - ACTIONS(493), 4, - anon_sym_RBRACE, - anon_sym_COMMA, - sym_u8_lit, - sym_string_lit, - ACTIONS(491), 6, - anon_sym__, - anon_sym_true, - anon_sym_false, - anon_sym_unit, - sym_int_lit, - sym_identifier, - [5256] = 2, + [5262] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(495), 10, + ACTIONS(485), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6472,13 +6521,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [5272] = 2, + [5279] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(497), 10, + ACTIONS(487), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6486,13 +6536,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [5288] = 2, + [5296] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(499), 10, + ACTIONS(489), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6500,13 +6551,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [5304] = 2, + [5313] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(501), 10, + ACTIONS(491), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6514,13 +6566,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [5320] = 2, + [5330] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(503), 10, + ACTIONS(493), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6528,13 +6581,14 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [5336] = 2, + [5347] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(505), 10, + ACTIONS(495), 11, ts_builtin_sym_end, anon_sym_pub, anon_sym_fn, @@ -6542,247 +6596,270 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, anon_sym_enum, anon_sym_impl, - [5352] = 3, + [5364] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(407), 3, + ACTIONS(501), 1, + anon_sym_COMMA, + ACTIONS(499), 3, anon_sym_RBRACE, sym_u8_lit, sym_string_lit, - ACTIONS(507), 6, + ACTIONS(497), 6, anon_sym__, anon_sym_true, anon_sym_false, anon_sym_unit, sym_int_lit, sym_identifier, - [5369] = 5, + [5384] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(511), 1, + ACTIONS(505), 4, + anon_sym_RBRACE, + anon_sym_COMMA, + sym_u8_lit, + sym_string_lit, + ACTIONS(503), 6, + anon_sym__, + anon_sym_true, + anon_sym_false, + anon_sym_unit, + sym_int_lit, + sym_identifier, + [5402] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(509), 1, anon_sym_fn, - ACTIONS(513), 1, + ACTIONS(511), 1, anon_sym_extern, - ACTIONS(515), 1, + ACTIONS(513), 1, anon_sym_enum, - ACTIONS(509), 5, + ACTIONS(507), 6, anon_sym_pub, anon_sym_linear, anon_sym_copy, anon_sym_opaque, + anon_sym_capability, anon_sym_struct, - [5389] = 4, + [5423] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(409), 3, + anon_sym_RBRACE, + sym_u8_lit, + sym_string_lit, + ACTIONS(515), 6, + anon_sym__, + anon_sym_true, + anon_sym_false, + anon_sym_unit, + sym_int_lit, + sym_identifier, + [5440] = 4, ACTIONS(3), 1, sym_comment, ACTIONS(520), 1, anon_sym_struct, STATE(150), 1, aux_sym_struct_decl_repeat1, - ACTIONS(517), 4, + ACTIONS(517), 5, anon_sym_pub, anon_sym_linear, anon_sym_copy, anon_sym_opaque, - [5405] = 6, + anon_sym_capability, + [5457] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(524), 1, + anon_sym_struct, + STATE(150), 1, + aux_sym_struct_decl_repeat1, + ACTIONS(522), 5, + anon_sym_pub, + anon_sym_linear, + anon_sym_copy, + anon_sym_opaque, + anon_sym_capability, + [5474] = 6, ACTIONS(3), 1, sym_comment, - ACTIONS(522), 1, - sym_identifier, ACTIONS(526), 1, + sym_identifier, + ACTIONS(530), 1, anon_sym_RBRACK, - STATE(77), 1, + STATE(75), 1, sym_type_path, - STATE(236), 1, + STATE(220), 1, sym_type, - ACTIONS(524), 2, + ACTIONS(528), 2, anon_sym_STAR, anon_sym_AMP, - [5425] = 6, + [5494] = 6, ACTIONS(3), 1, sym_comment, - ACTIONS(522), 1, + ACTIONS(526), 1, sym_identifier, - ACTIONS(528), 1, + ACTIONS(532), 1, anon_sym_RBRACK, - STATE(77), 1, + STATE(75), 1, sym_type_path, - STATE(236), 1, + STATE(220), 1, sym_type, - ACTIONS(524), 2, + ACTIONS(528), 2, anon_sym_STAR, anon_sym_AMP, - [5445] = 4, + [5514] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(532), 1, - anon_sym_struct, - STATE(150), 1, - aux_sym_struct_decl_repeat1, - ACTIONS(530), 4, + ACTIONS(534), 1, anon_sym_pub, - anon_sym_linear, - anon_sym_copy, - anon_sym_opaque, - [5461] = 5, + ACTIONS(536), 1, + anon_sym_fn, + ACTIONS(538), 1, + anon_sym_RBRACE, + STATE(162), 2, + sym_method_decl, + aux_sym_impl_block_repeat1, + [5531] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(522), 1, + ACTIONS(526), 1, sym_identifier, - STATE(77), 1, + STATE(75), 1, sym_type_path, - STATE(254), 1, + STATE(208), 1, sym_type, - ACTIONS(524), 2, + ACTIONS(528), 2, anon_sym_STAR, anon_sym_AMP, - [5478] = 5, + [5548] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(522), 1, + ACTIONS(526), 1, sym_identifier, - STATE(77), 1, + STATE(75), 1, sym_type_path, - STATE(273), 1, + STATE(215), 1, sym_type, - ACTIONS(524), 2, + ACTIONS(528), 2, anon_sym_STAR, anon_sym_AMP, - [5495] = 5, + [5565] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(522), 1, + ACTIONS(526), 1, sym_identifier, - STATE(77), 1, + STATE(75), 1, sym_type_path, - STATE(196), 1, + STATE(278), 1, sym_type, - ACTIONS(524), 2, + ACTIONS(528), 2, anon_sym_STAR, anon_sym_AMP, - [5512] = 5, + [5582] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(522), 1, + ACTIONS(526), 1, sym_identifier, - STATE(77), 1, + STATE(75), 1, sym_type_path, - STATE(226), 1, + STATE(223), 1, sym_type, - ACTIONS(524), 2, + ACTIONS(528), 2, anon_sym_STAR, anon_sym_AMP, - [5529] = 5, + [5599] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(522), 1, + ACTIONS(526), 1, sym_identifier, - STATE(77), 1, + STATE(75), 1, sym_type_path, - STATE(244), 1, + STATE(220), 1, sym_type, - ACTIONS(524), 2, + ACTIONS(528), 2, anon_sym_STAR, anon_sym_AMP, - [5546] = 5, + [5616] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(522), 1, + ACTIONS(526), 1, sym_identifier, - STATE(77), 1, + STATE(75), 1, sym_type_path, - STATE(123), 1, + STATE(276), 1, sym_type, - ACTIONS(524), 2, + ACTIONS(528), 2, anon_sym_STAR, anon_sym_AMP, - [5563] = 5, + [5633] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(522), 1, + ACTIONS(526), 1, sym_identifier, - STATE(77), 1, + STATE(75), 1, sym_type_path, - STATE(235), 1, + STATE(221), 1, sym_type, - ACTIONS(524), 2, + ACTIONS(528), 2, anon_sym_STAR, anon_sym_AMP, - [5580] = 5, + [5650] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(534), 1, + ACTIONS(540), 1, anon_sym_pub, - ACTIONS(536), 1, + ACTIONS(543), 1, anon_sym_fn, - ACTIONS(538), 1, + ACTIONS(546), 1, anon_sym_RBRACE, - STATE(169), 2, + STATE(162), 2, sym_method_decl, aux_sym_impl_block_repeat1, - [5597] = 5, - ACTIONS(3), 1, - sym_comment, - ACTIONS(522), 1, - sym_identifier, - STATE(77), 1, - sym_type_path, - STATE(230), 1, - sym_type, - ACTIONS(524), 2, - anon_sym_STAR, - anon_sym_AMP, - [5614] = 5, - ACTIONS(3), 1, - sym_comment, - ACTIONS(522), 1, - sym_identifier, - STATE(77), 1, - sym_type_path, - STATE(122), 1, - sym_type, - ACTIONS(524), 2, - anon_sym_STAR, - anon_sym_AMP, - [5631] = 5, + [5667] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(522), 1, + ACTIONS(526), 1, sym_identifier, - STATE(77), 1, + STATE(75), 1, sym_type_path, - STATE(91), 1, + STATE(222), 1, sym_type, - ACTIONS(524), 2, + ACTIONS(528), 2, anon_sym_STAR, anon_sym_AMP, - [5648] = 5, + [5684] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(522), 1, + ACTIONS(526), 1, sym_identifier, - STATE(77), 1, + STATE(75), 1, sym_type_path, - STATE(236), 1, + STATE(126), 1, sym_type, - ACTIONS(524), 2, + ACTIONS(528), 2, anon_sym_STAR, anon_sym_AMP, - [5665] = 5, + [5701] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(522), 1, + ACTIONS(526), 1, sym_identifier, - STATE(77), 1, + STATE(75), 1, sym_type_path, - STATE(238), 1, + STATE(283), 1, sym_type, - ACTIONS(524), 2, + ACTIONS(528), 2, anon_sym_STAR, anon_sym_AMP, - [5682] = 4, + [5718] = 4, ACTIONS(3), 1, sym_comment, STATE(3), 1, @@ -6793,43 +6870,55 @@ static const uint16_t ts_small_parse_table[] = { ACTIONS(17), 2, anon_sym_COLON_COLON, anon_sym_DOT, - [5697] = 5, + [5733] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(522), 1, + ACTIONS(526), 1, sym_identifier, - STATE(77), 1, + STATE(75), 1, sym_type_path, - STATE(217), 1, + STATE(239), 1, sym_type, - ACTIONS(524), 2, + ACTIONS(528), 2, anon_sym_STAR, anon_sym_AMP, - [5714] = 5, + [5750] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(540), 1, - anon_sym_pub, - ACTIONS(543), 1, - anon_sym_fn, - ACTIONS(546), 1, - anon_sym_RBRACE, - STATE(169), 2, - sym_method_decl, - aux_sym_impl_block_repeat1, - [5731] = 5, + ACTIONS(526), 1, + sym_identifier, + STATE(75), 1, + sym_type_path, + STATE(125), 1, + sym_type, + ACTIONS(528), 2, + anon_sym_STAR, + anon_sym_AMP, + [5767] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(522), 1, + ACTIONS(526), 1, sym_identifier, - STATE(77), 1, + STATE(75), 1, sym_type_path, - STATE(239), 1, + STATE(234), 1, + sym_type, + ACTIONS(528), 2, + anon_sym_STAR, + anon_sym_AMP, + [5784] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(526), 1, + sym_identifier, + STATE(75), 1, + sym_type_path, + STATE(83), 1, sym_type, - ACTIONS(524), 2, + ACTIONS(528), 2, anon_sym_STAR, anon_sym_AMP, - [5748] = 5, + [5801] = 5, ACTIONS(3), 1, sym_comment, ACTIONS(534), 1, @@ -6838,790 +6927,790 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_fn, ACTIONS(548), 1, anon_sym_RBRACE, - STATE(161), 2, + STATE(154), 2, sym_method_decl, aux_sym_impl_block_repeat1, - [5765] = 5, - ACTIONS(3), 1, - sym_comment, - ACTIONS(550), 1, - sym_identifier, - ACTIONS(552), 1, - anon_sym_RBRACE, - STATE(213), 1, - sym_enum_variant, - STATE(267), 1, - sym_enum_variants, - [5781] = 5, - ACTIONS(3), 1, - sym_comment, - ACTIONS(554), 1, - sym_identifier, - ACTIONS(556), 1, - anon_sym_RPAREN, - ACTIONS(558), 1, - sym_self_param, - STATE(221), 1, - sym_param, - [5797] = 4, + [5818] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(330), 1, + ACTIONS(334), 1, anon_sym_LBRACE, - ACTIONS(560), 1, + ACTIONS(550), 1, anon_sym_if, - STATE(101), 2, + STATE(103), 2, sym_block, sym_if_stmt, - [5811] = 5, + [5832] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(550), 1, + ACTIONS(552), 1, sym_identifier, - ACTIONS(562), 1, + ACTIONS(554), 1, anon_sym_RBRACE, - STATE(213), 1, - sym_enum_variant, - STATE(280), 1, - sym_enum_variants, - [5827] = 5, + STATE(204), 1, + sym_field, + STATE(248), 1, + sym_field_list, + [5848] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(554), 1, + ACTIONS(556), 1, sym_identifier, ACTIONS(558), 1, + anon_sym_RPAREN, + ACTIONS(560), 1, sym_self_param, - ACTIONS(564), 1, + STATE(194), 1, + sym_param, + [5864] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(556), 1, + sym_identifier, + ACTIONS(560), 1, + sym_self_param, + ACTIONS(562), 1, anon_sym_RPAREN, - STATE(180), 1, + STATE(235), 1, sym_param, - [5843] = 5, + [5880] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(566), 1, + ACTIONS(552), 1, sym_identifier, - ACTIONS(568), 1, + ACTIONS(564), 1, anon_sym_RBRACE, - STATE(209), 1, + STATE(204), 1, sym_field, - STATE(270), 1, + STATE(269), 1, sym_field_list, - [5859] = 5, + [5896] = 5, ACTIONS(3), 1, sym_comment, ACTIONS(566), 1, sym_identifier, - ACTIONS(570), 1, + ACTIONS(568), 1, anon_sym_RBRACE, - STATE(209), 1, - sym_field, - STATE(272), 1, - sym_field_list, - [5875] = 5, + STATE(213), 1, + sym_enum_variant, + STATE(264), 1, + sym_enum_variants, + [5912] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(554), 1, + ACTIONS(556), 1, sym_identifier, - ACTIONS(558), 1, + ACTIONS(560), 1, sym_self_param, - ACTIONS(572), 1, + ACTIONS(570), 1, anon_sym_RPAREN, - STATE(221), 1, + STATE(235), 1, sym_param, - [5891] = 4, + [5928] = 5, ACTIONS(3), 1, sym_comment, + ACTIONS(566), 1, + sym_identifier, + ACTIONS(572), 1, + anon_sym_RBRACE, + STATE(213), 1, + sym_enum_variant, + STATE(279), 1, + sym_enum_variants, + [5944] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(360), 1, + anon_sym_RPAREN, ACTIONS(574), 1, anon_sym_COMMA, - ACTIONS(576), 1, - anon_sym_RPAREN, - STATE(191), 1, - aux_sym_param_list_repeat1, - [5904] = 4, + STATE(180), 1, + aux_sym_arg_list_repeat1, + [5957] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(578), 1, - anon_sym_COMMA, - ACTIONS(581), 1, - anon_sym_RPAREN, - STATE(181), 1, - aux_sym_param_list_repeat1, - [5917] = 4, + ACTIONS(577), 1, + anon_sym_DASH_GT, + ACTIONS(579), 1, + anon_sym_LBRACE, + STATE(141), 1, + sym_block, + [5970] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(566), 1, + ACTIONS(581), 1, sym_identifier, ACTIONS(583), 1, anon_sym_RBRACE, - STATE(218), 1, - sym_field, - [5930] = 4, + STATE(227), 1, + sym_struct_field, + [5983] = 4, ACTIONS(3), 1, sym_comment, ACTIONS(583), 1, anon_sym_RBRACE, ACTIONS(585), 1, anon_sym_COMMA, - STATE(202), 1, - aux_sym_field_list_repeat1, - [5943] = 4, + STATE(190), 1, + aux_sym_struct_literal_repeat1, + [5996] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(587), 1, - anon_sym_RBRACE, ACTIONS(589), 1, - anon_sym_COMMA, - STATE(193), 1, - aux_sym_struct_literal_repeat1, - [5956] = 4, + anon_sym_RPAREN, + ACTIONS(587), 2, + anon_sym__, + sym_identifier, + [6007] = 4, ACTIONS(3), 1, sym_comment, + ACTIONS(579), 1, + anon_sym_LBRACE, ACTIONS(591), 1, anon_sym_DASH_GT, - ACTIONS(593), 1, - anon_sym_LBRACE, - STATE(128), 1, + STATE(143), 1, sym_block, - [5969] = 4, + [6020] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(550), 1, - sym_identifier, - ACTIONS(595), 1, - anon_sym_RBRACE, - STATE(229), 1, - sym_enum_variant, - [5982] = 4, + ACTIONS(245), 1, + anon_sym_RPAREN, + ACTIONS(593), 1, + anon_sym_COMMA, + STATE(180), 1, + aux_sym_arg_list_repeat1, + [6033] = 4, ACTIONS(3), 1, sym_comment, ACTIONS(595), 1, - anon_sym_RBRACE, - ACTIONS(597), 1, anon_sym_COMMA, - STATE(207), 1, - aux_sym_enum_variants_repeat1, - [5995] = 4, + ACTIONS(598), 1, + anon_sym_RPAREN, + STATE(187), 1, + aux_sym_param_list_repeat1, + [6046] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(593), 1, - anon_sym_LBRACE, - ACTIONS(599), 1, - anon_sym_DASH_GT, - STATE(195), 1, - sym_block, - [6008] = 2, + ACTIONS(556), 1, + sym_identifier, + ACTIONS(560), 1, + sym_self_param, + STATE(235), 1, + sym_param, + [6059] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(581), 1, + sym_identifier, + ACTIONS(600), 1, + anon_sym_RBRACE, + STATE(227), 1, + sym_struct_field, + [6072] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(602), 1, + anon_sym_RBRACE, + ACTIONS(604), 1, + anon_sym_COMMA, + STATE(190), 1, + aux_sym_struct_literal_repeat1, + [6085] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(601), 3, + ACTIONS(607), 3, anon_sym_pub, anon_sym_fn, anon_sym_RBRACE, - [6017] = 4, + [6094] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(603), 1, + ACTIONS(552), 1, sym_identifier, - ACTIONS(605), 1, + ACTIONS(609), 1, anon_sym_RBRACE, - STATE(184), 1, - sym_struct_field, - [6030] = 4, + STATE(240), 1, + sym_field, + [6107] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(572), 1, - anon_sym_RPAREN, - ACTIONS(607), 1, + ACTIONS(611), 3, + anon_sym_pub, + anon_sym_fn, + anon_sym_RBRACE, + [6116] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(613), 1, anon_sym_COMMA, - STATE(181), 1, + ACTIONS(615), 1, + anon_sym_RPAREN, + STATE(199), 1, aux_sym_param_list_repeat1, - [6043] = 4, + [6129] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(603), 1, - sym_identifier, ACTIONS(609), 1, anon_sym_RBRACE, - STATE(219), 1, - sym_struct_field, - [6056] = 4, + ACTIONS(617), 1, + anon_sym_COMMA, + STATE(202), 1, + aux_sym_field_list_repeat1, + [6142] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(609), 1, + ACTIONS(619), 1, anon_sym_RBRACE, - ACTIONS(611), 1, + ACTIONS(621), 1, anon_sym_COMMA, - STATE(200), 1, + STATE(183), 1, aux_sym_struct_literal_repeat1, - [6069] = 4, + [6155] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(245), 1, - anon_sym_RPAREN, - ACTIONS(613), 1, - anon_sym_COMMA, - STATE(203), 1, - aux_sym_arg_list_repeat1, - [6082] = 2, + ACTIONS(552), 1, + sym_identifier, + ACTIONS(623), 1, + anon_sym_RBRACE, + STATE(240), 1, + sym_field, + [6168] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(615), 3, + ACTIONS(625), 3, anon_sym_pub, anon_sym_fn, anon_sym_RBRACE, - [6091] = 4, - ACTIONS(3), 1, - sym_comment, - ACTIONS(617), 1, - anon_sym_COMMA, - ACTIONS(619), 1, - anon_sym_RBRACK, - STATE(198), 1, - aux_sym_type_args_repeat1, - [6104] = 3, + [6177] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(623), 1, + ACTIONS(562), 1, anon_sym_RPAREN, - ACTIONS(621), 2, - anon_sym__, - sym_identifier, - [6115] = 4, - ACTIONS(3), 1, - sym_comment, - ACTIONS(526), 1, - anon_sym_RBRACK, - ACTIONS(625), 1, + ACTIONS(627), 1, anon_sym_COMMA, - STATE(210), 1, - aux_sym_type_args_repeat1, - [6128] = 4, + STATE(187), 1, + aux_sym_param_list_repeat1, + [6190] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(603), 1, - sym_identifier, - ACTIONS(627), 1, + ACTIONS(629), 3, + anon_sym_pub, + anon_sym_fn, anon_sym_RBRACE, - STATE(219), 1, - sym_struct_field, - [6141] = 4, + [6199] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(629), 1, - anon_sym_RBRACE, + ACTIONS(532), 1, + anon_sym_RBRACK, ACTIONS(631), 1, anon_sym_COMMA, - STATE(200), 1, - aux_sym_struct_literal_repeat1, - [6154] = 4, - ACTIONS(3), 1, - sym_comment, - ACTIONS(566), 1, - sym_identifier, - ACTIONS(634), 1, - anon_sym_RBRACE, - STATE(218), 1, - sym_field, - [6167] = 4, + STATE(203), 1, + aux_sym_type_args_repeat1, + [6212] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(636), 1, + ACTIONS(633), 1, anon_sym_RBRACE, - ACTIONS(638), 1, + ACTIONS(635), 1, anon_sym_COMMA, STATE(202), 1, aux_sym_field_list_repeat1, - [6180] = 4, + [6225] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(326), 1, - anon_sym_RPAREN, - ACTIONS(641), 1, + ACTIONS(638), 1, anon_sym_COMMA, + ACTIONS(641), 1, + anon_sym_RBRACK, STATE(203), 1, - aux_sym_arg_list_repeat1, - [6193] = 2, + aux_sym_type_args_repeat1, + [6238] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(644), 3, - anon_sym_pub, - anon_sym_fn, + ACTIONS(643), 1, anon_sym_RBRACE, - [6202] = 2, + ACTIONS(645), 1, + anon_sym_COMMA, + STATE(195), 1, + aux_sym_field_list_repeat1, + [6251] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(646), 3, - anon_sym_pub, - anon_sym_fn, + ACTIONS(566), 1, + sym_identifier, + ACTIONS(647), 1, anon_sym_RBRACE, - [6211] = 4, + STATE(242), 1, + sym_enum_variant, + [6264] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(550), 1, - sym_identifier, - ACTIONS(648), 1, + ACTIONS(651), 1, + anon_sym_LPAREN, + ACTIONS(649), 2, anon_sym_RBRACE, - STATE(229), 1, - sym_enum_variant, - [6224] = 4, + anon_sym_COMMA, + [6275] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(650), 1, + ACTIONS(647), 1, anon_sym_RBRACE, - ACTIONS(652), 1, + ACTIONS(653), 1, anon_sym_COMMA, - STATE(207), 1, + STATE(211), 1, aux_sym_enum_variants_repeat1, - [6237] = 4, + [6288] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(593), 1, - anon_sym_LBRACE, ACTIONS(655), 1, - anon_sym_DASH_GT, - STATE(189), 1, - sym_block, - [6250] = 4, + anon_sym_COMMA, + ACTIONS(657), 1, + anon_sym_RBRACK, + STATE(201), 1, + aux_sym_type_args_repeat1, + [6301] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(657), 1, - anon_sym_RBRACE, + ACTIONS(581), 1, + sym_identifier, ACTIONS(659), 1, - anon_sym_COMMA, - STATE(183), 1, - aux_sym_field_list_repeat1, - [6263] = 4, + anon_sym_RBRACE, + STATE(196), 1, + sym_struct_field, + [6314] = 4, ACTIONS(3), 1, sym_comment, + ACTIONS(566), 1, + sym_identifier, ACTIONS(661), 1, - anon_sym_COMMA, - ACTIONS(664), 1, - anon_sym_RBRACK, - STATE(210), 1, - aux_sym_type_args_repeat1, - [6276] = 4, + anon_sym_RBRACE, + STATE(242), 1, + sym_enum_variant, + [6327] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(554), 1, - sym_identifier, - ACTIONS(558), 1, - sym_self_param, - STATE(221), 1, - sym_param, - [6289] = 3, + ACTIONS(663), 1, + anon_sym_RBRACE, + ACTIONS(665), 1, + anon_sym_COMMA, + STATE(211), 1, + aux_sym_enum_variants_repeat1, + [6340] = 4, ACTIONS(3), 1, sym_comment, + ACTIONS(579), 1, + anon_sym_LBRACE, ACTIONS(668), 1, - anon_sym_LPAREN, - ACTIONS(666), 2, - anon_sym_RBRACE, - anon_sym_COMMA, - [6300] = 4, + anon_sym_DASH_GT, + STATE(200), 1, + sym_block, + [6353] = 4, ACTIONS(3), 1, sym_comment, ACTIONS(670), 1, anon_sym_RBRACE, ACTIONS(672), 1, anon_sym_COMMA, - STATE(187), 1, + STATE(207), 1, aux_sym_enum_variants_repeat1, - [6313] = 4, + [6366] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(593), 1, + ACTIONS(579), 1, anon_sym_LBRACE, ACTIONS(674), 1, anon_sym_DASH_GT, - STATE(138), 1, + STATE(191), 1, sym_block, - [6326] = 3, + [6379] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(579), 1, + anon_sym_LBRACE, + STATE(198), 1, + sym_block, + [6389] = 3, ACTIONS(3), 1, sym_comment, ACTIONS(676), 1, sym_identifier, - STATE(126), 1, + STATE(127), 1, sym_module_path, - [6336] = 3, + [6399] = 3, ACTIONS(3), 1, sym_comment, ACTIONS(678), 1, anon_sym_LPAREN, - STATE(208), 1, + STATE(214), 1, sym_param_list, - [6346] = 2, + [6409] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(680), 2, - anon_sym_RBRACE, - anon_sym_COMMA, - [6354] = 2, + ACTIONS(680), 1, + anon_sym_LPAREN, + ACTIONS(682), 1, + anon_sym_EQ_GT, + [6419] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(636), 2, - anon_sym_RBRACE, - anon_sym_COMMA, - [6362] = 2, + ACTIONS(684), 1, + anon_sym_COLON, + ACTIONS(686), 1, + anon_sym_EQ, + [6429] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(629), 2, - anon_sym_RBRACE, + ACTIONS(641), 2, anon_sym_COMMA, - [6370] = 3, + anon_sym_RBRACK, + [6437] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(678), 1, - anon_sym_LPAREN, - STATE(121), 1, - sym_param_list, - [6380] = 2, + ACTIONS(579), 1, + anon_sym_LBRACE, + STATE(142), 1, + sym_block, + [6447] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(581), 2, - anon_sym_COMMA, - anon_sym_RPAREN, - [6388] = 3, + ACTIONS(579), 1, + anon_sym_LBRACE, + STATE(132), 1, + sym_block, + [6457] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(682), 1, - anon_sym_LPAREN, - ACTIONS(684), 1, - anon_sym_EQ_GT, - [6398] = 3, + ACTIONS(579), 1, + anon_sym_LBRACE, + STATE(193), 1, + sym_block, + [6467] = 3, ACTIONS(3), 1, sym_comment, ACTIONS(678), 1, anon_sym_LPAREN, - STATE(185), 1, + STATE(121), 1, sym_param_list, - [6408] = 2, + [6477] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(686), 2, - anon_sym_COMMA, - anon_sym_RPAREN, - [6416] = 3, + ACTIONS(334), 1, + anon_sym_LBRACE, + STATE(147), 1, + sym_block, + [6487] = 3, ACTIONS(3), 1, sym_comment, ACTIONS(678), 1, anon_sym_LPAREN, - STATE(214), 1, + STATE(181), 1, sym_param_list, - [6426] = 3, - ACTIONS(3), 1, - sym_comment, - ACTIONS(593), 1, - anon_sym_LBRACE, - STATE(205), 1, - sym_block, - [6436] = 3, - ACTIONS(3), 1, - sym_comment, - ACTIONS(566), 1, - sym_identifier, - STATE(218), 1, - sym_field, - [6446] = 3, - ACTIONS(3), 1, - sym_comment, - ACTIONS(603), 1, - sym_identifier, - STATE(219), 1, - sym_struct_field, - [6456] = 2, + [6497] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(650), 2, + ACTIONS(602), 2, anon_sym_RBRACE, anon_sym_COMMA, - [6464] = 2, + [6505] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(688), 2, - anon_sym_COMMA, - anon_sym_RPAREN, - [6472] = 2, + ACTIONS(7), 1, + anon_sym_module, + STATE(69), 1, + sym_module_decl, + [6515] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(690), 2, - anon_sym_RBRACE, - anon_sym_COMMA, - [6480] = 2, + ACTIONS(678), 1, + anon_sym_LPAREN, + STATE(185), 1, + sym_param_list, + [6525] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(692), 2, + ACTIONS(688), 2, anon_sym_safe, anon_sym_unsafe, - [6488] = 3, + [6533] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(550), 1, + ACTIONS(581), 1, sym_identifier, - STATE(229), 1, - sym_enum_variant, - [6498] = 3, + STATE(227), 1, + sym_struct_field, + [6543] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(676), 1, + sym_identifier, + STATE(122), 1, + sym_module_path, + [6553] = 3, ACTIONS(3), 1, sym_comment, ACTIONS(678), 1, anon_sym_LPAREN, - STATE(188), 1, + STATE(120), 1, sym_param_list, - [6508] = 3, + [6563] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(593), 1, - anon_sym_LBRACE, - STATE(204), 1, - sym_block, - [6518] = 2, - ACTIONS(3), 1, - sym_comment, - ACTIONS(664), 2, + ACTIONS(690), 2, anon_sym_COMMA, - anon_sym_RBRACK, - [6526] = 3, + anon_sym_RPAREN, + [6571] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(7), 1, - anon_sym_module, - STATE(69), 1, - sym_module_decl, - [6536] = 3, + ACTIONS(598), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [6579] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(593), 1, - anon_sym_LBRACE, - STATE(135), 1, - sym_block, - [6546] = 3, + ACTIONS(552), 1, + sym_identifier, + STATE(240), 1, + sym_field, + [6589] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(593), 1, - anon_sym_LBRACE, - STATE(146), 1, - sym_block, - [6556] = 3, + ACTIONS(692), 2, + anon_sym_RBRACE, + anon_sym_COMMA, + [6597] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(676), 1, + ACTIONS(566), 1, sym_identifier, - STATE(127), 1, - sym_module_path, - [6566] = 3, + STATE(242), 1, + sym_enum_variant, + [6607] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(330), 1, - anon_sym_LBRACE, - STATE(141), 1, - sym_block, - [6576] = 3, + ACTIONS(694), 2, + anon_sym_RBRACE, + anon_sym_COMMA, + [6615] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(694), 1, - anon_sym_COLON, - ACTIONS(696), 1, - anon_sym_EQ, - [6586] = 3, + ACTIONS(633), 2, + anon_sym_RBRACE, + anon_sym_COMMA, + [6623] = 3, ACTIONS(3), 1, sym_comment, ACTIONS(678), 1, anon_sym_LPAREN, - STATE(120), 1, + STATE(212), 1, sym_param_list, - [6596] = 2, + [6633] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(663), 2, + anon_sym_RBRACE, + anon_sym_COMMA, + [6641] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(696), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [6649] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(698), 1, - anon_sym_LBRACE, - [6603] = 2, + anon_sym_EQ_GT, + [6656] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(700), 1, - anon_sym_EQ_GT, - [6610] = 2, + anon_sym_LBRACE, + [6663] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(702), 1, - sym_identifier, - [6617] = 2, + anon_sym_LBRACE, + [6670] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(704), 1, - anon_sym_fn, - [6624] = 2, + anon_sym_LBRACE, + [6677] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(706), 1, - sym_identifier, - [6631] = 2, + anon_sym_RBRACE, + [6684] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(708), 1, - anon_sym_LBRACE, - [6638] = 2, + anon_sym_COLON, + [6691] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(710), 1, - anon_sym_LBRACE, - [6645] = 2, + anon_sym_COLON, + [6698] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(712), 1, - anon_sym_module, - [6652] = 2, + sym_identifier, + [6705] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(714), 1, sym_identifier, - [6659] = 2, + [6712] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(716), 1, - anon_sym_COLON, - [6666] = 2, + sym_identifier, + [6719] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(718), 1, - anon_sym_RPAREN, - [6673] = 2, + sym_identifier, + [6726] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(720), 1, anon_sym_EQ_GT, - [6680] = 2, + [6733] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(722), 1, anon_sym_RPAREN, - [6687] = 2, + [6740] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(724), 1, - anon_sym_fn, - [6694] = 2, + anon_sym_LBRACE, + [6747] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(726), 1, - ts_builtin_sym_end, - [6701] = 2, + sym_identifier, + [6754] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(728), 1, - anon_sym_LBRACE, - [6708] = 2, + sym_identifier, + [6761] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(730), 1, - sym_identifier, - [6715] = 2, + anon_sym_LBRACE, + [6768] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(732), 1, - sym_identifier, - [6722] = 2, + anon_sym_module, + [6775] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(734), 1, - sym_identifier, - [6729] = 2, + anon_sym_EQ_GT, + [6782] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(736), 1, - anon_sym_EQ_GT, - [6736] = 2, + sym_identifier, + [6789] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(738), 1, - sym_identifier, - [6743] = 2, + anon_sym_RBRACE, + [6796] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(740), 1, - sym_identifier, - [6750] = 2, + anon_sym_fn, + [6803] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(742), 1, sym_identifier, - [6757] = 2, + [6810] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(744), 1, - anon_sym_RBRACE, - [6764] = 2, + sym_identifier, + [6817] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(746), 1, - anon_sym_LBRACE, - [6771] = 2, + anon_sym_COLON, + [6824] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(748), 1, - anon_sym_COLON, - [6778] = 2, + anon_sym_RBRACE, + [6831] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(750), 1, - anon_sym_RBRACE, - [6785] = 2, + anon_sym_fn, + [6838] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(752), 1, - sym_identifier, - [6792] = 2, + ts_builtin_sym_end, + [6845] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(754), 1, - anon_sym_RBRACE, - [6799] = 2, + sym_identifier, + [6852] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(756), 1, - anon_sym_EQ, - [6806] = 2, + sym_identifier, + [6859] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(758), 1, sym_identifier, - [6813] = 2, + [6866] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(760), 1, sym_identifier, - [6820] = 2, + [6873] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(762), 1, - sym_identifier, - [6827] = 2, + anon_sym_RPAREN, + [6880] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(764), 1, - sym_identifier, - [6834] = 2, + ACTIONS(682), 1, + anon_sym_EQ_GT, + [6887] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(766), 1, - anon_sym_COLON, - [6841] = 2, + ACTIONS(764), 1, + anon_sym_EQ, + [6894] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(684), 1, - anon_sym_EQ_GT, - [6848] = 2, + ACTIONS(766), 1, + anon_sym_RBRACE, + [6901] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(768), 1, - anon_sym_RBRACE, - [6855] = 2, + sym_identifier, + [6908] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(770), 1, anon_sym_fn, - [6862] = 2, + [6915] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(772), 1, sym_identifier, - [6869] = 2, + [6922] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(774), 1, @@ -7673,288 +7762,288 @@ static const uint32_t ts_small_parse_table_map[] = { [SMALL_STATE(43)] = 2080, [SMALL_STATE(44)] = 2127, [SMALL_STATE(45)] = 2171, - [SMALL_STATE(46)] = 2215, - [SMALL_STATE(47)] = 2259, - [SMALL_STATE(48)] = 2303, - [SMALL_STATE(49)] = 2347, - [SMALL_STATE(50)] = 2391, - [SMALL_STATE(51)] = 2435, - [SMALL_STATE(52)] = 2479, - [SMALL_STATE(53)] = 2523, - [SMALL_STATE(54)] = 2567, - [SMALL_STATE(55)] = 2611, - [SMALL_STATE(56)] = 2655, - [SMALL_STATE(57)] = 2699, - [SMALL_STATE(58)] = 2743, - [SMALL_STATE(59)] = 2787, - [SMALL_STATE(60)] = 2831, - [SMALL_STATE(61)] = 2875, - [SMALL_STATE(62)] = 2919, - [SMALL_STATE(63)] = 2963, - [SMALL_STATE(64)] = 3007, - [SMALL_STATE(65)] = 3051, - [SMALL_STATE(66)] = 3095, - [SMALL_STATE(67)] = 3139, - [SMALL_STATE(68)] = 3188, - [SMALL_STATE(69)] = 3237, - [SMALL_STATE(70)] = 3286, - [SMALL_STATE(71)] = 3317, - [SMALL_STATE(72)] = 3366, - [SMALL_STATE(73)] = 3396, - [SMALL_STATE(74)] = 3426, - [SMALL_STATE(75)] = 3452, - [SMALL_STATE(76)] = 3479, - [SMALL_STATE(77)] = 3516, - [SMALL_STATE(78)] = 3545, - [SMALL_STATE(79)] = 3572, - [SMALL_STATE(80)] = 3614, - [SMALL_STATE(81)] = 3656, - [SMALL_STATE(82)] = 3698, - [SMALL_STATE(83)] = 3740, - [SMALL_STATE(84)] = 3790, - [SMALL_STATE(85)] = 3835, - [SMALL_STATE(86)] = 3858, - [SMALL_STATE(87)] = 3905, - [SMALL_STATE(88)] = 3952, - [SMALL_STATE(89)] = 3975, - [SMALL_STATE(90)] = 4002, - [SMALL_STATE(91)] = 4025, - [SMALL_STATE(92)] = 4048, - [SMALL_STATE(93)] = 4093, - [SMALL_STATE(94)] = 4120, - [SMALL_STATE(95)] = 4164, - [SMALL_STATE(96)] = 4188, - [SMALL_STATE(97)] = 4212, - [SMALL_STATE(98)] = 4236, - [SMALL_STATE(99)] = 4260, - [SMALL_STATE(100)] = 4284, - [SMALL_STATE(101)] = 4308, - [SMALL_STATE(102)] = 4332, - [SMALL_STATE(103)] = 4366, - [SMALL_STATE(104)] = 4408, - [SMALL_STATE(105)] = 4446, - [SMALL_STATE(106)] = 4470, - [SMALL_STATE(107)] = 4514, - [SMALL_STATE(108)] = 4550, - [SMALL_STATE(109)] = 4574, - [SMALL_STATE(110)] = 4614, - [SMALL_STATE(111)] = 4653, - [SMALL_STATE(112)] = 4692, - [SMALL_STATE(113)] = 4731, - [SMALL_STATE(114)] = 4754, - [SMALL_STATE(115)] = 4773, - [SMALL_STATE(116)] = 4792, - [SMALL_STATE(117)] = 4811, - [SMALL_STATE(118)] = 4834, - [SMALL_STATE(119)] = 4853, - [SMALL_STATE(120)] = 4876, - [SMALL_STATE(121)] = 4898, - [SMALL_STATE(122)] = 4920, - [SMALL_STATE(123)] = 4939, - [SMALL_STATE(124)] = 4958, - [SMALL_STATE(125)] = 4975, - [SMALL_STATE(126)] = 4992, - [SMALL_STATE(127)] = 5009, - [SMALL_STATE(128)] = 5026, - [SMALL_STATE(129)] = 5042, - [SMALL_STATE(130)] = 5058, - [SMALL_STATE(131)] = 5074, - [SMALL_STATE(132)] = 5090, - [SMALL_STATE(133)] = 5106, - [SMALL_STATE(134)] = 5122, - [SMALL_STATE(135)] = 5138, - [SMALL_STATE(136)] = 5154, - [SMALL_STATE(137)] = 5170, - [SMALL_STATE(138)] = 5190, - [SMALL_STATE(139)] = 5206, - [SMALL_STATE(140)] = 5222, - [SMALL_STATE(141)] = 5238, - [SMALL_STATE(142)] = 5256, - [SMALL_STATE(143)] = 5272, - [SMALL_STATE(144)] = 5288, - [SMALL_STATE(145)] = 5304, - [SMALL_STATE(146)] = 5320, - [SMALL_STATE(147)] = 5336, - [SMALL_STATE(148)] = 5352, - [SMALL_STATE(149)] = 5369, - [SMALL_STATE(150)] = 5389, - [SMALL_STATE(151)] = 5405, - [SMALL_STATE(152)] = 5425, - [SMALL_STATE(153)] = 5445, - [SMALL_STATE(154)] = 5461, - [SMALL_STATE(155)] = 5478, - [SMALL_STATE(156)] = 5495, - [SMALL_STATE(157)] = 5512, - [SMALL_STATE(158)] = 5529, - [SMALL_STATE(159)] = 5546, - [SMALL_STATE(160)] = 5563, - [SMALL_STATE(161)] = 5580, - [SMALL_STATE(162)] = 5597, - [SMALL_STATE(163)] = 5614, - [SMALL_STATE(164)] = 5631, - [SMALL_STATE(165)] = 5648, - [SMALL_STATE(166)] = 5665, - [SMALL_STATE(167)] = 5682, - [SMALL_STATE(168)] = 5697, - [SMALL_STATE(169)] = 5714, - [SMALL_STATE(170)] = 5731, - [SMALL_STATE(171)] = 5748, - [SMALL_STATE(172)] = 5765, - [SMALL_STATE(173)] = 5781, - [SMALL_STATE(174)] = 5797, - [SMALL_STATE(175)] = 5811, - [SMALL_STATE(176)] = 5827, - [SMALL_STATE(177)] = 5843, - [SMALL_STATE(178)] = 5859, - [SMALL_STATE(179)] = 5875, - [SMALL_STATE(180)] = 5891, - [SMALL_STATE(181)] = 5904, - [SMALL_STATE(182)] = 5917, - [SMALL_STATE(183)] = 5930, - [SMALL_STATE(184)] = 5943, - [SMALL_STATE(185)] = 5956, - [SMALL_STATE(186)] = 5969, - [SMALL_STATE(187)] = 5982, - [SMALL_STATE(188)] = 5995, - [SMALL_STATE(189)] = 6008, - [SMALL_STATE(190)] = 6017, - [SMALL_STATE(191)] = 6030, - [SMALL_STATE(192)] = 6043, - [SMALL_STATE(193)] = 6056, - [SMALL_STATE(194)] = 6069, - [SMALL_STATE(195)] = 6082, - [SMALL_STATE(196)] = 6091, - [SMALL_STATE(197)] = 6104, - [SMALL_STATE(198)] = 6115, - [SMALL_STATE(199)] = 6128, - [SMALL_STATE(200)] = 6141, - [SMALL_STATE(201)] = 6154, - [SMALL_STATE(202)] = 6167, - [SMALL_STATE(203)] = 6180, - [SMALL_STATE(204)] = 6193, - [SMALL_STATE(205)] = 6202, - [SMALL_STATE(206)] = 6211, - [SMALL_STATE(207)] = 6224, - [SMALL_STATE(208)] = 6237, - [SMALL_STATE(209)] = 6250, - [SMALL_STATE(210)] = 6263, - [SMALL_STATE(211)] = 6276, - [SMALL_STATE(212)] = 6289, - [SMALL_STATE(213)] = 6300, - [SMALL_STATE(214)] = 6313, - [SMALL_STATE(215)] = 6326, - [SMALL_STATE(216)] = 6336, - [SMALL_STATE(217)] = 6346, - [SMALL_STATE(218)] = 6354, - [SMALL_STATE(219)] = 6362, - [SMALL_STATE(220)] = 6370, - [SMALL_STATE(221)] = 6380, - [SMALL_STATE(222)] = 6388, - [SMALL_STATE(223)] = 6398, - [SMALL_STATE(224)] = 6408, - [SMALL_STATE(225)] = 6416, - [SMALL_STATE(226)] = 6426, - [SMALL_STATE(227)] = 6436, - [SMALL_STATE(228)] = 6446, - [SMALL_STATE(229)] = 6456, - [SMALL_STATE(230)] = 6464, - [SMALL_STATE(231)] = 6472, - [SMALL_STATE(232)] = 6480, - [SMALL_STATE(233)] = 6488, - [SMALL_STATE(234)] = 6498, - [SMALL_STATE(235)] = 6508, - [SMALL_STATE(236)] = 6518, - [SMALL_STATE(237)] = 6526, - [SMALL_STATE(238)] = 6536, - [SMALL_STATE(239)] = 6546, - [SMALL_STATE(240)] = 6556, - [SMALL_STATE(241)] = 6566, - [SMALL_STATE(242)] = 6576, - [SMALL_STATE(243)] = 6586, - [SMALL_STATE(244)] = 6596, - [SMALL_STATE(245)] = 6603, - [SMALL_STATE(246)] = 6610, - [SMALL_STATE(247)] = 6617, - [SMALL_STATE(248)] = 6624, - [SMALL_STATE(249)] = 6631, - [SMALL_STATE(250)] = 6638, - [SMALL_STATE(251)] = 6645, - [SMALL_STATE(252)] = 6652, - [SMALL_STATE(253)] = 6659, - [SMALL_STATE(254)] = 6666, - [SMALL_STATE(255)] = 6673, - [SMALL_STATE(256)] = 6680, - [SMALL_STATE(257)] = 6687, - [SMALL_STATE(258)] = 6694, - [SMALL_STATE(259)] = 6701, - [SMALL_STATE(260)] = 6708, - [SMALL_STATE(261)] = 6715, - [SMALL_STATE(262)] = 6722, - [SMALL_STATE(263)] = 6729, - [SMALL_STATE(264)] = 6736, - [SMALL_STATE(265)] = 6743, - [SMALL_STATE(266)] = 6750, - [SMALL_STATE(267)] = 6757, - [SMALL_STATE(268)] = 6764, - [SMALL_STATE(269)] = 6771, - [SMALL_STATE(270)] = 6778, - [SMALL_STATE(271)] = 6785, - [SMALL_STATE(272)] = 6792, - [SMALL_STATE(273)] = 6799, - [SMALL_STATE(274)] = 6806, - [SMALL_STATE(275)] = 6813, - [SMALL_STATE(276)] = 6820, - [SMALL_STATE(277)] = 6827, - [SMALL_STATE(278)] = 6834, - [SMALL_STATE(279)] = 6841, - [SMALL_STATE(280)] = 6848, - [SMALL_STATE(281)] = 6855, - [SMALL_STATE(282)] = 6862, - [SMALL_STATE(283)] = 6869, + [SMALL_STATE(46)] = 2221, + [SMALL_STATE(47)] = 2265, + [SMALL_STATE(48)] = 2315, + [SMALL_STATE(49)] = 2359, + [SMALL_STATE(50)] = 2403, + [SMALL_STATE(51)] = 2447, + [SMALL_STATE(52)] = 2491, + [SMALL_STATE(53)] = 2535, + [SMALL_STATE(54)] = 2579, + [SMALL_STATE(55)] = 2623, + [SMALL_STATE(56)] = 2667, + [SMALL_STATE(57)] = 2711, + [SMALL_STATE(58)] = 2755, + [SMALL_STATE(59)] = 2799, + [SMALL_STATE(60)] = 2843, + [SMALL_STATE(61)] = 2893, + [SMALL_STATE(62)] = 2937, + [SMALL_STATE(63)] = 2981, + [SMALL_STATE(64)] = 3025, + [SMALL_STATE(65)] = 3069, + [SMALL_STATE(66)] = 3113, + [SMALL_STATE(67)] = 3157, + [SMALL_STATE(68)] = 3201, + [SMALL_STATE(69)] = 3233, + [SMALL_STATE(70)] = 3283, + [SMALL_STATE(71)] = 3327, + [SMALL_STATE(72)] = 3371, + [SMALL_STATE(73)] = 3402, + [SMALL_STATE(74)] = 3433, + [SMALL_STATE(75)] = 3460, + [SMALL_STATE(76)] = 3490, + [SMALL_STATE(77)] = 3517, + [SMALL_STATE(78)] = 3560, + [SMALL_STATE(79)] = 3603, + [SMALL_STATE(80)] = 3646, + [SMALL_STATE(81)] = 3689, + [SMALL_STATE(82)] = 3716, + [SMALL_STATE(83)] = 3753, + [SMALL_STATE(84)] = 3777, + [SMALL_STATE(85)] = 3801, + [SMALL_STATE(86)] = 3825, + [SMALL_STATE(87)] = 3849, + [SMALL_STATE(88)] = 3899, + [SMALL_STATE(89)] = 3946, + [SMALL_STATE(90)] = 3973, + [SMALL_STATE(91)] = 4020, + [SMALL_STATE(92)] = 4047, + [SMALL_STATE(93)] = 4092, + [SMALL_STATE(94)] = 4137, + [SMALL_STATE(95)] = 4161, + [SMALL_STATE(96)] = 4199, + [SMALL_STATE(97)] = 4235, + [SMALL_STATE(98)] = 4279, + [SMALL_STATE(99)] = 4303, + [SMALL_STATE(100)] = 4327, + [SMALL_STATE(101)] = 4351, + [SMALL_STATE(102)] = 4375, + [SMALL_STATE(103)] = 4399, + [SMALL_STATE(104)] = 4423, + [SMALL_STATE(105)] = 4447, + [SMALL_STATE(106)] = 4491, + [SMALL_STATE(107)] = 4515, + [SMALL_STATE(108)] = 4549, + [SMALL_STATE(109)] = 4589, + [SMALL_STATE(110)] = 4631, + [SMALL_STATE(111)] = 4670, + [SMALL_STATE(112)] = 4709, + [SMALL_STATE(113)] = 4748, + [SMALL_STATE(114)] = 4772, + [SMALL_STATE(115)] = 4796, + [SMALL_STATE(116)] = 4816, + [SMALL_STATE(117)] = 4836, + [SMALL_STATE(118)] = 4856, + [SMALL_STATE(119)] = 4880, + [SMALL_STATE(120)] = 4900, + [SMALL_STATE(121)] = 4923, + [SMALL_STATE(122)] = 4946, + [SMALL_STATE(123)] = 4964, + [SMALL_STATE(124)] = 4982, + [SMALL_STATE(125)] = 5000, + [SMALL_STATE(126)] = 5020, + [SMALL_STATE(127)] = 5040, + [SMALL_STATE(128)] = 5058, + [SMALL_STATE(129)] = 5075, + [SMALL_STATE(130)] = 5092, + [SMALL_STATE(131)] = 5109, + [SMALL_STATE(132)] = 5126, + [SMALL_STATE(133)] = 5143, + [SMALL_STATE(134)] = 5160, + [SMALL_STATE(135)] = 5177, + [SMALL_STATE(136)] = 5194, + [SMALL_STATE(137)] = 5211, + [SMALL_STATE(138)] = 5228, + [SMALL_STATE(139)] = 5245, + [SMALL_STATE(140)] = 5262, + [SMALL_STATE(141)] = 5279, + [SMALL_STATE(142)] = 5296, + [SMALL_STATE(143)] = 5313, + [SMALL_STATE(144)] = 5330, + [SMALL_STATE(145)] = 5347, + [SMALL_STATE(146)] = 5364, + [SMALL_STATE(147)] = 5384, + [SMALL_STATE(148)] = 5402, + [SMALL_STATE(149)] = 5423, + [SMALL_STATE(150)] = 5440, + [SMALL_STATE(151)] = 5457, + [SMALL_STATE(152)] = 5474, + [SMALL_STATE(153)] = 5494, + [SMALL_STATE(154)] = 5514, + [SMALL_STATE(155)] = 5531, + [SMALL_STATE(156)] = 5548, + [SMALL_STATE(157)] = 5565, + [SMALL_STATE(158)] = 5582, + [SMALL_STATE(159)] = 5599, + [SMALL_STATE(160)] = 5616, + [SMALL_STATE(161)] = 5633, + [SMALL_STATE(162)] = 5650, + [SMALL_STATE(163)] = 5667, + [SMALL_STATE(164)] = 5684, + [SMALL_STATE(165)] = 5701, + [SMALL_STATE(166)] = 5718, + [SMALL_STATE(167)] = 5733, + [SMALL_STATE(168)] = 5750, + [SMALL_STATE(169)] = 5767, + [SMALL_STATE(170)] = 5784, + [SMALL_STATE(171)] = 5801, + [SMALL_STATE(172)] = 5818, + [SMALL_STATE(173)] = 5832, + [SMALL_STATE(174)] = 5848, + [SMALL_STATE(175)] = 5864, + [SMALL_STATE(176)] = 5880, + [SMALL_STATE(177)] = 5896, + [SMALL_STATE(178)] = 5912, + [SMALL_STATE(179)] = 5928, + [SMALL_STATE(180)] = 5944, + [SMALL_STATE(181)] = 5957, + [SMALL_STATE(182)] = 5970, + [SMALL_STATE(183)] = 5983, + [SMALL_STATE(184)] = 5996, + [SMALL_STATE(185)] = 6007, + [SMALL_STATE(186)] = 6020, + [SMALL_STATE(187)] = 6033, + [SMALL_STATE(188)] = 6046, + [SMALL_STATE(189)] = 6059, + [SMALL_STATE(190)] = 6072, + [SMALL_STATE(191)] = 6085, + [SMALL_STATE(192)] = 6094, + [SMALL_STATE(193)] = 6107, + [SMALL_STATE(194)] = 6116, + [SMALL_STATE(195)] = 6129, + [SMALL_STATE(196)] = 6142, + [SMALL_STATE(197)] = 6155, + [SMALL_STATE(198)] = 6168, + [SMALL_STATE(199)] = 6177, + [SMALL_STATE(200)] = 6190, + [SMALL_STATE(201)] = 6199, + [SMALL_STATE(202)] = 6212, + [SMALL_STATE(203)] = 6225, + [SMALL_STATE(204)] = 6238, + [SMALL_STATE(205)] = 6251, + [SMALL_STATE(206)] = 6264, + [SMALL_STATE(207)] = 6275, + [SMALL_STATE(208)] = 6288, + [SMALL_STATE(209)] = 6301, + [SMALL_STATE(210)] = 6314, + [SMALL_STATE(211)] = 6327, + [SMALL_STATE(212)] = 6340, + [SMALL_STATE(213)] = 6353, + [SMALL_STATE(214)] = 6366, + [SMALL_STATE(215)] = 6379, + [SMALL_STATE(216)] = 6389, + [SMALL_STATE(217)] = 6399, + [SMALL_STATE(218)] = 6409, + [SMALL_STATE(219)] = 6419, + [SMALL_STATE(220)] = 6429, + [SMALL_STATE(221)] = 6437, + [SMALL_STATE(222)] = 6447, + [SMALL_STATE(223)] = 6457, + [SMALL_STATE(224)] = 6467, + [SMALL_STATE(225)] = 6477, + [SMALL_STATE(226)] = 6487, + [SMALL_STATE(227)] = 6497, + [SMALL_STATE(228)] = 6505, + [SMALL_STATE(229)] = 6515, + [SMALL_STATE(230)] = 6525, + [SMALL_STATE(231)] = 6533, + [SMALL_STATE(232)] = 6543, + [SMALL_STATE(233)] = 6553, + [SMALL_STATE(234)] = 6563, + [SMALL_STATE(235)] = 6571, + [SMALL_STATE(236)] = 6579, + [SMALL_STATE(237)] = 6589, + [SMALL_STATE(238)] = 6597, + [SMALL_STATE(239)] = 6607, + [SMALL_STATE(240)] = 6615, + [SMALL_STATE(241)] = 6623, + [SMALL_STATE(242)] = 6633, + [SMALL_STATE(243)] = 6641, + [SMALL_STATE(244)] = 6649, + [SMALL_STATE(245)] = 6656, + [SMALL_STATE(246)] = 6663, + [SMALL_STATE(247)] = 6670, + [SMALL_STATE(248)] = 6677, + [SMALL_STATE(249)] = 6684, + [SMALL_STATE(250)] = 6691, + [SMALL_STATE(251)] = 6698, + [SMALL_STATE(252)] = 6705, + [SMALL_STATE(253)] = 6712, + [SMALL_STATE(254)] = 6719, + [SMALL_STATE(255)] = 6726, + [SMALL_STATE(256)] = 6733, + [SMALL_STATE(257)] = 6740, + [SMALL_STATE(258)] = 6747, + [SMALL_STATE(259)] = 6754, + [SMALL_STATE(260)] = 6761, + [SMALL_STATE(261)] = 6768, + [SMALL_STATE(262)] = 6775, + [SMALL_STATE(263)] = 6782, + [SMALL_STATE(264)] = 6789, + [SMALL_STATE(265)] = 6796, + [SMALL_STATE(266)] = 6803, + [SMALL_STATE(267)] = 6810, + [SMALL_STATE(268)] = 6817, + [SMALL_STATE(269)] = 6824, + [SMALL_STATE(270)] = 6831, + [SMALL_STATE(271)] = 6838, + [SMALL_STATE(272)] = 6845, + [SMALL_STATE(273)] = 6852, + [SMALL_STATE(274)] = 6859, + [SMALL_STATE(275)] = 6866, + [SMALL_STATE(276)] = 6873, + [SMALL_STATE(277)] = 6880, + [SMALL_STATE(278)] = 6887, + [SMALL_STATE(279)] = 6894, + [SMALL_STATE(280)] = 6901, + [SMALL_STATE(281)] = 6908, + [SMALL_STATE(282)] = 6915, + [SMALL_STATE(283)] = 6922, }; static const TSParseActionEntry ts_parse_actions[] = { [0] = {.entry = {.count = 0, .reusable = false}}, [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), [3] = {.entry = {.count = 1, .reusable = true}}, SHIFT_EXTRA(), - [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(232), - [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(215), + [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(230), + [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(216), [9] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_path_expr, 1, 0, 0), - [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(264), + [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(258), [13] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_path_expr, 1, 0, 0), [15] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_path, 1, 0, 0), - [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(271), + [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(266), [19] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_path_expr, 2, 0, 0), [21] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_path_expr, 2, 0, 0), [23] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_path_expr_repeat1, 2, 0, 0), - [25] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_path_expr_repeat1, 2, 0, 0), SHIFT_REPEAT(271), + [25] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_path_expr_repeat1, 2, 0, 0), SHIFT_REPEAT(266), [28] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_path_expr_repeat1, 2, 0, 0), [30] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9), - [32] = {.entry = {.count = 1, .reusable = true}}, SHIFT(75), - [34] = {.entry = {.count = 1, .reusable = true}}, SHIFT(58), - [36] = {.entry = {.count = 1, .reusable = false}}, SHIFT(277), + [32] = {.entry = {.count = 1, .reusable = true}}, SHIFT(76), + [34] = {.entry = {.count = 1, .reusable = true}}, SHIFT(71), + [36] = {.entry = {.count = 1, .reusable = false}}, SHIFT(272), [38] = {.entry = {.count = 1, .reusable = false}}, SHIFT(40), - [40] = {.entry = {.count = 1, .reusable = false}}, SHIFT(66), - [42] = {.entry = {.count = 1, .reusable = false}}, SHIFT(46), - [44] = {.entry = {.count = 1, .reusable = false}}, SHIFT(48), - [46] = {.entry = {.count = 1, .reusable = true}}, SHIFT(55), + [40] = {.entry = {.count = 1, .reusable = false}}, SHIFT(48), + [42] = {.entry = {.count = 1, .reusable = false}}, SHIFT(50), + [44] = {.entry = {.count = 1, .reusable = false}}, SHIFT(58), + [46] = {.entry = {.count = 1, .reusable = true}}, SHIFT(59), [48] = {.entry = {.count = 1, .reusable = false}}, SHIFT(14), [50] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), - [52] = {.entry = {.count = 1, .reusable = true}}, SHIFT(125), + [52] = {.entry = {.count = 1, .reusable = true}}, SHIFT(123), [54] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_block_repeat1, 2, 0, 0), SHIFT_REPEAT(9), [57] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_block_repeat1, 2, 0, 0), - [59] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_block_repeat1, 2, 0, 0), SHIFT_REPEAT(58), - [62] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_block_repeat1, 2, 0, 0), SHIFT_REPEAT(277), + [59] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_block_repeat1, 2, 0, 0), SHIFT_REPEAT(71), + [62] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_block_repeat1, 2, 0, 0), SHIFT_REPEAT(272), [65] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_block_repeat1, 2, 0, 0), SHIFT_REPEAT(40), - [68] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_block_repeat1, 2, 0, 0), SHIFT_REPEAT(66), - [71] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_block_repeat1, 2, 0, 0), SHIFT_REPEAT(46), - [74] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_block_repeat1, 2, 0, 0), SHIFT_REPEAT(48), - [77] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_block_repeat1, 2, 0, 0), SHIFT_REPEAT(55), + [68] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_block_repeat1, 2, 0, 0), SHIFT_REPEAT(48), + [71] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_block_repeat1, 2, 0, 0), SHIFT_REPEAT(50), + [74] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_block_repeat1, 2, 0, 0), SHIFT_REPEAT(58), + [77] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_block_repeat1, 2, 0, 0), SHIFT_REPEAT(59), [80] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_block_repeat1, 2, 0, 0), SHIFT_REPEAT(14), [83] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_block_repeat1, 2, 0, 0), SHIFT_REPEAT(14), - [86] = {.entry = {.count = 1, .reusable = false}}, SHIFT(57), + [86] = {.entry = {.count = 1, .reusable = false}}, SHIFT(46), [88] = {.entry = {.count = 1, .reusable = true}}, SHIFT(124), - [90] = {.entry = {.count = 1, .reusable = true}}, SHIFT(78), + [90] = {.entry = {.count = 1, .reusable = true}}, SHIFT(81), [92] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_module_path_repeat1, 2, 0, 0), REDUCE(aux_sym_path_expr_repeat1, 2, 0, 0), [95] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_module_path_repeat1, 2, 0, 0), [97] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_unary_expr, 2, 0, 0), @@ -7969,19 +8058,19 @@ static const TSParseActionEntry ts_parse_actions[] = { [115] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_match_expr, 5, 0, 0), [117] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_struct_literal, 3, 0, 0), [119] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_literal, 3, 0, 0), - [121] = {.entry = {.count = 1, .reusable = true}}, SHIFT(47), - [123] = {.entry = {.count = 1, .reusable = true}}, SHIFT(45), - [125] = {.entry = {.count = 1, .reusable = false}}, SHIFT(54), - [127] = {.entry = {.count = 1, .reusable = true}}, SHIFT(54), - [129] = {.entry = {.count = 1, .reusable = false}}, SHIFT(47), - [131] = {.entry = {.count = 1, .reusable = true}}, SHIFT(53), + [121] = {.entry = {.count = 1, .reusable = true}}, SHIFT(49), + [123] = {.entry = {.count = 1, .reusable = true}}, SHIFT(51), + [125] = {.entry = {.count = 1, .reusable = false}}, SHIFT(56), + [127] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56), + [129] = {.entry = {.count = 1, .reusable = false}}, SHIFT(49), + [131] = {.entry = {.count = 1, .reusable = true}}, SHIFT(55), [133] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_try_expr, 2, 0, 10), [135] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_try_expr, 2, 0, 10), [137] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_call_expr, 2, 0, 11), [139] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_call_expr, 2, 0, 11), [141] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_arg_list, 2, 0, 0), [143] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_arg_list, 2, 0, 0), - [145] = {.entry = {.count = 1, .reusable = true}}, SHIFT(49), + [145] = {.entry = {.count = 1, .reusable = true}}, SHIFT(54), [147] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_match_expr, 4, 0, 0), [149] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_match_expr, 4, 0, 0), [151] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_struct_literal, 4, 0, 0), @@ -8001,287 +8090,287 @@ static const TSParseActionEntry ts_parse_actions[] = { [179] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_grouping, 3, 0, 0), [181] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_grouping, 3, 0, 0), [183] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assign_stmt, 3, 0, 0), - [185] = {.entry = {.count = 1, .reusable = true}}, SHIFT(108), + [185] = {.entry = {.count = 1, .reusable = true}}, SHIFT(99), [187] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assign_stmt, 3, 0, 0), - [189] = {.entry = {.count = 1, .reusable = true}}, SHIFT(50), + [189] = {.entry = {.count = 1, .reusable = true}}, SHIFT(52), [191] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_let_stmt, 4, 0, 0), - [193] = {.entry = {.count = 1, .reusable = true}}, SHIFT(100), + [193] = {.entry = {.count = 1, .reusable = true}}, SHIFT(102), [195] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_let_stmt, 4, 0, 0), [197] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_return_stmt, 2, 0, 0), - [199] = {.entry = {.count = 1, .reusable = true}}, SHIFT(96), + [199] = {.entry = {.count = 1, .reusable = true}}, SHIFT(94), [201] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_return_stmt, 2, 0, 0), [203] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expr_stmt, 1, 0, 0), - [205] = {.entry = {.count = 1, .reusable = true}}, SHIFT(95), + [205] = {.entry = {.count = 1, .reusable = true}}, SHIFT(104), [207] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expr_stmt, 1, 0, 0), [209] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_let_stmt, 6, 0, 0), - [211] = {.entry = {.count = 1, .reusable = true}}, SHIFT(105), + [211] = {.entry = {.count = 1, .reusable = true}}, SHIFT(106), [213] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_let_stmt, 6, 0, 0), [215] = {.entry = {.count = 2, .reusable = false}}, REDUCE(sym_return_stmt, 1, 0, 0), SHIFT(2), - [218] = {.entry = {.count = 1, .reusable = true}}, SHIFT(98), + [218] = {.entry = {.count = 1, .reusable = true}}, SHIFT(100), [220] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_return_stmt, 1, 0, 0), - [222] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_return_stmt, 1, 0, 0), SHIFT(58), + [222] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_return_stmt, 1, 0, 0), SHIFT(71), [225] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_return_stmt, 1, 0, 0), - [227] = {.entry = {.count = 2, .reusable = false}}, REDUCE(sym_return_stmt, 1, 0, 0), SHIFT(48), - [230] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_return_stmt, 1, 0, 0), SHIFT(55), + [227] = {.entry = {.count = 2, .reusable = false}}, REDUCE(sym_return_stmt, 1, 0, 0), SHIFT(58), + [230] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_return_stmt, 1, 0, 0), SHIFT(59), [233] = {.entry = {.count = 2, .reusable = false}}, REDUCE(sym_return_stmt, 1, 0, 0), SHIFT(14), [236] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_return_stmt, 1, 0, 0), SHIFT(14), [239] = {.entry = {.count = 1, .reusable = false}}, SHIFT(2), [241] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), [243] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33), [245] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30), - [247] = {.entry = {.count = 1, .reusable = false}}, SHIFT(76), - [249] = {.entry = {.count = 1, .reusable = true}}, SHIFT(65), + [247] = {.entry = {.count = 1, .reusable = false}}, SHIFT(82), + [249] = {.entry = {.count = 1, .reusable = true}}, SHIFT(70), [251] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1, 0, 0), - [253] = {.entry = {.count = 1, .reusable = true}}, SHIFT(240), - [255] = {.entry = {.count = 1, .reusable = true}}, SHIFT(149), - [257] = {.entry = {.count = 1, .reusable = true}}, SHIFT(265), - [259] = {.entry = {.count = 1, .reusable = true}}, SHIFT(247), - [261] = {.entry = {.count = 1, .reusable = true}}, SHIFT(153), - [263] = {.entry = {.count = 1, .reusable = true}}, SHIFT(275), - [265] = {.entry = {.count = 1, .reusable = true}}, SHIFT(262), - [267] = {.entry = {.count = 1, .reusable = true}}, SHIFT(158), - [269] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 3, 0, 0), - [271] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 2, 0, 0), - [273] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_module_path_repeat1, 2, 0, 0), SHIFT_REPEAT(276), - [276] = {.entry = {.count = 1, .reusable = true}}, SHIFT(276), + [253] = {.entry = {.count = 1, .reusable = true}}, SHIFT(232), + [255] = {.entry = {.count = 1, .reusable = true}}, SHIFT(148), + [257] = {.entry = {.count = 1, .reusable = true}}, SHIFT(273), + [259] = {.entry = {.count = 1, .reusable = true}}, SHIFT(265), + [261] = {.entry = {.count = 1, .reusable = true}}, SHIFT(151), + [263] = {.entry = {.count = 1, .reusable = true}}, SHIFT(280), + [265] = {.entry = {.count = 1, .reusable = true}}, SHIFT(254), + [267] = {.entry = {.count = 1, .reusable = true}}, SHIFT(165), + [269] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 2, 0, 0), + [271] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 3, 0, 0), + [273] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_module_path_repeat1, 2, 0, 0), SHIFT_REPEAT(252), + [276] = {.entry = {.count = 1, .reusable = true}}, SHIFT(252), [278] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_path, 2, 0, 0), - [280] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block, 3, 0, 0), - [282] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block, 3, 0, 0), - [284] = {.entry = {.count = 1, .reusable = true}}, SHIFT(282), - [286] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_type_path, 1, 0, 0), REDUCE(sym_path_expr, 1, 0, 0), - [289] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type, 1, 0, 0), - [291] = {.entry = {.count = 1, .reusable = true}}, SHIFT(156), - [293] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block, 2, 0, 0), - [295] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block, 2, 0, 0), - [297] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat2, 2, 0, 0), - [299] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat2, 2, 0, 0), SHIFT_REPEAT(149), - [302] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat2, 2, 0, 0), SHIFT_REPEAT(265), - [305] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat2, 2, 0, 0), SHIFT_REPEAT(247), - [308] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat2, 2, 0, 0), SHIFT_REPEAT(153), - [311] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat2, 2, 0, 0), SHIFT_REPEAT(275), - [314] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat2, 2, 0, 0), SHIFT_REPEAT(262), - [317] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat2, 2, 0, 0), SHIFT_REPEAT(158), - [320] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 4, 0, 0), - [322] = {.entry = {.count = 1, .reusable = true}}, SHIFT(43), - [324] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29), - [326] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_arg_list_repeat1, 2, 0, 0), - [328] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_args, 5, 0, 0), - [330] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), - [332] = {.entry = {.count = 1, .reusable = true}}, SHIFT(62), - [334] = {.entry = {.count = 1, .reusable = true}}, SHIFT(63), - [336] = {.entry = {.count = 1, .reusable = true}}, SHIFT(60), - [338] = {.entry = {.count = 1, .reusable = true}}, SHIFT(64), - [340] = {.entry = {.count = 1, .reusable = true}}, SHIFT(59), - [342] = {.entry = {.count = 1, .reusable = false}}, SHIFT(44), + [280] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type, 1, 0, 0), + [282] = {.entry = {.count = 1, .reusable = true}}, SHIFT(155), + [284] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block, 3, 0, 0), + [286] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block, 3, 0, 0), + [288] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 4, 0, 0), + [290] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat2, 2, 0, 0), + [292] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat2, 2, 0, 0), SHIFT_REPEAT(148), + [295] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat2, 2, 0, 0), SHIFT_REPEAT(273), + [298] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat2, 2, 0, 0), SHIFT_REPEAT(265), + [301] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat2, 2, 0, 0), SHIFT_REPEAT(151), + [304] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat2, 2, 0, 0), SHIFT_REPEAT(280), + [307] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat2, 2, 0, 0), SHIFT_REPEAT(254), + [310] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat2, 2, 0, 0), SHIFT_REPEAT(165), + [313] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block, 2, 0, 0), + [315] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block, 2, 0, 0), + [317] = {.entry = {.count = 1, .reusable = true}}, SHIFT(282), + [319] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_type_path, 1, 0, 0), REDUCE(sym_path_expr, 1, 0, 0), + [322] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type, 2, 0, 0), + [324] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_args, 5, 0, 0), + [326] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_args, 3, 0, 0), + [328] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_args, 4, 0, 0), + [330] = {.entry = {.count = 1, .reusable = true}}, SHIFT(43), + [332] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29), + [334] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [336] = {.entry = {.count = 1, .reusable = true}}, SHIFT(66), + [338] = {.entry = {.count = 1, .reusable = true}}, SHIFT(63), + [340] = {.entry = {.count = 1, .reusable = true}}, SHIFT(67), + [342] = {.entry = {.count = 1, .reusable = true}}, SHIFT(62), [344] = {.entry = {.count = 1, .reusable = true}}, SHIFT(44), - [346] = {.entry = {.count = 1, .reusable = false}}, SHIFT(62), - [348] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_args, 4, 0, 0), - [350] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if_stmt, 3, 0, 0), - [352] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_stmt, 3, 0, 0), - [354] = {.entry = {.count = 1, .reusable = false}}, SHIFT(174), - [356] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_args, 3, 0, 0), - [358] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type, 2, 0, 0), - [360] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_field, 3, 0, 0), - [362] = {.entry = {.count = 1, .reusable = true}}, SHIFT(110), - [364] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expr_stmt, 2, 0, 0), - [366] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expr_stmt, 2, 0, 0), - [368] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_return_stmt, 3, 0, 0), - [370] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_return_stmt, 3, 0, 0), - [372] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_while_stmt, 3, 0, 0), - [374] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_while_stmt, 3, 0, 0), + [346] = {.entry = {.count = 1, .reusable = false}}, SHIFT(64), + [348] = {.entry = {.count = 1, .reusable = true}}, SHIFT(64), + [350] = {.entry = {.count = 1, .reusable = false}}, SHIFT(66), + [352] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if_stmt, 3, 0, 0), + [354] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_stmt, 3, 0, 0), + [356] = {.entry = {.count = 1, .reusable = false}}, SHIFT(172), + [358] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_field, 3, 0, 0), + [360] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_arg_list_repeat1, 2, 0, 0), + [362] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_return_stmt, 3, 0, 0), + [364] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_return_stmt, 3, 0, 0), + [366] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), + [368] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_while_stmt, 3, 0, 0), + [370] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_while_stmt, 3, 0, 0), + [372] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assign_stmt, 4, 0, 0), + [374] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assign_stmt, 4, 0, 0), [376] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_statement, 1, 0, 0), [378] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_statement, 1, 0, 0), [380] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_let_stmt, 5, 0, 0), [382] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_let_stmt, 5, 0, 0), [384] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if_stmt, 5, 0, 0), [386] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_stmt, 5, 0, 0), - [388] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_let_stmt, 7, 0, 0), - [390] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_let_stmt, 7, 0, 0), - [392] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), - [394] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assign_stmt, 4, 0, 0), - [396] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assign_stmt, 4, 0, 0), - [398] = {.entry = {.count = 1, .reusable = false}}, SHIFT(167), - [400] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), - [402] = {.entry = {.count = 1, .reusable = false}}, SHIFT(279), - [404] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_match_expr_repeat1, 2, 0, 0), SHIFT_REPEAT(167), - [407] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_match_expr_repeat1, 2, 0, 0), - [409] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_match_expr_repeat1, 2, 0, 0), SHIFT_REPEAT(279), - [412] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_match_expr_repeat1, 2, 0, 0), SHIFT_REPEAT(14), - [415] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_match_expr_repeat1, 2, 0, 0), SHIFT_REPEAT(14), - [418] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), - [420] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_path, 1, 0, 0), - [422] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param_list, 4, 0, 0), - [424] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param_list, 3, 0, 0), - [426] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param_list, 2, 0, 0), - [428] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_path, 2, 0, 0), - [430] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param_list, 5, 0, 0), - [432] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), - [434] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(240), - [437] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_extern_function_decl, 5, 0, 7), - [439] = {.entry = {.count = 1, .reusable = true}}, SHIFT(159), - [441] = {.entry = {.count = 1, .reusable = true}}, SHIFT(133), - [443] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_extern_function_decl, 4, 0, 3), - [445] = {.entry = {.count = 1, .reusable = true}}, SHIFT(163), - [447] = {.entry = {.count = 1, .reusable = true}}, SHIFT(142), - [449] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_extern_function_decl, 6, 0, 12), - [451] = {.entry = {.count = 1, .reusable = true}}, SHIFT(130), - [453] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_extern_function_decl, 7, 0, 14), - [455] = {.entry = {.count = 1, .reusable = true}}, SHIFT(136), - [457] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_decl, 2, 0, 0), - [459] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_use_decl, 2, 0, 0), - [461] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_decl, 4, 0, 2), - [463] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_impl_block, 5, 0, 5), - [465] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_extern_function_decl, 7, 0, 12), - [467] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_decl, 5, 0, 3), - [469] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_decl, 5, 0, 3), - [471] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_extern_function_decl, 6, 0, 7), - [473] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_decl, 6, 0, 3), - [475] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_decl, 6, 0, 9), + [388] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expr_stmt, 2, 0, 0), + [390] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expr_stmt, 2, 0, 0), + [392] = {.entry = {.count = 1, .reusable = true}}, SHIFT(111), + [394] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_let_stmt, 7, 0, 0), + [396] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_let_stmt, 7, 0, 0), + [398] = {.entry = {.count = 1, .reusable = false}}, SHIFT(166), + [400] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), + [402] = {.entry = {.count = 1, .reusable = false}}, SHIFT(277), + [404] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), + [406] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_match_expr_repeat1, 2, 0, 0), SHIFT_REPEAT(166), + [409] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_match_expr_repeat1, 2, 0, 0), + [411] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_match_expr_repeat1, 2, 0, 0), SHIFT_REPEAT(277), + [414] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_match_expr_repeat1, 2, 0, 0), SHIFT_REPEAT(14), + [417] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_match_expr_repeat1, 2, 0, 0), SHIFT_REPEAT(14), + [420] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), + [422] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(232), + [425] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_path, 1, 0, 0), + [427] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param_list, 5, 0, 0), + [429] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param_list, 3, 0, 0), + [431] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param_list, 2, 0, 0), + [433] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_path, 2, 0, 0), + [435] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param_list, 4, 0, 0), + [437] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_extern_function_decl, 4, 0, 3), + [439] = {.entry = {.count = 1, .reusable = true}}, SHIFT(164), + [441] = {.entry = {.count = 1, .reusable = true}}, SHIFT(129), + [443] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_extern_function_decl, 5, 0, 7), + [445] = {.entry = {.count = 1, .reusable = true}}, SHIFT(168), + [447] = {.entry = {.count = 1, .reusable = true}}, SHIFT(139), + [449] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_use_decl, 2, 0, 0), + [451] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_extern_function_decl, 7, 0, 14), + [453] = {.entry = {.count = 1, .reusable = true}}, SHIFT(136), + [455] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_extern_function_decl, 6, 0, 12), + [457] = {.entry = {.count = 1, .reusable = true}}, SHIFT(135), + [459] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module_decl, 2, 0, 0), + [461] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_decl, 4, 0, 4), + [463] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_extern_function_decl, 5, 0, 3), + [465] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_impl_block, 5, 0, 5), + [467] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_decl, 6, 0, 3), + [469] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_decl, 7, 0, 13), + [471] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_decl, 5, 0, 4), + [473] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_decl, 5, 0, 4), + [475] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_extern_function_decl, 7, 0, 12), [477] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_extern_function_decl, 8, 0, 14), - [479] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_match_expr_repeat1, 1, 0, 0), - [481] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_match_expr_repeat1, 1, 0, 0), - [483] = {.entry = {.count = 1, .reusable = true}}, SHIFT(148), - [485] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_decl, 5, 0, 6), - [487] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_decl, 6, 0, 3), - [489] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_decl, 4, 0, 4), - [491] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_match_arm, 3, 0, 0), - [493] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_match_arm, 3, 0, 0), - [495] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_extern_function_decl, 5, 0, 3), - [497] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_decl, 5, 0, 4), - [499] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_impl_block, 4, 0, 5), - [501] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_decl, 4, 0, 4), - [503] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_decl, 7, 0, 13), - [505] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_decl, 5, 0, 4), - [507] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_match_expr_repeat1, 2, 0, 0), - [509] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_struct_decl_repeat1, 1, 0, 0), - [511] = {.entry = {.count = 1, .reusable = true}}, SHIFT(274), - [513] = {.entry = {.count = 1, .reusable = true}}, SHIFT(281), - [515] = {.entry = {.count = 1, .reusable = true}}, SHIFT(260), + [479] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_decl, 5, 0, 3), + [481] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_decl, 5, 0, 3), + [483] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_extern_function_decl, 6, 0, 7), + [485] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_decl, 6, 0, 3), + [487] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_decl, 4, 0, 2), + [489] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_decl, 6, 0, 9), + [491] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_decl, 5, 0, 6), + [493] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_impl_block, 4, 0, 5), + [495] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_decl, 4, 0, 4), + [497] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_match_expr_repeat1, 1, 0, 0), + [499] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_match_expr_repeat1, 1, 0, 0), + [501] = {.entry = {.count = 1, .reusable = true}}, SHIFT(149), + [503] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_match_arm, 3, 0, 0), + [505] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_match_arm, 3, 0, 0), + [507] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_struct_decl_repeat1, 1, 0, 0), + [509] = {.entry = {.count = 1, .reusable = true}}, SHIFT(259), + [511] = {.entry = {.count = 1, .reusable = true}}, SHIFT(270), + [513] = {.entry = {.count = 1, .reusable = true}}, SHIFT(275), + [515] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_match_expr_repeat1, 2, 0, 0), [517] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_struct_decl_repeat1, 2, 0, 0), SHIFT_REPEAT(150), [520] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_struct_decl_repeat1, 2, 0, 0), - [522] = {.entry = {.count = 1, .reusable = true}}, SHIFT(72), - [524] = {.entry = {.count = 1, .reusable = true}}, SHIFT(164), - [526] = {.entry = {.count = 1, .reusable = true}}, SHIFT(88), - [528] = {.entry = {.count = 1, .reusable = true}}, SHIFT(85), - [530] = {.entry = {.count = 1, .reusable = true}}, SHIFT(150), - [532] = {.entry = {.count = 1, .reusable = true}}, SHIFT(246), - [534] = {.entry = {.count = 1, .reusable = true}}, SHIFT(257), - [536] = {.entry = {.count = 1, .reusable = true}}, SHIFT(266), - [538] = {.entry = {.count = 1, .reusable = true}}, SHIFT(129), - [540] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_impl_block_repeat1, 2, 0, 0), SHIFT_REPEAT(257), - [543] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_impl_block_repeat1, 2, 0, 0), SHIFT_REPEAT(266), + [522] = {.entry = {.count = 1, .reusable = true}}, SHIFT(150), + [524] = {.entry = {.count = 1, .reusable = true}}, SHIFT(267), + [526] = {.entry = {.count = 1, .reusable = true}}, SHIFT(72), + [528] = {.entry = {.count = 1, .reusable = true}}, SHIFT(170), + [530] = {.entry = {.count = 1, .reusable = true}}, SHIFT(84), + [532] = {.entry = {.count = 1, .reusable = true}}, SHIFT(86), + [534] = {.entry = {.count = 1, .reusable = true}}, SHIFT(281), + [536] = {.entry = {.count = 1, .reusable = true}}, SHIFT(251), + [538] = {.entry = {.count = 1, .reusable = true}}, SHIFT(130), + [540] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_impl_block_repeat1, 2, 0, 0), SHIFT_REPEAT(281), + [543] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_impl_block_repeat1, 2, 0, 0), SHIFT_REPEAT(251), [546] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_impl_block_repeat1, 2, 0, 0), [548] = {.entry = {.count = 1, .reusable = true}}, SHIFT(144), - [550] = {.entry = {.count = 1, .reusable = true}}, SHIFT(212), - [552] = {.entry = {.count = 1, .reusable = true}}, SHIFT(131), - [554] = {.entry = {.count = 1, .reusable = false}}, SHIFT(253), - [556] = {.entry = {.count = 1, .reusable = true}}, SHIFT(118), - [558] = {.entry = {.count = 1, .reusable = false}}, SHIFT(224), - [560] = {.entry = {.count = 1, .reusable = true}}, SHIFT(66), - [562] = {.entry = {.count = 1, .reusable = true}}, SHIFT(140), - [564] = {.entry = {.count = 1, .reusable = true}}, SHIFT(116), - [566] = {.entry = {.count = 1, .reusable = true}}, SHIFT(269), - [568] = {.entry = {.count = 1, .reusable = true}}, SHIFT(145), - [570] = {.entry = {.count = 1, .reusable = true}}, SHIFT(132), - [572] = {.entry = {.count = 1, .reusable = true}}, SHIFT(114), - [574] = {.entry = {.count = 1, .reusable = true}}, SHIFT(179), - [576] = {.entry = {.count = 1, .reusable = true}}, SHIFT(115), - [578] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_param_list_repeat1, 2, 0, 0), SHIFT_REPEAT(211), - [581] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_param_list_repeat1, 2, 0, 0), - [583] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field_list, 2, 0, 0), - [585] = {.entry = {.count = 1, .reusable = true}}, SHIFT(201), - [587] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), - [589] = {.entry = {.count = 1, .reusable = true}}, SHIFT(192), - [591] = {.entry = {.count = 1, .reusable = true}}, SHIFT(166), - [593] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), - [595] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_variants, 2, 0, 0), - [597] = {.entry = {.count = 1, .reusable = true}}, SHIFT(206), - [599] = {.entry = {.count = 1, .reusable = true}}, SHIFT(157), - [601] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_method_decl, 4, 0, 2), - [603] = {.entry = {.count = 1, .reusable = true}}, SHIFT(278), - [605] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), - [607] = {.entry = {.count = 1, .reusable = true}}, SHIFT(173), - [609] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), - [611] = {.entry = {.count = 1, .reusable = true}}, SHIFT(199), - [613] = {.entry = {.count = 1, .reusable = true}}, SHIFT(42), - [615] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_method_decl, 5, 0, 6), - [617] = {.entry = {.count = 1, .reusable = true}}, SHIFT(151), - [619] = {.entry = {.count = 1, .reusable = true}}, SHIFT(90), - [621] = {.entry = {.count = 1, .reusable = false}}, SHIFT(256), - [623] = {.entry = {.count = 1, .reusable = true}}, SHIFT(255), - [625] = {.entry = {.count = 1, .reusable = true}}, SHIFT(152), - [627] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28), - [629] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_struct_literal_repeat1, 2, 0, 0), - [631] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_struct_literal_repeat1, 2, 0, 0), SHIFT_REPEAT(228), - [634] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field_list, 3, 0, 0), - [636] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_field_list_repeat1, 2, 0, 0), - [638] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_field_list_repeat1, 2, 0, 0), SHIFT_REPEAT(227), - [641] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_arg_list_repeat1, 2, 0, 0), SHIFT_REPEAT(61), - [644] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_method_decl, 6, 0, 9), - [646] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_method_decl, 7, 0, 13), - [648] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_variants, 3, 0, 0), - [650] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_enum_variants_repeat1, 2, 0, 0), - [652] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_enum_variants_repeat1, 2, 0, 0), SHIFT_REPEAT(233), - [655] = {.entry = {.count = 1, .reusable = true}}, SHIFT(160), - [657] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field_list, 1, 0, 0), - [659] = {.entry = {.count = 1, .reusable = true}}, SHIFT(182), - [661] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_type_args_repeat1, 2, 0, 0), SHIFT_REPEAT(165), - [664] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_type_args_repeat1, 2, 0, 0), - [666] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_variant, 1, 0, 0), - [668] = {.entry = {.count = 1, .reusable = true}}, SHIFT(154), + [550] = {.entry = {.count = 1, .reusable = true}}, SHIFT(48), + [552] = {.entry = {.count = 1, .reusable = true}}, SHIFT(268), + [554] = {.entry = {.count = 1, .reusable = true}}, SHIFT(137), + [556] = {.entry = {.count = 1, .reusable = false}}, SHIFT(249), + [558] = {.entry = {.count = 1, .reusable = true}}, SHIFT(117), + [560] = {.entry = {.count = 1, .reusable = false}}, SHIFT(243), + [562] = {.entry = {.count = 1, .reusable = true}}, SHIFT(119), + [564] = {.entry = {.count = 1, .reusable = true}}, SHIFT(128), + [566] = {.entry = {.count = 1, .reusable = true}}, SHIFT(206), + [568] = {.entry = {.count = 1, .reusable = true}}, SHIFT(138), + [570] = {.entry = {.count = 1, .reusable = true}}, SHIFT(115), + [572] = {.entry = {.count = 1, .reusable = true}}, SHIFT(145), + [574] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_arg_list_repeat1, 2, 0, 0), SHIFT_REPEAT(65), + [577] = {.entry = {.count = 1, .reusable = true}}, SHIFT(161), + [579] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), + [581] = {.entry = {.count = 1, .reusable = true}}, SHIFT(250), + [583] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), + [585] = {.entry = {.count = 1, .reusable = true}}, SHIFT(189), + [587] = {.entry = {.count = 1, .reusable = false}}, SHIFT(256), + [589] = {.entry = {.count = 1, .reusable = true}}, SHIFT(255), + [591] = {.entry = {.count = 1, .reusable = true}}, SHIFT(163), + [593] = {.entry = {.count = 1, .reusable = true}}, SHIFT(42), + [595] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_param_list_repeat1, 2, 0, 0), SHIFT_REPEAT(188), + [598] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_param_list_repeat1, 2, 0, 0), + [600] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28), + [602] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_struct_literal_repeat1, 2, 0, 0), + [604] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_struct_literal_repeat1, 2, 0, 0), SHIFT_REPEAT(231), + [607] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_method_decl, 5, 0, 6), + [609] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field_list, 2, 0, 0), + [611] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_method_decl, 6, 0, 9), + [613] = {.entry = {.count = 1, .reusable = true}}, SHIFT(175), + [615] = {.entry = {.count = 1, .reusable = true}}, SHIFT(116), + [617] = {.entry = {.count = 1, .reusable = true}}, SHIFT(197), + [619] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), + [621] = {.entry = {.count = 1, .reusable = true}}, SHIFT(182), + [623] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field_list, 3, 0, 0), + [625] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_method_decl, 7, 0, 13), + [627] = {.entry = {.count = 1, .reusable = true}}, SHIFT(178), + [629] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_method_decl, 4, 0, 2), + [631] = {.entry = {.count = 1, .reusable = true}}, SHIFT(152), + [633] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_field_list_repeat1, 2, 0, 0), + [635] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_field_list_repeat1, 2, 0, 0), SHIFT_REPEAT(236), + [638] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_type_args_repeat1, 2, 0, 0), SHIFT_REPEAT(159), + [641] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_type_args_repeat1, 2, 0, 0), + [643] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field_list, 1, 0, 0), + [645] = {.entry = {.count = 1, .reusable = true}}, SHIFT(192), + [647] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_variants, 2, 0, 0), + [649] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_variant, 1, 0, 0), + [651] = {.entry = {.count = 1, .reusable = true}}, SHIFT(160), + [653] = {.entry = {.count = 1, .reusable = true}}, SHIFT(210), + [655] = {.entry = {.count = 1, .reusable = true}}, SHIFT(153), + [657] = {.entry = {.count = 1, .reusable = true}}, SHIFT(85), + [659] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), + [661] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_variants, 3, 0, 0), + [663] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_enum_variants_repeat1, 2, 0, 0), + [665] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_enum_variants_repeat1, 2, 0, 0), SHIFT_REPEAT(238), + [668] = {.entry = {.count = 1, .reusable = true}}, SHIFT(158), [670] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_variants, 1, 0, 0), - [672] = {.entry = {.count = 1, .reusable = true}}, SHIFT(186), - [674] = {.entry = {.count = 1, .reusable = true}}, SHIFT(170), - [676] = {.entry = {.count = 1, .reusable = true}}, SHIFT(113), - [678] = {.entry = {.count = 1, .reusable = true}}, SHIFT(176), - [680] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field, 3, 0, 0), - [682] = {.entry = {.count = 1, .reusable = true}}, SHIFT(197), - [684] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pattern, 1, 0, 0), - [686] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param, 1, 0, 1), - [688] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param, 3, 0, 8), - [690] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_variant, 4, 0, 0), - [692] = {.entry = {.count = 1, .reusable = true}}, SHIFT(251), - [694] = {.entry = {.count = 1, .reusable = true}}, SHIFT(155), - [696] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56), - [698] = {.entry = {.count = 1, .reusable = true}}, SHIFT(171), - [700] = {.entry = {.count = 1, .reusable = true}}, SHIFT(241), - [702] = {.entry = {.count = 1, .reusable = true}}, SHIFT(259), - [704] = {.entry = {.count = 1, .reusable = true}}, SHIFT(248), - [706] = {.entry = {.count = 1, .reusable = true}}, SHIFT(220), - [708] = {.entry = {.count = 1, .reusable = true}}, SHIFT(177), - [710] = {.entry = {.count = 1, .reusable = true}}, SHIFT(175), - [712] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_package_decl, 2, 0, 0), - [714] = {.entry = {.count = 1, .reusable = true}}, SHIFT(243), - [716] = {.entry = {.count = 1, .reusable = true}}, SHIFT(162), - [718] = {.entry = {.count = 1, .reusable = true}}, SHIFT(231), + [672] = {.entry = {.count = 1, .reusable = true}}, SHIFT(205), + [674] = {.entry = {.count = 1, .reusable = true}}, SHIFT(156), + [676] = {.entry = {.count = 1, .reusable = true}}, SHIFT(114), + [678] = {.entry = {.count = 1, .reusable = true}}, SHIFT(174), + [680] = {.entry = {.count = 1, .reusable = true}}, SHIFT(184), + [682] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pattern, 1, 0, 0), + [684] = {.entry = {.count = 1, .reusable = true}}, SHIFT(157), + [686] = {.entry = {.count = 1, .reusable = true}}, SHIFT(61), + [688] = {.entry = {.count = 1, .reusable = true}}, SHIFT(261), + [690] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param, 3, 0, 8), + [692] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_variant, 4, 0, 0), + [694] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_field, 3, 0, 0), + [696] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param, 1, 0, 1), + [698] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pattern_call, 4, 0, 0), + [700] = {.entry = {.count = 1, .reusable = true}}, SHIFT(176), + [702] = {.entry = {.count = 1, .reusable = true}}, SHIFT(179), + [704] = {.entry = {.count = 1, .reusable = true}}, SHIFT(173), + [706] = {.entry = {.count = 1, .reusable = true}}, SHIFT(131), + [708] = {.entry = {.count = 1, .reusable = true}}, SHIFT(169), + [710] = {.entry = {.count = 1, .reusable = true}}, SHIFT(53), + [712] = {.entry = {.count = 1, .reusable = true}}, SHIFT(241), + [714] = {.entry = {.count = 1, .reusable = true}}, SHIFT(74), + [716] = {.entry = {.count = 1, .reusable = true}}, SHIFT(224), + [718] = {.entry = {.count = 1, .reusable = true}}, SHIFT(246), [720] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pattern_call, 3, 0, 0), - [722] = {.entry = {.count = 1, .reusable = true}}, SHIFT(263), - [724] = {.entry = {.count = 1, .reusable = true}}, SHIFT(261), - [726] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), - [728] = {.entry = {.count = 1, .reusable = true}}, SHIFT(178), - [730] = {.entry = {.count = 1, .reusable = true}}, SHIFT(283), - [732] = {.entry = {.count = 1, .reusable = true}}, SHIFT(234), - [734] = {.entry = {.count = 1, .reusable = true}}, SHIFT(250), - [736] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pattern_call, 4, 0, 0), - [738] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), - [740] = {.entry = {.count = 1, .reusable = true}}, SHIFT(223), - [742] = {.entry = {.count = 1, .reusable = true}}, SHIFT(216), - [744] = {.entry = {.count = 1, .reusable = true}}, SHIFT(134), - [746] = {.entry = {.count = 1, .reusable = true}}, SHIFT(190), - [748] = {.entry = {.count = 1, .reusable = true}}, SHIFT(168), - [750] = {.entry = {.count = 1, .reusable = true}}, SHIFT(143), - [752] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), - [754] = {.entry = {.count = 1, .reusable = true}}, SHIFT(139), - [756] = {.entry = {.count = 1, .reusable = true}}, SHIFT(51), - [758] = {.entry = {.count = 1, .reusable = true}}, SHIFT(225), - [760] = {.entry = {.count = 1, .reusable = true}}, SHIFT(249), - [762] = {.entry = {.count = 1, .reusable = true}}, SHIFT(74), - [764] = {.entry = {.count = 1, .reusable = true}}, SHIFT(242), - [766] = {.entry = {.count = 1, .reusable = true}}, SHIFT(52), - [768] = {.entry = {.count = 1, .reusable = true}}, SHIFT(147), - [770] = {.entry = {.count = 1, .reusable = true}}, SHIFT(252), - [772] = {.entry = {.count = 1, .reusable = true}}, SHIFT(93), - [774] = {.entry = {.count = 1, .reusable = true}}, SHIFT(172), + [722] = {.entry = {.count = 1, .reusable = true}}, SHIFT(244), + [724] = {.entry = {.count = 1, .reusable = true}}, SHIFT(177), + [726] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), + [728] = {.entry = {.count = 1, .reusable = true}}, SHIFT(229), + [730] = {.entry = {.count = 1, .reusable = true}}, SHIFT(209), + [732] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_package_decl, 2, 0, 0), + [734] = {.entry = {.count = 1, .reusable = true}}, SHIFT(225), + [736] = {.entry = {.count = 1, .reusable = true}}, SHIFT(233), + [738] = {.entry = {.count = 1, .reusable = true}}, SHIFT(140), + [740] = {.entry = {.count = 1, .reusable = true}}, SHIFT(263), + [742] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), + [744] = {.entry = {.count = 1, .reusable = true}}, SHIFT(247), + [746] = {.entry = {.count = 1, .reusable = true}}, SHIFT(167), + [748] = {.entry = {.count = 1, .reusable = true}}, SHIFT(133), + [750] = {.entry = {.count = 1, .reusable = true}}, SHIFT(253), + [752] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [754] = {.entry = {.count = 1, .reusable = true}}, SHIFT(219), + [756] = {.entry = {.count = 1, .reusable = true}}, SHIFT(226), + [758] = {.entry = {.count = 1, .reusable = true}}, SHIFT(217), + [760] = {.entry = {.count = 1, .reusable = true}}, SHIFT(257), + [762] = {.entry = {.count = 1, .reusable = true}}, SHIFT(237), + [764] = {.entry = {.count = 1, .reusable = true}}, SHIFT(57), + [766] = {.entry = {.count = 1, .reusable = true}}, SHIFT(134), + [768] = {.entry = {.count = 1, .reusable = true}}, SHIFT(245), + [770] = {.entry = {.count = 1, .reusable = true}}, SHIFT(274), + [772] = {.entry = {.count = 1, .reusable = true}}, SHIFT(91), + [774] = {.entry = {.count = 1, .reusable = true}}, SHIFT(171), }; #ifdef __cplusplus diff --git a/vscode/syntaxes/capable.tmLanguage.json b/vscode/syntaxes/capable.tmLanguage.json index d24023d..27d4451 100644 --- a/vscode/syntaxes/capable.tmLanguage.json +++ b/vscode/syntaxes/capable.tmLanguage.json @@ -45,7 +45,7 @@ "patterns": [ { "name": "keyword.control.cap", - "match": "\\b(module|package|safe|unsafe|use|pub|extern|fn|let|if|else|while|return|struct|enum|impl|opaque|linear|copy|match|true|false)\\b" + "match": "\\b(module|package|safe|unsafe|use|pub|extern|fn|let|if|else|while|return|struct|enum|impl|opaque|linear|copy|capability|match|true|false)\\b" }, { "name": "constant.language.cap", From 5067929a0eedbf6a8c5c4602b629e0cfb5fd9da4 Mon Sep 17 00:00:00 2001 From: Jordan Mecom Date: Sun, 28 Dec 2025 16:07:04 -0800 Subject: [PATCH 2/5] Document capability kinds and add helper borrow test --- TUTORIAL.md | 6 ++++++ capc/tests/typecheck.rs | 11 +++++++++++ docs/caps.md | 13 ++++++++++++- ...ld_fail_capability_borrow_return_helper.cap | 18 ++++++++++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 tests/programs/should_fail_capability_borrow_return_helper.cap diff --git a/TUTORIAL.md b/TUTORIAL.md index aeeb59c..899ffd9 100644 --- a/TUTORIAL.md +++ b/TUTORIAL.md @@ -168,6 +168,12 @@ Kinds: Use `capability struct` for authority-bearing tokens. Use `opaque struct` for unforgeable data types that aren’t capabilities. +In the current stdlib: + +- `copy capability`: `RootCap`, `Console`, `Alloc`, `Buffer`, `Slice`, `MutSlice`, `Args`, `VecU8`, `VecI32`, `VecString` +- `capability` (affine): `ReadFS`, `Filesystem`, `Dir`, `Stdin` +- `linear capability`: `FileRead` + ## 8) Moves and use-after-move ```cap diff --git a/capc/tests/typecheck.rs b/capc/tests/typecheck.rs index a38f684..39df8ab 100644 --- a/capc/tests/typecheck.rs +++ b/capc/tests/typecheck.rs @@ -519,6 +519,17 @@ fn typecheck_capability_borrow_return_result_fails() { .contains("methods returning capabilities must take `self` by value")); } +#[test] +fn typecheck_capability_borrow_return_helper_fails() { + let source = load_program("should_fail_capability_borrow_return_helper.cap"); + let module = parse_module(&source).expect("parse module"); + let stdlib = load_stdlib().expect("load stdlib"); + let err = type_check_program(&module, &stdlib, &[]).expect_err("expected type error"); + assert!(err + .to_string() + .contains("methods returning capabilities must take `self` by value")); +} + #[test] fn typecheck_borrow_local_temp_fails() { let source = load_program("should_fail_borrow_local_temp.cap"); diff --git a/docs/caps.md b/docs/caps.md index 67af2b4..387c0e9 100644 --- a/docs/caps.md +++ b/docs/caps.md @@ -48,7 +48,18 @@ All privileged operations live under `sys.*` as methods on capability types: So if you don’t have a `Console`, you cannot call `println`. The compiler will reject it. -For one-way attenuation, any method that returns a capability must take `self` by value. Methods that take `&self` cannot return capabilities. +### 3) Capability kinds and attenuation rules + +Capability types use the same move kinds as other structs: + +- `capability struct` defaults to **affine** (move-only, drop OK). +- `linear capability struct` means **must be consumed** on all paths. +- `copy capability struct` means **unrestricted** (only use this for caps you truly want to duplicate). + +Attenuation is enforced by method shape: + +- Any method that returns a capability must take `self` by value. +- Any method that takes `&self` cannot return a capability. ### 3) Root authority comes from `RootCap` The entrypoint receives a root capability: diff --git a/tests/programs/should_fail_capability_borrow_return_helper.cap b/tests/programs/should_fail_capability_borrow_return_helper.cap new file mode 100644 index 0000000..edc54ac --- /dev/null +++ b/tests/programs/should_fail_capability_borrow_return_helper.cap @@ -0,0 +1,18 @@ +package safe +module should_fail_capability_borrow_return_helper + +capability struct Cap + +fn make_cap() -> Cap { + return Cap{} +} + +impl Cap { + pub fn leak(self: &Cap) -> Cap { + return make_cap() + } +} + +pub fn main() -> i32 { + return 0 +} From 4d3bb53a510911499c2d59d074d4ad7afeedb69d Mon Sep 17 00:00:00 2001 From: Jordan Mecom Date: Sun, 28 Dec 2025 16:11:18 -0800 Subject: [PATCH 3/5] Clarify capability policy and tighten stdlib kinds --- TUTORIAL.md | 3 ++- docs/caps.md | 22 ++++++++++++++++++++++ docs/slice_design.md | 8 ++++---- stdlib/sys/buffer.cap | 8 ++++---- stdlib/sys/vec.cap | 6 +++--- 5 files changed, 35 insertions(+), 12 deletions(-) diff --git a/TUTORIAL.md b/TUTORIAL.md index 899ffd9..adeb259 100644 --- a/TUTORIAL.md +++ b/TUTORIAL.md @@ -170,7 +170,8 @@ Use `capability struct` for authority-bearing tokens. Use `opaque struct` for un In the current stdlib: -- `copy capability`: `RootCap`, `Console`, `Alloc`, `Buffer`, `Slice`, `MutSlice`, `Args`, `VecU8`, `VecI32`, `VecString` +- `copy capability`: `RootCap`, `Console`, `Args` +- `copy opaque`: `Alloc`, `Buffer`, `Slice`, `MutSlice`, `VecU8`, `VecI32`, `VecString` - `capability` (affine): `ReadFS`, `Filesystem`, `Dir`, `Stdin` - `linear capability`: `FileRead` diff --git a/docs/caps.md b/docs/caps.md index 387c0e9..dd3d7db 100644 --- a/docs/caps.md +++ b/docs/caps.md @@ -61,6 +61,28 @@ Attenuation is enforced by method shape: - Any method that returns a capability must take `self` by value. - Any method that takes `&self` cannot return a capability. +Quick examples: + +```cap +capability struct Dir +capability struct FileRead + +impl Dir { + pub fn open(self, name: string) -> FileRead { return () } +} +``` + +```cap +capability struct Dir +capability struct FileRead + +impl Dir { + pub fn open(self: &Dir, name: string) -> FileRead { return () } // error +} +``` + +Not every opaque handle is a capability. Use `capability` for authority-bearing tokens (filesystem, console, stdin); use `opaque` for unforgeable data handles (buffers, slices, vectors). + ### 3) Root authority comes from `RootCap` The entrypoint receives a root capability: diff --git a/docs/slice_design.md b/docs/slice_design.md index 14f23c6..ea7f6a0 100644 --- a/docs/slice_design.md +++ b/docs/slice_design.md @@ -51,8 +51,8 @@ Implementation detail: Allocation is explicit (Zig-like). Functions that allocate accept an allocator value. ```cap -capability struct Alloc -capability struct Buffer // move-only owner +opaque struct Alloc +opaque struct Buffer // move-only owner fn buffer_new(a: Alloc, initial_len: usize) -> Result[Buffer, AllocErr] fn buffer_len(b: &Buffer) -> usize @@ -63,8 +63,8 @@ fn buffer_free(a: Alloc, b: Buffer) -> unit // consumes b ### 3.2 Views ```cap -capability struct Slice[T] -capability struct MutSlice[T] +opaque struct Slice[T] +opaque struct MutSlice[T] fn buffer_as_slice(b: &Buffer) -> Slice[u8] fn buffer_as_mut_slice(b: &mut Buffer) -> MutSlice[u8] diff --git a/stdlib/sys/buffer.cap b/stdlib/sys/buffer.cap index 224bd63..4f1bad6 100644 --- a/stdlib/sys/buffer.cap +++ b/stdlib/sys/buffer.cap @@ -2,10 +2,10 @@ package safe module sys::buffer use sys::vec -pub copy capability struct Alloc -pub copy capability struct Buffer -pub copy capability struct Slice -pub copy capability struct MutSlice +pub copy opaque struct Alloc +pub copy opaque struct Buffer +pub copy opaque struct Slice +pub copy opaque struct MutSlice pub enum AllocErr { Oom diff --git a/stdlib/sys/vec.cap b/stdlib/sys/vec.cap index 4606e3a..1e4a76f 100644 --- a/stdlib/sys/vec.cap +++ b/stdlib/sys/vec.cap @@ -3,9 +3,9 @@ module sys::vec use sys::buffer -pub copy capability struct VecU8 -pub copy capability struct VecI32 -pub copy capability struct VecString +pub copy opaque struct VecU8 +pub copy opaque struct VecI32 +pub copy opaque struct VecString pub enum VecErr { OutOfRange, From ae125eeede56cfaa8de510d6cccbec803138f887 Mon Sep 17 00:00:00 2001 From: Jordan Mecom Date: Sun, 28 Dec 2025 16:13:13 -0800 Subject: [PATCH 4/5] Test opaque struct returning capability --- capc/tests/typecheck.rs | 8 ++++++++ .../should_pass_opaque_returns_capability.cap | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 tests/programs/should_pass_opaque_returns_capability.cap diff --git a/capc/tests/typecheck.rs b/capc/tests/typecheck.rs index 39df8ab..76a3eff 100644 --- a/capc/tests/typecheck.rs +++ b/capc/tests/typecheck.rs @@ -486,6 +486,14 @@ fn typecheck_capability_return_ok() { type_check_program(&module, &stdlib, &[]).expect("typecheck module"); } +#[test] +fn typecheck_opaque_returns_capability_ok() { + let source = load_program("should_pass_opaque_returns_capability.cap"); + let module = parse_module(&source).expect("parse module"); + let stdlib = load_stdlib().expect("load stdlib"); + type_check_program(&module, &stdlib, &[]).expect("typecheck module"); +} + #[test] fn typecheck_borrow_return_fails() { let source = load_program("should_fail_borrow_return.cap"); diff --git a/tests/programs/should_pass_opaque_returns_capability.cap b/tests/programs/should_pass_opaque_returns_capability.cap new file mode 100644 index 0000000..a9702d8 --- /dev/null +++ b/tests/programs/should_pass_opaque_returns_capability.cap @@ -0,0 +1,18 @@ +package safe +module should_pass_opaque_returns_capability + +opaque struct Token +capability struct Cap + +impl Token { + pub fn mint(self) -> Cap { + return Cap{} + } +} + +pub fn main() -> i32 { + let t = Token{} + let c = t.mint() + drop(c) + return 0 +} From f461f5d10fc7037bfcfa767680cdc1fdd37bd8e2 Mon Sep 17 00:00:00 2001 From: Jordan Mecom Date: Sun, 28 Dec 2025 16:23:29 -0800 Subject: [PATCH 5/5] Clarify attenuation example in tutorial --- TUTORIAL.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/TUTORIAL.md b/TUTORIAL.md index adeb259..4508673 100644 --- a/TUTORIAL.md +++ b/TUTORIAL.md @@ -148,6 +148,29 @@ This is attenuation: each step narrows authority. There is no safe API to widen To make attenuation one-way at compile time, any method that returns a capability must take `self` by value. Methods that take `&self` cannot return capabilities. +Example of what is rejected (and why): + +```cap +capability struct Dir +capability struct FileRead + +impl Dir { + pub fn open(self: &Dir, name: string) -> FileRead { + let file = self.open_read(name) + return file + } +} +``` + +Why this is rejected: + +- `Dir` can read many files (more power). +- `FileRead` can read one file (less power). +- The bad example lets you keep the more powerful `Dir` and also get a `FileRead`. +- We want “one-way” attenuation: when you make something less powerful, you give up the more powerful one. + +So methods that return capabilities must take `self` by value, which consumes the old capability. + ## 7) Capability, opaque, copy, affine, linear `capability struct` is the explicit “this is an authority token” marker. Capability types are always opaque (no public fields, no user construction) and default to affine unless marked `copy` or `linear`. This exists so the capability surface is obvious in code and the compiler can enforce one‑way attenuation (methods returning capabilities must take `self` by value).