Add only_i32 and only_i64 features.

This commit is contained in:
Stephen Chung
2020-03-10 23:06:20 +08:00
parent e22aaca5c1
commit 708c285a0a
31 changed files with 532 additions and 312 deletions

View File

@@ -2,7 +2,7 @@
use crate::any::Dynamic;
use crate::error::ParseError;
use crate::parser::Position;
use crate::parser::{Position, INT};
use std::{error::Error, fmt};
/// Evaluation result.
@@ -24,10 +24,10 @@ pub enum EvalAltResult {
ErrorCharMismatch(Position),
/// Array access out-of-bounds.
/// Wrapped values are the current number of elements in the array and the index number.
ErrorArrayBounds(usize, i64, Position),
ErrorArrayBounds(usize, INT, Position),
/// String indexing out-of-bounds.
/// Wrapped values are the current number of characters in the string and the index number.
ErrorStringBounds(usize, i64, Position),
ErrorStringBounds(usize, INT, Position),
/// Trying to index into a type that is not an array and not a string.
ErrorIndexingType(String, Position),
/// Trying to index into an array or string with an index that is not `i64`.