Use no-std-compat to build no-std.
This commit is contained in:
@@ -9,17 +9,6 @@ use crate::engine::{Precedence, KEYWORD_THIS, OP_CONTAINS};
|
||||
use crate::module::NamespaceRef;
|
||||
use crate::optimize::optimize_into_ast;
|
||||
use crate::optimize::OptimizationLevel;
|
||||
use crate::stdlib::{
|
||||
boxed::Box,
|
||||
collections::BTreeMap,
|
||||
format,
|
||||
hash::{Hash, Hasher},
|
||||
iter::empty,
|
||||
num::{NonZeroU8, NonZeroUsize},
|
||||
string::ToString,
|
||||
vec,
|
||||
vec::Vec,
|
||||
};
|
||||
use crate::syntax::{CustomSyntax, MARKER_BLOCK, MARKER_EXPR, MARKER_IDENT};
|
||||
use crate::token::{
|
||||
is_keyword_function, is_valid_identifier, Token, TokenStream, TokenizerControl,
|
||||
@@ -29,6 +18,14 @@ use crate::{
|
||||
calc_fn_hash, Dynamic, Engine, Identifier, LexError, ParseError, ParseErrorType, Position,
|
||||
Scope, Shared, StaticVec, AST,
|
||||
};
|
||||
#[cfg(feature = "no_std")]
|
||||
use std::prelude::v1::*;
|
||||
use std::{
|
||||
collections::BTreeMap,
|
||||
hash::{Hash, Hasher},
|
||||
iter::empty,
|
||||
num::{NonZeroU8, NonZeroUsize},
|
||||
};
|
||||
|
||||
#[cfg(not(feature = "no_float"))]
|
||||
use crate::FLOAT;
|
||||
@@ -2501,7 +2498,7 @@ fn parse_stmt(
|
||||
#[cfg(not(feature = "no_function"))]
|
||||
#[cfg(feature = "metadata")]
|
||||
let comments = {
|
||||
let mut comments: StaticVec<crate::stdlib::string::String> = Default::default();
|
||||
let mut comments: StaticVec<std::string::String> = Default::default();
|
||||
let mut comments_pos = Position::NONE;
|
||||
|
||||
// Handle doc-comments.
|
||||
@@ -2756,7 +2753,7 @@ fn parse_fn(
|
||||
mut settings: ParseSettings,
|
||||
#[cfg(not(feature = "no_function"))]
|
||||
#[cfg(feature = "metadata")]
|
||||
comments: StaticVec<crate::stdlib::string::String>,
|
||||
comments: StaticVec<std::string::String>,
|
||||
) -> Result<ScriptFnDef, ParseError> {
|
||||
#[cfg(not(feature = "unchecked"))]
|
||||
settings.ensure_level_within_max_limit(state.max_expr_depth)?;
|
||||
|
Reference in New Issue
Block a user