aboutsummaryrefslogtreecommitdiff
path: root/macros/src/syntax/check.rs
diff options
context:
space:
mode:
Diffstat (limited to 'macros/src/syntax/check.rs')
-rw-r--r--macros/src/syntax/check.rs66
1 files changed, 0 insertions, 66 deletions
diff --git a/macros/src/syntax/check.rs b/macros/src/syntax/check.rs
deleted file mode 100644
index 989d4180..00000000
--- a/macros/src/syntax/check.rs
+++ /dev/null
@@ -1,66 +0,0 @@
-use std::collections::HashSet;
-
-use syn::parse;
-
-use crate::syntax::ast::App;
-
-pub fn app(app: &App) -> parse::Result<()> {
- // Check that all referenced resources have been declared
- // Check that resources are NOT `Exclusive`-ly shared
- let mut owners = HashSet::new();
- for (_, name, access) in app.shared_resource_accesses() {
- if app.shared_resources.get(name).is_none() {
- return Err(parse::Error::new(
- name.span(),
- "this shared resource has NOT been declared",
- ));
- }
-
- if access.is_exclusive() {
- owners.insert(name);
- }
- }
-
- for name in app.local_resource_accesses() {
- if app.local_resources.get(name).is_none() {
- return Err(parse::Error::new(
- name.span(),
- "this local resource has NOT been declared",
- ));
- }
- }
-
- // Check that no resource has both types of access (`Exclusive` & `Shared`)
- let exclusive_accesses = app
- .shared_resource_accesses()
- .filter_map(|(priority, name, access)| {
- if priority.is_some() && access.is_exclusive() {
- Some(name)
- } else {
- None
- }
- })
- .collect::<HashSet<_>>();
- for (_, name, access) in app.shared_resource_accesses() {
- if access.is_shared() && exclusive_accesses.contains(name) {
- return Err(parse::Error::new(
- name.span(),
- "this implementation doesn't support shared (`&-`) - exclusive (`&mut-`) locks; use `x` instead of `&x`",
- ));
- }
- }
-
- // check that dispatchers are not used as hardware tasks
- for task in app.hardware_tasks.values() {
- let binds = &task.args.binds;
-
- if app.args.dispatchers.contains_key(binds) {
- return Err(parse::Error::new(
- binds.span(),
- "dispatcher interrupts can't be used as hardware tasks",
- ));
- }
- }
-
- Ok(())
-}
n> Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/examples/docs (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2022-04-26Revert "fix: replace serialize-javascript & random-bytes with custom internal...Gravatar Nate Moore 7-565/+215
2022-04-26[ci] formatGravatar okikio 2-271/+315
2022-04-26fix: replace serialize-javascript & random-bytes with custom internal modulesGravatar Okiki 7-215/+521
2022-04-26[ci] release (#3182)create-astro@0.10.0astro@1.0.0-beta.18@astrojs/vercel@0.1.4@astrojs/tailwind@0.2.1@astrojs/svelte@0.1.2@astrojs/netlify@0.3.3Gravatar github-actions[bot] 54-146/+130
2022-04-26[ci] formatGravatar matthewp 1-1/+1
2022-04-26fix(vercel): `trailingSlash` fix for non-html pages (#3185)Gravatar Juan Martín Seery 2-29/+42
2022-04-26Prevent watcher from running during the build (#3207)Gravatar Matthew Phillips 2-0/+9
2022-04-26Fix lockfile (#3210)Gravatar Juan Martín Seery 1-6/+0
2022-04-26Add missing is:raw in AstroBuiltinAttributes (#3209)Gravatar Erika 2-0/+6
2022-04-26Feat: support `astro add` without npm installing (#3183)Gravatar Ben Holmes 6-30/+49
2022-04-26Add Astro attributes to svg elements (#3205)Gravatar Erika 2-1/+9
2022-04-26[ci] formatGravatar bholmesdev 2-9/+9
2022-04-26Feat: `create astro` add install step (#3190)Gravatar Ben Holmes 7-162/+299
2022-04-26[ci] collect statsGravatar FredKSchott 1-0/+1
2022-04-25fix(markdown): file.url fixes (#3198)Gravatar Juan Martín Seery 11-10/+149
2022-04-25[ci] collect statsGravatar FredKSchott 1-0/+1
2022-04-24add vite to licenseGravatar Fred K. Schott 2-24/+29
2022-04-24feat(markdown): Improved types (#3191)Gravatar Juan Martín Seery 3-6/+47
2022-04-24[ci] collect statsGravatar FredKSchott 1-0/+1
2022-04-23[ci] collect statsGravatar FredKSchott 1-0/+1