pub struct JsonLanguage {
pub trailing_comma: bool,
pub bare_keys: bool,
pub single_quotes: bool,
pub comments: bool,
pub hex_numbers: bool,
pub infinity_and_nan: bool,
}Expand description
JSON 语言实现
Fields§
§trailing_comma: bool是否允许尾随逗号
bare_keys: bool是否允许裸键(不带引号的键)
single_quotes: bool是否允许单引号字符串
comments: bool是否允许注释
hex_numbers: bool是否允许十六进制数字
infinity_and_nan: bool是否允许无穷大和 NaN
Implementations§
Trait Implementations§
Source§impl<'config> Builder<JsonLanguage> for JsonBuilder<'config>
impl<'config> Builder<JsonLanguage> for JsonBuilder<'config>
Source§fn build<'a, S: Source + ?Sized>(
&self,
source: &S,
edits: &[TextEdit],
_cache: &'a mut impl BuilderCache<JsonLanguage>,
) -> OakDiagnostics<JsonRoot>
fn build<'a, S: Source + ?Sized>( &self, source: &S, edits: &[TextEdit], _cache: &'a mut impl BuilderCache<JsonLanguage>, ) -> OakDiagnostics<JsonRoot>
Builds the structure from the source text.
Source§impl Clone for JsonLanguage
impl Clone for JsonLanguage
Source§fn clone(&self) -> JsonLanguage
fn clone(&self) -> JsonLanguage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JsonLanguage
impl Debug for JsonLanguage
Source§impl Default for JsonLanguage
impl Default for JsonLanguage
Source§impl Language for JsonLanguage
impl Language for JsonLanguage
Source§const CATEGORY: LanguageCategory = LanguageCategory::Config
const CATEGORY: LanguageCategory = LanguageCategory::Config
The category of the language.
Source§type TokenType = JsonSyntaxKind
type TokenType = JsonSyntaxKind
The token type used to represent different token and node types in the language. Read more
Source§type ElementType = JsonSyntaxKind
type ElementType = JsonSyntaxKind
The element type used to represent composite structures in the parsed tree. Read more
Source§impl<'config> Lexer<JsonLanguage> for JsonLexer<'config>
impl<'config> Lexer<JsonLanguage> for JsonLexer<'config>
Source§fn lex<'a, S: Source + ?Sized>(
&self,
source: &'a S,
_edits: &[TextEdit],
cache: &'a mut impl LexerCache<JsonLanguage>,
) -> LexOutput<JsonLanguage>
fn lex<'a, S: Source + ?Sized>( &self, source: &'a S, _edits: &[TextEdit], cache: &'a mut impl LexerCache<JsonLanguage>, ) -> LexOutput<JsonLanguage>
Tokenizes the given source text into a sequence of tokens. Read more
Source§impl<'config> Parser<JsonLanguage> for JsonParser<'config>
impl<'config> Parser<JsonLanguage> for JsonParser<'config>
Source§fn parse<'a, S: Source + ?Sized>(
&self,
text: &'a S,
edits: &[TextEdit],
cache: &'a mut impl ParseCache<JsonLanguage>,
) -> ParseOutput<'a, JsonLanguage>
fn parse<'a, S: Source + ?Sized>( &self, text: &'a S, edits: &[TextEdit], cache: &'a mut impl ParseCache<JsonLanguage>, ) -> ParseOutput<'a, JsonLanguage>
The core parsing entry point. Read more
Source§impl PartialEq for JsonLanguage
impl PartialEq for JsonLanguage
impl Copy for JsonLanguage
impl Eq for JsonLanguage
impl StructuralPartialEq for JsonLanguage
Auto Trait Implementations§
impl Freeze for JsonLanguage
impl RefUnwindSafe for JsonLanguage
impl Send for JsonLanguage
impl Sync for JsonLanguage
impl Unpin for JsonLanguage
impl UnwindSafe for JsonLanguage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more