JSON5 格式标准 Data Exchange Format 官方文档 中英双语

news2025/4/1 1:14:05

Standard JSON5  标准 JSON5

1.0.0 / March 2018  1.0.0 / 三月 2018

The JSON5 Data Interchange FormatThe JSON5 数据交换格式

Abstract  摘要

The JSON5 Data Interchange Format is a proposed extension to JSON that aims to make it easier for humans to write and maintain by hand. It does this by adding some minimal syntax features directly from ECMAScript 5.1.JSON5 数据交换格式是一个提议的 JSON 扩展,旨在通过直接添加一些来自 ECMAScript 5.1 的最小语法特性,使人类更容易手动编写和维护。

1Introduction  1 介绍

The JSON5 Data Interchange Format (JSON5) is a superset of JSON that aims to alleviate some of the limitations of JSON by expanding its syntax to include some productions from ECMAScript 5.1.JSON5 数据交换格式(JSON5)是 JSON 的超集,旨在通过扩展其语法以包括一些来自 ECMAScript 5.1 的生产来缓解 JSON 的一些限制。

Similar to JSON, JSON5 can represent four primitive types (strings, numbers, Booleans, and null) and two structured types (objects and arrays).与 JSON 类似,JSON5 可以表示四种原始类型(字符串、数字、布尔值和 null)以及两种结构化类型(对象和数组)。

A string is a sequence of zero or more Unicode characters. Note that this citation references the latest version of Unicode rather than a specific release. It is not expected that future changes in the Unicode specification will impact the syntax of JSON5.字符串是由零个或多个 Unicode 字符组成的序列。请注意,此引用引用的是 Unicode 的最新版本,而不是特定版本。预计 Unicode 规范的未来变化不会影响 JSON5 的语法。

An object is an unordered collection of zero or more name/value pairs, where a name is a string or identifier and a value is a string, number, Boolean, null, object, or array.对象是一个无序集合,包含零个或多个键值对,其中键是一个字符串或标识符,值是字符串、数字、布尔值、null、对象或数组。

An array is an ordered sequence of zero or more values.数组是一个有序的值序列。

1.1Summary of Features  1.1 功能概述

The following ECMAScript 5.1 features, which are not supported in JSON, have been extended to JSON5.以下 ECMAScript 5.1 特性,这些特性在 JSON 中不受支持,已经被扩展到 JSON5 中。

Objects  对象

  • Object keys may be an ECMAScript 5.1 IdentifierName.对象的键可以是 ECMAScript 5.1 的标识符名称。
  • Objects may have a single trailing comma.对象可以有单个尾随逗号。

Arrays  数组

  • Arrays may have a single trailing comma.数组可以有单个尾随逗号。

Strings  字符串

  • Strings may be single quoted.字符串可以使用单引号。
  • Strings may span multiple lines by escaping new line characters.字符串可以通过转义换行符跨越多行。
  • Strings may include character escapes.字符串可以包含字符转义。

Numbers  数字

  • Numbers may be hexadecimal.数字可以是十六进制。
  • Numbers may have a leading or trailing decimal point.数字可以有一个前导或尾随的小数点。
  • Numbers may be IEEE 754 positive infinity, negative infinity, and NaN.数字可以是 IEEE 754 的正无穷、负无穷和 NaN。
  • Numbers may begin with an explicit plus sign.数字可以以显式的加号开头。

Comments  评论

  • Single and multi-line comments are allowed.允许单行和多行注释。

White Space  空白字符

  • Additional white space characters are allowed.允许额外的空白字符。

1.2Short Example  1.2 简例

Example (Informative)  示例(信息性)

{
  // comments
  unquoted: 'and you can quote me on that',
  singleQuotes: 'I can use "double quotes" here',
  lineBreaks: "Look, Mom! \
No \\n's!",
  hexadecimal: 0xdecaf,
  leadingDecimalPoint: .8675309, andTrailing: 8675309.,
  positiveSign: +1,
  trailingComma: 'in objects', andIn: ['arrays',],
  "backwardsCompatible": "with JSON",
}

2Values  2 值

A JSON5 value must be an object, array, string, or number, or one of the three literal names true, false, or null.JSON5 值必须是一个对象、数组、字符串、数字,或者是三个字面量名称之一: true 、 false 或 null 。

JSON5Value:  JSON5 值:JSON5Null  JSON5 空值JSON5Boolean  JSON5 布尔值JSON5String  JSON5 字符串JSON5Number  JSON5 数字JSON5Object  JSON5 对象JSON5Array  JSON5 数组# 3Objects  3 个对象

An object structure is represented as a pair of curly brackets surrounding zero or more name/value pairs (or members). A name is a string or identifier. A single colon comes after each name, separating the name from the value. A single comma separates a value from a following name. A single comma may follow the name/value pair. The names within an object should be unique.对象结构用一对花括号表示,其中包含零个或多个名称/值对(或成员)。名称是一个字符串或标识符。每个名称之后跟一个单冒号,将名称与值分开。一个值之后跟一个单逗号,与后面的名称分开。名称/值对之后可以跟一个单逗号。对象内的名称应该是唯一的。

JSON5Object:  JSON5 对象:{}{JSON5MemberList,opt}  { JSON5 成员列表, 选择}JSON5MemberList:  JSON5 成员列表:JSON5Member  JSON5 成员JSON5MemberList,JSON5MemberJSON5 成员列表, JSON5 成员JSON5Member:  JSON5 成员:JSON5MemberName:JSON5ValueJSON5 成员名称: JSON5 值JSON5MemberName:  JSON5 成员名称:JSON5Identifier  JSON5 标识符JSON5String  JSON5 字符串An object whose names are all unique is interoperable in the sense that all software implementations receiving that object will agree on the name-value mappings. When the names within an object are not unique, the behavior of software that receives such an object is unpredictable. Implementations may report the last name/value pair only, report an error or fail to parse the object, or report all of the name/value pairs, including duplicates.一个名称全部唯一的对象在互操作性方面是可行的,即所有接收该对象的软件实现都将同意名称-值映射。当对象内的名称不唯一时,接收此类对象的软件的行为是不可预测的。实现可能只报告最后一个名称/值对,报告错误或无法解析对象,或者报告所有名称/值对,包括重复项。

Implementations may make the ordering of object members visible to calling software. Implementations whose behavior does not depend on member ordering will be interoperable in the sense that they will not be affected by this.实现可能将对象成员的顺序对调用软件可见。那些行为不依赖于成员顺序的实现将在互操作性方面是可行的,即它们将不会受到影响。

Example (Informative)  示例(信息性)

// An empty object
{}

// An object with two properties
// and a trailing comma
{
    width: 1920,
    height: 1080,
}

// Objects can be nested
{
    image: {
        width: 1920,
        height: 1080,
        'aspect-ratio': '16:9',
    }
}

// An array of objects
[
    { name: 'Joe', age: 27 },
    { name: 'Jane', age: 32 },
]

4Arrays  4 数组

An array structure is represented as square brackets surrounding zero or more values (or elements). Elements are separated by commas. A single comma may follow the final element.数组结构用方括号表示,括号内包含零个或多个值(或元素)。元素之间用逗号分隔。最后一个元素后面可以跟一个逗号。

JSON5Array:  JSON5 数组:[][JSON5ElementList,opt]  [ JSON5 元素列表, 可选 ]JSON5ElementList:  JSON5 元素列表:JSON5Value  JSON5 值JSON5ElementList,JSON5ValueJSON5 元素列表,JSON5 值There is no requirement that the values in an array be of the same type.数组中的值没有要求必须是同一类型。

Example (Informative)  示例(信息性)

// An empty array
[]

// An array with three elements
// and a trailing comma
[
    1,
    true,
    'three',
]

// Arrays can be nested
[
    [1, true, 'three'],
    [4, "five", 0x6],
]

5Strings  5 字符串

A string begins and ends with single or double quotation marks. The same quotation mark that begins a string must also end the string. All Unicode characters may be placed within the quotation marks, except for the characters that must be escaped: the quotation mark used to begin and end the string, reverse solidus, and line terminators.字符串以单引号或双引号开始和结束。开始字符串的相同引号也必须结束字符串。所有 Unicode 字符都可以放在引号内,除了必须转义的字符:用于开始和结束字符串的引号、反斜杠和换行符。

JSON5String::  JSON5 字符串::“JSON5DoubleStringCharactersopt”" JSON5 双引号字符串字符可选"‘JSON5SingleStringCharactersopt’'JSON5 单引号字符串字符 opt’JSON5DoubleStringCharacters::'JSON5 双引号字符串字符::'JSON5DoubleStringCharacterJSON5DoubleStringCharactersopt’JSON5 双引号字符串字符 JSON5 双引号字符串字符 opt’JSON5SingleStringCharacters::'JSON5 单引号字符串字符::'JSON5SingleStringCharacterJSON5SingleStringCharactersoptJSON5 单个字符串字符 JSON5 单个字符串字符可选JSON5DoubleStringCharacter::JSON5 双引号字符串字符::SourceCharacterbut not one of " or \ or LineTerminator源字符但不是 " 或 \ 或 行终止符\EscapeSequence  转义序列LineContinuation  行续行符U+2028U+2029JSON5SingleStringCharacter::JSON5 单字符串字符::SourceCharacterbut not one of ’ or \ or LineTerminator源字符,但不是 ’ 或 \ 或 行终止符之一\EscapeSequence  转义序列LineContinuation  行续行符U+2028U+2029# 5.1Escapes  5.1 转义

Any character may be escaped. If the character is in the Basic Latin or Latin-1 Supplement Unicode character ranges (U+0000 through U+00FF), then it may be represented as a four-character sequence: a reverse solidus, followed by the lower case letter x, followed by two hexadecimal digits that encode the character’s code point. A reverse solidus followed by the lower case letter x must be followed by two hexadecimal digits.任何字符都可以进行转义。如果字符在基本拉丁或拉丁-1 补充 Unicode 字符范围内(U+0000 至 U+00FF),则可以表示为四个字符的序列:一个反斜杠,后跟小写字母 x ,然后是两个表示字符代码点的十六进制数字。一个反斜杠后跟小写字母 x 必须后跟两个十六进制数字。

If the character is in the Basic Multilingual Plane (U+0000 through U+FFFF), then it may be represented as a six-character sequence: a reverse solidus, followed by the lower case letter u, followed by four hexadecimal digits that encode the character’s code point. A reverse solidus followed by the lower case letter u must be followed by four hexadecimal digits. The hexadecimal letters A though F can be upper or lower case.如果字符位于基本多语言平面(U+0000 至 U+FFFF),则它可以表示为一个六字符序列:一个反斜杠,后跟小写字母 u ,然后是四个十六进制数字,这些数字编码了字符的代码点。一个反斜杠后跟小写字母 u 必须后跟四个十六进制数字。十六进制字母 A 到 F 可以是大写或小写。

Example 1 (Informative)  示例 1(信息性)

A string containing only a single reverse solidus character may be represented as '\x5C' or '\u005C'.仅包含单个反斜杠字符的字符串可以表示为 ‘\x5C’ 或 ‘\u005C’ 。

To escape an extended character that is not in the Basic Multilingual Plane, the character is represented as a 12-character sequence, encoding the UTF-16 surrogate pair.要转义不在基本多语言平面的扩展字符,该字符表示为一个 12 字符序列,编码 UTF-16 代理对。

Example 2 (Informative)  示例 2(信息性)

A string containing only the musical score character 🎼 (U+1F3BC) may be represented as '\uD83C\uDFBC'.仅包含音乐符号字符🎼(U+1F3BC)的字符串可以表示为 ‘\uD83C\uDFBC’ 。

Alternatively, there are two-character sequence escape representations of some popular characters. A decimal digit must not follow a reverse solidus followed by a zero.或者,还有一些流行字符的两种字符序列转义表示。一个十进制数字不能跟在反斜杠后跟零之后。

Table 1: Escape sequences
表 1:转义序列

Escape Sequence  转义序列Description  描述Code Point  代码点
\'Apostrophe  引号U+0027  '字符
\"Quotation mark  引号U+0022  "字符
\\Reverse solidus  反斜杠U+005C
\bBackspace  退格键U+0008
\fForm feed  换页符U+000C
\nLine feed  换行符U+000A
\rCarriage return  回车U+000D
\tHorizontal tab  水平制表符U+0009
\vVertical tab  垂直制表符U+000B
\0Null  空值U+0000

Example 3 (Informative)  示例 3(信息性)

A string containing only a single reverse solidus character may be represented more compactly as '\\'.一个仅包含单个反斜杠字符的字符串可以更紧凑地表示为 ‘\’ 。

A string may be continued on a new line by following a reverse solidus with one of the following line terminator sequences. The reverse solidus and line terminator sequence are not included in the string.字符串可以通过在反斜杠后跟以下之一的新行终止序列来继续在新行上。反斜杠和新行终止序列不包括在字符串中。

Table 2: Line terminator sequences
表 2:行终止序列

Code Points  代码点Description  描述
U+000ALine feed  换行符
U+000DCarriage return  回车
U+000D U+000A  空白符 U+000D U+000ACarriage return and line feed换行符和回车符
U+2028Line separator  行分隔符
U+2029Paragraph separator  段落分隔符

Example 4 (Informative)  示例 4(信息性)

The following strings represent the same information.以下字符串表示相同的信息。

'Lorem ipsum dolor sit amet, \
consectetur adipiscing elit.'

'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'

If any other character follows a reverse solidus, except for the decimal digits 1 through 9, that character will be included in the string, but the reverse solidus will not.如果反斜杠后面跟的是数字 1 到 9 之外的任何字符,则该字符将被包含在字符串中,但反斜杠本身不会。

Example 5 (Informative)  示例 5(信息性)

The following strings represent the same information.以下字符串表示相同的信息。

'\A\C\/\D\C'

'AC/DC'

5.2Paragraph and Line Separators5.2 段落和换行分隔符

Like JSON, JSON5 allows the Unicode code points U+2028 and U+2029 to appear unescaped in strings. Since ECMAScript 5.1 does not allow these code points in strings, authors should avoid including them in JSON5 documents. JSON5 parsers should produce a warning when they are found unescaped in strings. JSON5 generators should escape these code points in strings.与 JSON 一样,JSON5 允许 Unicode 码点 U+2028 和 U+2029 在字符串中未转义出现。由于 ECMAScript 5.1 不允许这些码点出现在字符串中,作者应避免在 JSON5 文档中包含它们。当 JSON5 解析器在字符串中找到未转义的这些码点时,应产生警告。JSON5 生成器应在字符串中转义这些码点。

6Numbers  6 个数字

The representation of numbers is similar to that used in most programming languages. A number may be represented in in base 10 using decimal digits, base 16 using hexadecimal digits, or the IEEE 754 values positive infinity, negative infinity, or NaN.数字表示与大多数编程语言中使用的表示类似。一个数字可以用十进制数字表示为十进制,用十六进制数字表示为十六进制,或者用 IEEE 754 值表示为正无穷、负无穷或 NaN。

JSON5Number::  JSON5 数字::JSON5NumericLiteral+JSON5NumericLiteral-JSON5NumericLiteral  JSON5 数值字面量JSON5NumericLiteral::  JSON5 数值字面量::NumericLiteral  数值字面量Infinity  无穷大NaN  非数字Decimal numbers contain an integer component that may be prefixed with an optional plus or minus sign, which may be followed by a fraction part and/or an exponent part.十进制数包含一个整数部分,该部分可能以可选的正号或负号开头,可能后跟分数部分和/或指数部分。

A fraction part is a decimal point followed by one or more digits.分数部分是一个小数点后跟一个或多个数字。

An exponent part begins with the letter E in upper or lower case, which may be followed by a plus or minus sign. The E and optional sign are followed by one or more digits.指数部分以大写或小写的字母 E 开头,后面可能跟有一个加号或减号。E 和可选的符号后面跟着一个或多个数字。

Example 1 (Informative)  示例 1(信息性)

{
    integer: 123,
    withFractionPart: 123.456,
    onlyFractionPart: .456,
    withExponent: 123e-456,
}

Hexadecimal numbers contain the literal characters 0x or 0X that may be prefixed with an optional plus or minus sign, which must be followed by one or more hexadecimal digits. The hexadecimal letters A through F can be upper or lower case.十六进制数包含字面字符 0x 或 0X ,可能前面有一个可选的加号或减号,后面必须跟着一个或多个十六进制数字。十六进制字母 A 到 F 可以是大写或小写。

Example 2 (Informative)  示例 2(信息性)

{
    positiveHex: 0xdecaf,
    negativeHex: -0xC0FFEE,
}

The IEEE 754 value positive infinity must be the literal characters Infinity and may be prefixed with an optional plus sign.IEEE 754 值正无穷必须表示为字符 Infinity ,并且可以有一个可选的正号前缀。

The IEEE 754 value negative infinity must be the literal characters -Infinity.IEEE 754 值负无穷必须表示为字符 -Infinity 。

The IEEE 754 value NaN must be the literal characters NaN and may be prefixed with an optional plus or minus sign.IEEE 754 值 NaN 必须表示为字符 NaN ,并且可以有一个可选的正号或负号前缀。

Example 3 (Informative)  示例 3(信息性)

{
    positiveInfinity: Infinity,
    negativeInfinity: -Infinity,
    notANumber: NaN,
}

7Comments  7 注释

Comments can be either single or multi-line. Multi-line comments cannot nest. Comments may appear before and after any JSON5Token.注释可以是单行或多行。多行注释不能嵌套。注释可以出现在任何 JSON5Token 之前和之后。

A single line comment begins with two soliduses and ends with a LineTerminator or the end of the document. All Unicode characters may be placed within the start and end, except for a LineTerminator.单行注释以两个连续斜杠开始,以行终止符或文档结尾结束。可以在开始和结束之间放置所有 Unicode 字符,除了行终止符。

A multi-line comment begins with a solidus and an asterisk and ends with an asterisk and a solidus. All Unicode characters may be placed within the start and end, except for an asterisk followed by a solidus.多行注释以一个斜杠和一个星号开始,以一个星号和一个斜杠结束。所有 Unicode 字符都可以放在开始和结束之间,除了星号后面跟着一个斜杠。

Example (Informative)  示例(信息性)

// This is a single line comment.

/* This is a multi-
   line comment. */

8White Space  8 空白字符

White space may appear before and after any JSON5Token.空白字符可以出现在任何 JSON5Token 之前和之后。

Table 3: White space
表 3:空白字符

Code Points  代码点Description  描述
U+0009Horizontal tab  水平制表符
U+000ALine feed  换行符
U+000BVertical tab  垂直制表符
U+000CForm feed  换页符
U+000DCarriage return  回车
U+0020Space  空间
U+00A0Non-breaking space  非换行空格
U+2028Line separator  行分隔符
U+2029Paragraph separator  段落分隔符
U+FEFFByte order mark  字节顺序标记
Unicode Zs category  Unicode Zs 类别Any other character in the Space Separator Unicode category空白分隔符 Unicode 类别中的任何其他字符

9Grammar  9 语法

JSON5 is defined by a lexical grammar and a syntactic grammar. The lexical grammar defines productions that translate text into tokens, and the syntactic grammar defines productions that translate tokens into a JSON5 value.JSON5 由词法语法和句法语法定义。词法语法定义了将文本转换为标记的生产,句法语法定义了将标记转换为 JSON5 值的生成。

All productions that do not begin with the characters “JSON5” are defined by productions of the ECMAScript 5.1 Lexical Grammar.所有不以“JSON5”字符开头的生产由 ECMAScript 5.1 词法语法定义。

9.1Lexical Grammar  9.1 词汇语法

The lexical grammar for JSON5 has as its terminal symbols characters (Unicode code units) that conform to the rules for JSON5SourceCharacter. It defines a set of productions, starting from the goal symbol JSON5InputElement, that describe how sequences of such characters are translated into a sequence of input elements.JSON5 的词法语法以其终端符号为符合 JSON5SourceCharacter 规则的字符(Unicode 代码单元)。它定义了一组生产,从目标符号 JSON5InputElement 开始,描述了此类字符序列如何转换为输入元素序列。

Input elements other than white space and comments form the terminal symbols for the syntactic grammar for JSON5 and are called tokens. These tokens are the identifiers, literals, and punctuators of the JSON5 language. Simple white space and comments are discarded and do not appear in the stream of input elements for the syntactic grammar.输入元素(除了空白和注释)构成了 JSON5 语法中的终结符号,被称为标记。这些标记是 JSON5 语言的标识符、字面量和标点符号。简单的空白和注释将被丢弃,不会出现在输入元素的语法流中。

Productions of the lexical grammar are distinguished by having two colons “::” as separating punctuation.词法语法的产生式通过两个冒号“::”作为分隔标点来区分。

JSON5SourceCharacter::SourceCharacterJSON5InputElement::  JSON5 输入元素::WhiteSpace  空白字符LineTerminator  行终止符Comment  注释JSON5Token  JSON5 令牌JSON5Token::  JSON5 令牌::JSON5Identifier  JSON5 标识符JSON5Punctuator  JSON5 标点符号JSON5String  JSON5 字符串JSON5Number  JSON5 数字JSON5Identifier::  JSON5 标识符::IdentifierName  标识符名称JSON5Punctuator::one of  JSON5 分号符::之一{}[]:,  空集合符号JSON5Null::  JSON5 空值NullLiteral  空字面量JSON5Boolean::  JSON5 布尔值::BooleanLiteral  布尔字面量JSON5String::  JSON5 字符串::“JSON5DoubleStringCharactersopt”" JSON5 双引号字符串字符可选"‘JSON5SingleStringCharactersopt’'JSON5 单引号字符串字符 opt’JSON5DoubleStringCharacters::'JSON5 双引号字符串字符::'JSON5DoubleStringCharacterJSON5DoubleStringCharactersopt’JSON5 双引号字符串字符 JSON5 双引号字符串字符 opt’JSON5SingleStringCharacters::'JSON5 单引号字符串字符::'JSON5SingleStringCharacterJSON5SingleStringCharactersoptJSON5 单个字符串字符 JSON5 单个字符串字符可选JSON5DoubleStringCharacter::JSON5 双引号字符串字符::SourceCharacterbut not one of " or \ or LineTerminator源字符但不是 " 或 \ 或 行终止符之一\EscapeSequence  转义序列LineContinuation  行续行符U+2028U+2029JSON5SingleStringCharacter::JSON5 单字符串字符::SourceCharacterbut not one of ’ or \ or LineTerminator源字符,但不是 ’ 或 \ 或 行终止符之一\EscapeSequence  转义序列LineContinuation  行续行符U+2028U+2029JSON5Number::  JSON5 数字::JSON5NumericLiteral+JSON5NumericLiteral-JSON5NumericLiteral  JSON5 数值字面量JSON5NumericLiteral::  JSON5 数值字面量::NumericLiteral  数字字面量Infinity  无穷大NaN  非数字# 9.2Syntactic Grammar  9.2 句法语法

The syntactic grammar for JSON5 has tokens defined by the lexical grammar as its terminal symbols. It defines a set of productions, starting from the goal symbol JSON5Text, that describe how sequences of tokens can form syntactically correct JSON5 values.JSON5 的语法语法由词法语法定义的词素作为其终端符号。它定义了一组从目标符号 JSON5Text 开始的产生式,描述了如何将词素的序列形成语法正确的 JSON5 值。

When a stream of characters is to be parsed as a JSON5 value, it is first converted to a stream of input elements by repeated application of the lexical grammar; this stream of input elements is then parsed by a single application of the syntactic grammar. The program is syntactically in error if the tokens in the stream of input elements cannot be parsed as a single instance of the goal nonterminal JSON5Text, with no tokens left over.当一个字符流被解析为 JSON5 值时,它首先通过重复应用词法语法被转换为输入元素流;然后通过单次应用语法语法来解析这个输入元素流。如果输入元素流中的词素不能被解析为目标非终结符 JSON5Text 的单个实例,且没有剩余的词素,则程序在语法上是错误的。

Productions of the syntactic grammar are distinguished by having just one colon “:” as punctuation.语法句子的生产以只有一个冒号“:”作为标点符号为特征。

JSON5Text:  JSON5 文本:JSON5Value  JSON5 值JSON5Value:  JSON5 值:JSON5Null  JSON5 空值JSON5Boolean  JSON5 布尔值JSON5String  JSON5 字符串JSON5Number  JSON5 数字JSON5Object  JSON5 对象JSON5Array  JSON5 数组JSON5Object:  JSON5 对象:{}{JSON5MemberList,opt}  { JSON5 成员列表, 选择}JSON5MemberList:  JSON5 成员列表:JSON5Member  JSON5 成员JSON5MemberList,JSON5MemberJSON5 成员列表, JSON5 成员JSON5Member:  JSON5 成员:JSON5MemberName:JSON5ValueJSON5 成员名称: JSON5 值JSON5MemberName:  JSON5 成员名称:JSON5Identifier  JSON5 标识符JSON5String  JSON5 字符串JSON5Array:  JSON5 数组:[][JSON5ElementList,opt]  [ JSON5 元素列表, 可选 ]JSON5ElementList:  JSON5 元素列表:JSON5Value  JSON5 值JSON5ElementList,JSON5ValueJSON5 元素列表,JSON5 值# 10Parsers  10 个解析器

A JSON5 parser transforms a JSON5 text into another representation. A JSON5 parser must accept all texts that conform to the JSON5 grammar. A JSON5 parser may accept non-JSON5 forms or extensions.JSON5 解析器将 JSON5 文本转换为另一种表示形式。JSON5 解析器必须接受所有符合 JSON5 语法的文本。JSON5 解析器可以接受非 JSON5 形式或扩展。

An implementation may set limits on the size of texts that it accepts, the maximum depth of nesting, the range and precision of numbers, and the length and character contents of strings.实现可以对其接受的文本大小、最大嵌套深度、数字的范围和精度以及字符串的长度和字符内容设置限制。

11Generators  11 生成器

A JSON5 generator produces JSON5 text. The resulting text must strictly conform to the JSON5 grammar.JSON5 生成器生成 JSON5 文本。生成的文本必须严格符合 JSON5 语法。

AConformance  A 一致性

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119. However, for readability, these words do not appear in all uppercase letters in this specification.本文档中的关键词“必须”、“禁止”、“必需”、“应当”、“不应该”、“推荐”、“允许”和“可选”应按照 RFC 2119 进行解释。然而,为了可读性,这些词在本规范中并不全部使用大写字母。

All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes.本规范的所有文本都是规范性文本,除非明确标记为非规范性文本、示例和注释。

Examples in this specification are introduced with the words “for example” or are set apart from the normative text like this:本规范中的示例以“例如”等词语引入,或像这样与规范性文本区分开来:

Example (Informative)  示例(信息性)

This is an example of an informative example.这是一个信息性示例的例子。

Informative notes begin with the word “Note” and are set apart from the normative text like this:信息性注释以“注意”一词开头,并像这样与规范性文本区分开来:

Note  注意This is an informative note.这是一个信息性笔记。

BLicense  B 许可证

The MIT License (MIT)

Copyright © 2017 Aseem Kishore, Jordan Tucker版权所有 © 2017 阿西姆·基肖尔,乔丹·塔克

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:以下条件为准,特此免费授予任何获得本软件及其相关文档副本(以下简称“软件”)的人士,在软件中不受限制地处理软件的权利,包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或销售软件副本,并允许向软件提供者提供软件的人士进行此类操作:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.上述版权声明和本许可声明应包含在软件的所有副本或主要部分中。

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.软件按“原样”提供,不提供任何形式的保证,无论是明示的、暗示的,还是关于适销性、特定用途适用性或非侵权的保证。在任何情况下,作者或版权所有者不对任何索赔、损害或其他责任负责,无论这些责任是因合同、侵权或其他原因引起的,无论这些责任是否与软件或其使用或其他方式有关。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2323865.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

附录C SLAC匹配过程命令定义与实际抓包

附录C SLAC匹配过程命令定义与实际抓包 ISO15118-3 附录A中规定了SLAC匹配过程中的请求命令及应答, 本文将会对比协议中的定义和实际抓包内容,以便读者获得直观的认识。 1 CM_SET_KEY.REQ 定义内容: 实际数据: 注意报文中的 08…

【QT】新建QT工程(详细步骤)

新建QT工程 1.方法(1)点击new project按钮,弹出对话框,新建即可,步骤如下:(2) 点击文件菜单,选择新建文件或者工程,后续步骤如上 2.QT工程文件介绍(1).pro文件 --》QT工程配置文件(2)main.cpp --》QT工程主…

安装Webpack并创建vue项目

1、新建一个工程目录 在E盘中进行新建项目 2、从命令行进入该目录,并执行NPM 的初始化命令 3、会看到目录中生成了一个“package.json”文件,它相当于NPM项目的说明书,里面记录了项目名称、版本、仓库地址等信息。 4、执行安装 Webpack 的命令 npm install webpac…

如何快速解决django存储session变量时出现的django.db.utils.DatabaseError错误

我们在学习django进行web编程的时候,有时需要将一些全局变量信息存储在session中,但使用过程中,却发现会引起数据库的报错。通过查看django源码信息,发现其对session信息进行了ORM映射,如果数据库中不存在对应的表信息…

04 单目标定实战示例

看文本文,您将获得以下技能: 1:使用opencv进行相机单目标定实战 2:标定结果参数含义和数值分析 3:Python绘制各标定板姿态,查看图像采集多样性 4:如果相机画幅旋转90,标定输入参数该如何设置? 5:图像尺寸缩放,标定结果输出有何影响? 6:单目标定结果应用类别…

极速全场景 MPP数据库starrocks介绍

目录 一、引子 二、起源 (一)前身 (二)定位 三、特点 (一)高性能架构 (二)实时分析 (三)高并发与扩展性 (四)兼容性与生态 …

RS232转Profinet网关技术,检漏仪新篇章!

RS232转Profinet网关技术,检漏仪新篇章! 在现代医疗监控系统中,RS232转PROFINET网关扮演着至关重要的角色。这种转换设备能够将传统的RS232串行通讯接口无缝转换为PROFINET以太网通信接口,确保老旧设备与现代自动化系统之间的顺畅…

Linux操作系统7- 线程同步与互斥7(RingQueue环形队列生产者消费者模型改进)

上篇文章:Linux操作系统7- 线程同步与互斥6(POSIX信号量与环形队列生产者消费者模型)-CSDN博客 本篇代码仓库:myLerningCode/l36 橘子真甜/Linux操作系统与网络编程学习 - 码云 - 开源中国 (gitee.com) 目录 一. 单生产单消费单保…

将 Markdown 表格结构转换为Excel 文件

在数据管理和文档编写过程中,我们经常使用 Markdown 来记录表格数据。然而,Markdown 格式的表格在实际应用中不如 Excel 方便,特别是需要进一步处理数据时。因此,我们开发了一个使用 wxPython 的 GUI 工具,将 Markdown…

微信小程序逆向开发

一.wxapkg文件 如何查看微信小程序包文件: 回退一级 点击进入这个目录 这个就是我们小程序对应的文件 .wxapkg概述 .wxapkg是微信小程序的包文件格式,且其具有独特的结构和加密方式。它不仅包含了小程序的源代码,还包括了图像和其他资源文…

Spring Data审计利器:@LastModifiedDate详解!!!

🕒 Spring Data审计利器:LastModifiedDate详解🔥 🌟 简介 在数据驱动的应用中,记录数据的最后修改时间是常见需求。Spring Data的LastModifiedDate注解让这一过程自动化成为可能!本篇带你掌握它的核心用法…

wms窗口/多窗口/自由窗口systemui侧边栏手势退出实战-学员作业

背景: 再学习了马哥的分屏自由窗口专题课程时候,有一个需求就是实现自由窗口置顶的功能,这个需求实现后,自由窗口就会一直处于顶端,不会因为打开其他Activity导致自由窗口退出。 不会因为打开了其他Activity而导致短…

服装零售行业数据分析方案

在数据洪流的时代,大数据分析已成为服装产业的强大引擎,助力企业飞速提升运营效率,削减成本,并优化资源配置。在服饰行业的生产运营链中,商业智能(BI)工具扮演着至关重要的角色,它们…

基于大模型的pc版语音对话问答

Vosk基础知识: Vosk 是一个强大的开源语音识别工具包,以下是对它的详细介绍: 特点 离线识别:Vosk 的显著特点是支持离线语音识别。这意味着在没有网络连接的情况下,也能进行语音识别操作,避免了因网络问…

深入理解 Linux 内核中的 GPU 子系统:从 DRM 到 NXP 驱动架构全解读

本文不仅为 GPU 子系统的深入复习笔记,更是一本面向 Linux 内核开发者、嵌入式图形系统开发人员的实践指南。本文围绕 drivers/gpu 展开,特别聚焦 NXP i.MX 系列平台的 GPU 架构和 Linux-imx 的实现方式,内容超 5000 字,适合收藏学…

Allegro界面颜色改变设置

概述:本文主要讲解如何改变allegro的背景颜色,改为自己喜欢的颜色 1、 打开Allegro文件 2、 Setup—User Preference—UI—General—Allegro_theme选择Light即可 改变前 改变后

ThreadLocal与Cookie + Session?

这篇文章主要在做 Echo 社区项目的时候写的,在保持用户登录态的这个需求下,为啥要用 ThreadLocal 存储用户信息,而不是采用常见的 Cookie Session。 Cookie Session 由于 HTTP 协议是无状态的,完成操作关闭浏览器后,…

【算法】二分查找(下)

一、山峰数组的峰顶索引 题目链接:852. 山脉数组的峰顶索引 - 力扣(LeetCode) 题目描述: 给定一个长度为 n 的整数 山脉 数组 arr ,其中的值递增到一个 峰值元素 然后递减。 返回峰值元素的下标。 你必须设计并实现时…

【动手学深度学习】#6 卷积神经网络

主要参考学习资料: 《动手学深度学习》阿斯顿张 等 著 【动手学深度学习 PyTorch版】哔哩哔哩跟李牧学AI 由于本系列一开始跳过了第一章引言部分,因此系列编号比书本章节编号提前。现改为和书本统一(因为之前自己的原始笔记也是按照书本章节编…

认识一家公司:瑞芯微(Rockchip Electronics Co., Ltd.)以及旗下的两款芯片RK3288\RK3588

瑞芯微(Rockchip Electronics Co., Ltd.)简介 一、公司概况 瑞芯微电子股份有限公司(简称“瑞芯微”)成立于2001年,总部位于中国福建省福州市,是一家专注于集成电路设计与研发的高新技术企业。公司采用Fa…