Skip to content

Commit

Permalink
Merge pull request #11 from jymchng/feature/feature-gates
Browse files Browse the repository at this point in the history
Feature/feature gates
  • Loading branch information
jymchng authored Apr 3, 2024
2 parents c3cb1d6 + 338b80a commit a3cf358
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 114 deletions.
6 changes: 3 additions & 3 deletions src/ast_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ impl AllowedMacros {
let macro_ident = the_macro.path.require_ident()?;
match macro_ident.to_string().as_str() {
"env" => Ok(Self::Env(the_macro.parse_body::<EnvArgs>()?)),
other => Err(Error::new_spanned(
other,
"currently only support `env`-like macro invocation",
other => Err(Error::new(
macro_ident.span(),
format!("currently only support `env` macro-like invocation, it currently does not support `{}`", other),
)),
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/exprs_impl.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::ast::{LitInteger, MathExprs};
use crate::rsc::{parse, tokenize, Interpreter, Variant};
use proc_macro2::Span;
use quote::ToTokens;
use rsc::{parse, tokenize, Interpreter, Variant};
use syn::{spanned::Spanned, Error, LitInt, Result, Stmt};

const ANS: &str = "ANS";
Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ use crate::ast::{
};
use crate::macros::debug_eprintln;
use proc_macro::{self, TokenStream};
#[allow(clippy::all)]
use rsc;
use tnconst_impl::{
nconst_impl_lit_integer, nconst_impl_math_exprs, pconst_impl_lit_integer,
pconst_impl_math_exprs, tnconst_impl_lit_integer, tnconst_impl_math_exprs,
Expand Down
1 change: 1 addition & 0 deletions trybuild_tests/compile_fails/test_compile_fail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ fn test_tnconst() {
type R = tnconst![- env!("ENV_VAR");];
type S = tnconst![+ env!("NENV_VAR");];
type T = tnconst![ env!("NENV_VAR");];
type U = tnconst![ ggenv!("NENV_VAR");];
println!("test_tnconst Passed!");
}

Expand Down
Loading

0 comments on commit a3cf358

Please sign in to comment.