Skip to content

Commit

Permalink
Add topic macro
Browse files Browse the repository at this point in the history
  • Loading branch information
nebneb0703 authored and profi248 committed Jun 7, 2022
1 parent 4c4ac55 commit 4ec9d17
Show file tree
Hide file tree
Showing 7 changed files with 296 additions and 69 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
name: Build coordinator Dockerfile

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the Docker image
Expand Down
40 changes: 22 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
depends_on:
- postgres
- mosquitto
restart: always
postgres:
image: postgres
restart: always
Expand Down
5 changes: 4 additions & 1 deletion macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ proc-macro = true

[dependencies]
syn = "1.0.95"
quote = "1.0.18"
quote = "1.0.18"
proc-macro2 = "1.0.39"
regex = "1.5.6"
lazy_static = "1.4.0"
12 changes: 11 additions & 1 deletion macros/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
extern crate proc_macro;

mod topics;

use proc_macro::TokenStream;

use syn::{ parse_macro_input, LitStr };
Expand All @@ -23,4 +26,11 @@ pub fn wordlist(tokens: TokenStream) -> TokenStream {
#(#words),*
]
}).into()
}
}

#[proc_macro]
pub fn define_topics(tokens: TokenStream) -> TokenStream {
let topics = parse_macro_input!(tokens as topics::RootTopic);

topics::expand_root(topics).into()
}
Loading

0 comments on commit 4ec9d17

Please sign in to comment.