use array::array; use enumset::{enum_set, EnumSet}; use crate::{syntax_error::SyntaxError, syntax_kind::SyntaxKind}; use self::object::object; pub(crate) type Parser<'src> = pawarser::Parser<'src, SyntaxKind, SyntaxError>; pub(crate) type CompletedMarker = pawarser::CompletedMarker; const BASIC_VALUE_TOKENS: EnumSet = enum_set!(SyntaxKind::BOOL | SyntaxKind::NULL | SyntaxKind::NUMBER | SyntaxKind::STRING); pub fn value(p: &mut Parser) -> bool { if BASIC_VALUE_TOKENS.contains(p.current()) { p.do_bump(); return true; } else { object(p).or_else(|| array(p)).is_some() } } mod array; mod object;