aboutsummaryrefslogtreecommitdiffstats
path: root/src/parser.rs
diff options
context:
space:
mode:
authorTeddy Wing2018-08-23 10:22:14 +0200
committerTeddy Wing2018-08-23 10:27:16 +0200
commitba97dc5f57da049f9cada870000bffe556dec38a (patch)
treeaf047f423523cb3cfe1e88754c4bca4b1af1f425 /src/parser.rs
parentb33feb5c94bf346ddc5dee68c7bf8c6b039168db (diff)
downloaddome-key-map-ba97dc5f57da049f9cada870000bffe556dec38a.tar.bz2
cocoa_bridge: Continue outline of Objective C callable
Add some more structure to the function that will be called from Objective C code. * Give it a name, `parse_mappings` (not very thoroughly considered) * Initialise some Foundation data structures to mirror our Rust ones * Add the beginning of a struct that will be the ObjC version of our `MapGroup` struct, containing `NSDictionary`ies. * Move the `extern crate` into `lib.rs`, I keep forgetting that's where they go. * Add a test that just calls `parse_mappings` to check that the code compiles. parser::MapGroup: Make both its fields public to enable us to access them from `cocoa_bridge`. Used this helpful example as a reference for the Rust Cocoa code: https://github.com/servo/core-foundation-rs/blob/c99c05c/cocoa/examples/hello_world.rs
Diffstat (limited to 'src/parser.rs')
-rw-r--r--src/parser.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parser.rs b/src/parser.rs
index a34edff..d5cd860 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -51,8 +51,8 @@ struct Mode {
#[derive(Debug, PartialEq)]
pub struct MapGroup {
- maps: MapCollection,
- modes: HashMap<Trigger, MapCollection>,
+ pub maps: MapCollection,
+ pub modes: HashMap<Trigger, MapCollection>,
}
#[derive(Debug, PartialEq)]