From 7df9880bf8f9836929d3d4623e5d4ac9f00a7829 Mon Sep 17 00:00:00 2001 From: Ika Date: Mon, 29 Jun 2020 00:08:52 +0800 Subject: [PATCH] feat: upgrade to TOML spec v1.0.0-rc.1 (#11) * chore: add toml-spec * feat: upgrade to TOML spec v1.0.0-rc.1 * fix: accurate position for multiline string end --- README.md | 2 +- corpus/custom.txt | 1 - corpus/spec.txt | 487 +++++++++++-- grammar.js | 30 +- src/grammar.json | 69 +- src/parser.c | 1692 ++++++++++++++++++++++----------------------- src/scanner.c | 69 +- toml-spec/spec.md | 1031 +++++++++++++++++++++++++++ 8 files changed, 2424 insertions(+), 957 deletions(-) create mode 100644 toml-spec/spec.md diff --git a/README.md b/README.md index fc2da02..917087f 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![npm](https://img.shields.io/npm/v/tree-sitter-toml.svg)](https://www.npmjs.com/package/tree-sitter-toml) [![build](https://img.shields.io/travis/com/ikatyang/tree-sitter-toml/master.svg)](https://travis-ci.com/ikatyang/tree-sitter-toml/builds) -TOML ([TOML Spec v0.5.0](https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.5.0.md)) grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter) +TOML ([TOML Spec v1.0.0-rc.1](https://github.com/toml-lang/toml/blob/v1.0.0-rc.1/versions/en/toml-v1.0.0-rc.1.md)) grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter) [Changelog](https://github.com/ikatyang/tree-sitter-toml/blob/master/CHANGELOG.md) diff --git a/corpus/custom.txt b/corpus/custom.txt index fccf2af..3efce03 100644 --- a/corpus/custom.txt +++ b/corpus/custom.txt @@ -166,7 +166,6 @@ key (document (ERROR - (key) (key))) ================================================================================ diff --git a/corpus/spec.txt b/corpus/spec.txt index 2265d6a..6543ffc 100644 --- a/corpus/spec.txt +++ b/corpus/spec.txt @@ -40,6 +40,24 @@ key = # INVALID (key) (comment))) +================================================================================ +INVALID - key/value pair - no newline between pairs +================================================================================ + +first = "Tom" last = "Preston-Werner" # INVALID + +-------------------------------------------------------------------------------- + +(document + (pair + (key) + (string) + (MISSING _line_ending_or_eof)) + (pair + (key) + (string) + (comment))) + ================================================================================ VALID - keys - bare keys ================================================================================ @@ -173,19 +191,24 @@ name = "Pradyun" VALID - keys - directly defined nested keys ================================================================================ -a.b.c = 1 -a.d = 2 +# This makes the key "fruit" into a table. +fruit.apple.smooth = true + +# So then you can add to the table "fruit" like so: +fruit.orange = 2 -------------------------------------------------------------------------------- (document + (comment) (pair (dotted_key (dotted_key (key) (key)) (key)) - (integer)) + (boolean)) + (comment) (pair (dotted_key (key) @@ -196,9 +219,59 @@ a.d = 2 VALID - keys - overlapped keys (semantically INVALID) ================================================================================ -# THIS IS INVALID -a.b = 1 -a.b.c = 2 +# THE FOLLOWING IS INVALID + +# This defines the value of fruit.apple to be an integer. +fruit.apple = 1 + +# But then this treats fruit.apple like it's a table. +# You can't turn an integer into a table. +fruit.apple.smooth = true + +-------------------------------------------------------------------------------- + +(document + (comment) + (comment) + (pair + (dotted_key + (key) + (key)) + (integer)) + (comment) + (comment) + (pair + (dotted_key + (dotted_key + (key) + (key)) + (key)) + (boolean))) + +================================================================================ +VALID - keys - order +================================================================================ + +# VALID BUT DISCOURAGED + +apple.type = "fruit" +orange.type = "fruit" + +apple.skin = "thin" +orange.skin = "thick" + +apple.color = "red" +orange.color = "orange" + +# RECOMMENDED + +apple.type = "fruit" +apple.skin = "thin" +apple.color = "red" + +orange.type = "fruit" +orange.skin = "thick" +orange.color = "orange" -------------------------------------------------------------------------------- @@ -208,14 +281,63 @@ a.b.c = 2 (dotted_key (key) (key)) - (integer)) + (string)) (pair (dotted_key - (dotted_key - (key) - (key)) + (key) (key)) - (integer))) + (string)) + (pair + (dotted_key + (key) + (key)) + (string)) + (pair + (dotted_key + (key) + (key)) + (string)) + (pair + (dotted_key + (key) + (key)) + (string)) + (pair + (dotted_key + (key) + (key)) + (string)) + (comment) + (pair + (dotted_key + (key) + (key)) + (string)) + (pair + (dotted_key + (key) + (key)) + (string)) + (pair + (dotted_key + (key) + (key)) + (string)) + (pair + (dotted_key + (key) + (key)) + (string)) + (pair + (dotted_key + (key) + (key)) + (string)) + (pair + (dotted_key + (key) + (key)) + (string))) ================================================================================ VALID - string - basic strings @@ -291,6 +413,42 @@ str3 = """\ (escape_sequence) (escape_sequence)))) +================================================================================ +VALID - string - multi-line basic strings with double quotes +================================================================================ + +str4 = """Here are two quotation marks: "". Simple enough.""" +# str5 = """Here are three quotation marks: """.""" # INVALID +str5 = """Here are three quotation marks: ""\".""" +str6 = """Here are fifteen quotation marks: ""\"""\"""\"""\"""\".""" + +# "This," she said, "is just a pointless statement." +str7 = """"This," she said, "is just a pointless statement."""" + +-------------------------------------------------------------------------------- + +(document + (pair + (key) + (string)) + (comment) + (pair + (key) + (string + (escape_sequence))) + (pair + (key) + (string + (escape_sequence) + (escape_sequence) + (escape_sequence) + (escape_sequence) + (escape_sequence))) + (comment) + (pair + (key) + (string))) + ================================================================================ VALID - string - literal strings ================================================================================ @@ -340,6 +498,33 @@ trimmed in raw strings. (key) (string))) +================================================================================ +VALID - string - multi-line literal strings with single quotes +================================================================================ + +quot15 = '''Here are fifteen quotation marks: """""""""""""""''' + +# apos15 = '''Here are fifteen apostrophes: '''''''''''''''''' # INVALID +apos15 = "Here are fifteen apostrophes: '''''''''''''''" + +# 'That's still pointless', she said. +str = ''''That's still pointless', she said.''' + +-------------------------------------------------------------------------------- + +(document + (pair + (key) + (string)) + (comment) + (pair + (key) + (string)) + (comment) + (pair + (key) + (string))) + ================================================================================ VALID - integer - signed/unsigned decimal integer ================================================================================ @@ -440,7 +625,7 @@ flt3 = -0.01 # exponent flt4 = 5e+22 -flt5 = 1e6 +flt5 = 1e06 flt6 = -2E-2 # both @@ -478,7 +663,7 @@ flt7 = 6.626e-34 VALID - float - float with underscores ================================================================================ -flt8 = 9_224_617.445_991_228_313 +flt8 = 224_617.445_991_228 -------------------------------------------------------------------------------- @@ -630,16 +815,21 @@ lt2 = 00:32:00.999999 (local_time))) ================================================================================ -VALID - array - basic (semantically INVALID for children with mixed types) +VALID - array - basic ================================================================================ -arr1 = [ 1, 2, 3 ] -arr2 = [ "red", "yellow", "green" ] -arr3 = [ [ 1, 2 ], [3, 4, 5] ] -arr4 = [ "all", 'strings', """are the same""", '''type'''] -arr5 = [ [ 1, 2 ], ["a", "b", "c"] ] +integers = [ 1, 2, 3 ] +colors = [ "red", "yellow", "green" ] +nested_array_of_int = [ [ 1, 2 ], [3, 4, 5] ] +nested_mixed_array = [ [ 1, 2 ], ["a", "b", "c"] ] +string_array = [ "all", 'strings', """are the same""", '''type''' ] -arr6 = [ 1, 2.0 ] # INVALID +# Mixed-type arrays are allowed +numbers = [ 0.1, 0.2, 0.5, 1, 2, 5 ] +contributors = [ + "Foo Bar ", + { name = "Baz Qux", email = "bazqux@example.com", url = "https://example.com/bazqux" } +] -------------------------------------------------------------------------------- @@ -666,13 +856,6 @@ arr6 = [ 1, 2.0 ] # INVALID (integer) (integer) (integer)))) - (pair - (key) - (array - (string) - (string) - (string) - (string))) (pair (key) (array @@ -686,19 +869,44 @@ arr6 = [ 1, 2.0 ] # INVALID (pair (key) (array + (string) + (string) + (string) + (string))) + (comment) + (pair + (key) + (array + (float) + (float) + (float) (integer) - (float)) - (comment))) + (integer) + (integer))) + (pair + (key) + (array + (string) + (inline_table + (pair + (key) + (string)) + (pair + (key) + (string)) + (pair + (key) + (string)))))) ================================================================================ VALID - array - allow newlines ================================================================================ -arr7 = [ +integers2 = [ 1, 2, 3 ] -arr8 = [ +integers3 = [ 1, 2, # this is ok ] @@ -833,6 +1041,8 @@ VALID - table - directly defined nested header key # [x.y.z] need these [x.y.z.w] # for this to work +[x] # defining a super-table afterwards is ok + -------------------------------------------------------------------------------- (document @@ -847,6 +1057,9 @@ VALID - table - directly defined nested header key (key)) (key)) (key)) + (comment)) + (table + (key) (comment))) ================================================================================ @@ -855,11 +1068,11 @@ VALID - table - duplicate header key (semantically INVALID) # DO NOT DO THIS -[a] -b = 1 +[fruit] +apple = "red" -[a] -c = 2 +[fruit] +orange = "orange" -------------------------------------------------------------------------------- @@ -869,12 +1082,12 @@ c = 2 (key) (pair (key) - (integer))) + (string))) (table (key) (pair (key) - (integer)))) + (string)))) ================================================================================ VALID - table - overlapped header key (semantically INVALID) @@ -882,11 +1095,11 @@ VALID - table - overlapped header key (semantically INVALID) # DO NOT DO THIS EITHER -[a] -b = 1 +[fruit] +apple = "red" -[a.b] -c = 2 +[fruit.apple] +texture = "smooth" -------------------------------------------------------------------------------- @@ -896,14 +1109,98 @@ c = 2 (key) (pair (key) - (integer))) + (string))) (table (dotted_key (key) (key)) (pair (key) - (integer)))) + (string)))) + +================================================================================ +VALID - table - order +================================================================================ + +# VALID BUT DISCOURAGED +[fruit.apple] +[animal] +[fruit.orange] + +# RECOMMENDED +[fruit.apple] +[fruit.orange] +[animal] + +-------------------------------------------------------------------------------- + +(document + (comment) + (table + (dotted_key + (key) + (key))) + (table + (key)) + (table + (dotted_key + (key) + (key)) + (comment)) + (table + (dotted_key + (key) + (key))) + (table + (dotted_key + (key) + (key))) + (table + (key))) + +================================================================================ +VALID - table - sub-table +================================================================================ + +[fruit] +apple.color = "red" +apple.taste.sweet = true + +# [fruit.apple] # INVALID +# [fruit.apple.taste] # INVALID + +[fruit.apple.texture] # you can add sub-tables +smooth = true + +-------------------------------------------------------------------------------- + +(document + (table + (key) + (pair + (dotted_key + (key) + (key)) + (string)) + (pair + (dotted_key + (dotted_key + (key) + (key)) + (key)) + (boolean)) + (comment) + (comment)) + (table + (dotted_key + (dotted_key + (key) + (key)) + (key)) + (comment) + (pair + (key) + (boolean)))) ================================================================================ VALID - inline table - basic @@ -943,6 +1240,39 @@ animal = { type.name = "pug" } (key)) (string))))) +================================================================================ +VALID - inline table - overlapped key (semantically INVALID) +================================================================================ + +[product] +type = { name = "Nail" } +# type.edible = false # INVALID + +[product] +type.name = "Nail" +# type = { edible = false } # INVALID + +-------------------------------------------------------------------------------- + +(document + (table + (key) + (pair + (key) + (inline_table + (pair + (key) + (string)))) + (comment)) + (table + (key) + (pair + (dotted_key + (key) + (key)) + (string)) + (comment))) + ================================================================================ VALID - array of tables - basic ================================================================================ @@ -956,6 +1286,7 @@ sku = 738594937 [[products]] name = "Nail" sku = 284758393 + color = "gray" -------------------------------------------------------------------------------- @@ -990,11 +1321,11 @@ VALID - array of tables - nested arrays of tables [[fruit]] name = "apple" - [fruit.physical] + [fruit.physical] # subtable color = "red" shape = "round" - [[fruit.variety]] + [[fruit.variety]] # nested array of tables name = "red delicious" [[fruit.variety]] @@ -1018,6 +1349,7 @@ VALID - array of tables - nested arrays of tables (dotted_key (key) (key)) + (comment) (pair (key) (string)) @@ -1028,6 +1360,7 @@ VALID - array of tables - nested arrays of tables (dotted_key (key) (key)) + (comment) (pair (key) (string))) @@ -1051,6 +1384,42 @@ VALID - array of tables - nested arrays of tables (key) (string)))) +================================================================================ +VALID - array of tables - append to array in undefined table (semantically INVALID) +================================================================================ + +# INVALID TOML DOC +[fruit.physical] # subtable, but to which parent element should it belong? + color = "red" + shape = "round" + +[[fruit]] # parser must throw an error upon discovering that "fruit" is + # an array rather than a table + name = "apple" + +-------------------------------------------------------------------------------- + +(document + (comment) + (table + (dotted_key + (key) + (key)) + (comment) + (pair + (key) + (string)) + (pair + (key) + (string))) + (table_array_element + (key) + (comment) + (comment) + (pair + (key) + (string)))) + ================================================================================ VALID - array of tables - append to statically defined array (semantically INVALID) ================================================================================ @@ -1082,10 +1451,18 @@ VALID - array of tables - append to table (semantically INVALID) [[fruit.variety]] name = "red delicious" - # This table conflicts with the previous table + # INVALID: This table conflicts with the previous array of tables [fruit.variety] name = "granny smith" + [fruit.physical] + color = "red" + shape = "round" + + # INVALID: This array of tables conflicts with the previous table + [[fruit.physical]] + color = "green" + -------------------------------------------------------------------------------- (document @@ -1104,6 +1481,24 @@ VALID - array of tables - append to table (semantically INVALID) (string)) (comment)) (table + (dotted_key + (key) + (key)) + (pair + (key) + (string))) + (table + (dotted_key + (key) + (key)) + (pair + (key) + (string)) + (pair + (key) + (string)) + (comment)) + (table_array_element (dotted_key (key) (key)) diff --git a/grammar.js b/grammar.js index 9f291bf..cb431c0 100644 --- a/grammar.js +++ b/grammar.js @@ -7,11 +7,12 @@ const control_chars = new Charset([0x0, 0x1f], 0x7f); const newline = /\r?\n/; const decimal_integer = /[+-]?(0|[1-9](_?[0-9])*)/; +const decimal_integer_in_float_exponent_part = /[+-]?[0-9](_?[0-9])*/; // allow leading zeros const hexadecimal_integer = /0x[0-9a-fA-F](_?[0-9a-fA-F])*/; const octal_integer = /0o[0-7](_?[0-7])*/; const binary_integer = /0b[01](_?[01])*/; const float_fractional_part = /[.][0-9](_?[0-9])*/; -const float_exponent_part = seq(/[eE]/, decimal_integer); +const float_exponent_part = seq(/[eE]/, decimal_integer_in_float_exponent_part); const rfc3339_date = /([0-9]+)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])/; const rfc3339_delimiter = /[ tT]/; @@ -21,7 +22,13 @@ const rfc3339_offset = /([zZ])|([+-]([01][0-9]|2[0-3]):[0-5][0-9])/; module.exports = grammar({ name: "toml", - externals: $ => [$._line_ending_or_eof], + externals: $ => [ + $._line_ending_or_eof, + $._multiline_basic_string_content, + $._multiline_basic_string_end, + $._multiline_literal_string_content, + $._multiline_literal_string_end, + ], extras: $ => [$.comment, /[ \t]/], @@ -32,7 +39,8 @@ module.exports = grammar({ repeat(choice($.table, $.table_array_element)), ), - comment: $ => /#.*/, + comment: $ => + token(seq("#", repeat(getInverseRegex(control_chars.subtract("\t"))))), table: $ => seq( @@ -87,7 +95,9 @@ module.exports = grammar({ repeat( choice( token.immediate( - repeat1(getInverseRegex(control_chars.union('"', "\\"))), + repeat1( + getInverseRegex(control_chars.subtract("\t").union('"', "\\")), + ), ), $.escape_sequence, ), @@ -100,15 +110,17 @@ module.exports = grammar({ repeat( choice( token.immediate( - repeat1(getInverseRegex(control_chars.union('"', "\\"))), + repeat1( + getInverseRegex(control_chars.subtract("\t").union('"', "\\")), + ), ), - token.immediate(/"{1,2}/), + $._multiline_basic_string_content, token.immediate(newline), $.escape_sequence, alias($._escape_line_ending, $.escape_sequence), ), ), - token.immediate('"""'), + $._multiline_basic_string_end, ), escape_sequence: $ => token.immediate(/\\([btnfr"\\]|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})/), @@ -131,11 +143,11 @@ module.exports = grammar({ token.immediate( repeat1(getInverseRegex(control_chars.union("'").subtract("\t"))), ), - token.immediate(/'{1,2}/), + $._multiline_literal_string_content, token.immediate(newline), ), ), - token.immediate("'''"), + $._multiline_literal_string_end, ), integer: $ => diff --git a/src/grammar.json b/src/grammar.json index 0930b43..35242d6 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -39,8 +39,23 @@ ] }, "comment": { - "type": "PATTERN", - "value": "#.*" + "type": "TOKEN", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "#" + }, + { + "type": "REPEAT", + "content": { + "type": "PATTERN", + "value": "[^\\u0000-\\u0008\\u000a-\\u001f\\u007f]" + } + } + ] + } }, "table": { "type": "SEQ", @@ -313,7 +328,7 @@ "type": "REPEAT1", "content": { "type": "PATTERN", - "value": "[^\\u0000-\\u001f\\u0022\\u005c\\u007f]" + "value": "[^\\u0000-\\u0008\\u000a-\\u001f\\u0022\\u005c\\u007f]" } } }, @@ -351,16 +366,13 @@ "type": "REPEAT1", "content": { "type": "PATTERN", - "value": "[^\\u0000-\\u001f\\u0022\\u005c\\u007f]" + "value": "[^\\u0000-\\u0008\\u000a-\\u001f\\u0022\\u005c\\u007f]" } } }, { - "type": "IMMEDIATE_TOKEN", - "content": { - "type": "PATTERN", - "value": "\"{1,2}" - } + "type": "SYMBOL", + "name": "_multiline_basic_string_content" }, { "type": "IMMEDIATE_TOKEN", @@ -386,11 +398,8 @@ } }, { - "type": "IMMEDIATE_TOKEN", - "content": { - "type": "STRING", - "value": "\"\"\"" - } + "type": "SYMBOL", + "name": "_multiline_basic_string_end" } ] }, @@ -474,11 +483,8 @@ } }, { - "type": "IMMEDIATE_TOKEN", - "content": { - "type": "PATTERN", - "value": "'{1,2}" - } + "type": "SYMBOL", + "name": "_multiline_literal_string_content" }, { "type": "IMMEDIATE_TOKEN", @@ -491,11 +497,8 @@ } }, { - "type": "IMMEDIATE_TOKEN", - "content": { - "type": "STRING", - "value": "'''" - } + "type": "SYMBOL", + "name": "_multiline_literal_string_end" } ] }, @@ -563,7 +566,7 @@ }, { "type": "PATTERN", - "value": "[+-]?(0|[1-9](_?[0-9])*)" + "value": "[+-]?[0-9](_?[0-9])*" } ] } @@ -806,6 +809,22 @@ { "type": "SYMBOL", "name": "_line_ending_or_eof" + }, + { + "type": "SYMBOL", + "name": "_multiline_basic_string_content" + }, + { + "type": "SYMBOL", + "name": "_multiline_basic_string_end" + }, + { + "type": "SYMBOL", + "name": "_multiline_literal_string_content" + }, + { + "type": "SYMBOL", + "name": "_multiline_literal_string_end" } ], "inline": [], diff --git a/src/parser.c b/src/parser.c index cdd4ac1..bf9f5d2 100644 --- a/src/parser.c +++ b/src/parser.c @@ -11,7 +11,7 @@ #define SYMBOL_COUNT 66 #define ALIAS_COUNT 0 #define TOKEN_COUNT 40 -#define EXTERNAL_TOKEN_COUNT 1 +#define EXTERNAL_TOKEN_COUNT 5 #define FIELD_COUNT 0 #define MAX_ALIAS_SEQUENCE_LENGTH 8 @@ -30,31 +30,31 @@ enum { anon_sym_DQUOTE2 = 12, anon_sym_DQUOTE_DQUOTE_DQUOTE = 13, aux_sym__multiline_basic_string_token1 = 14, - aux_sym__multiline_basic_string_token2 = 15, - anon_sym_DQUOTE_DQUOTE_DQUOTE2 = 16, - sym_escape_sequence = 17, - sym__escape_line_ending = 18, - anon_sym_SQUOTE = 19, - aux_sym__literal_string_token1 = 20, - anon_sym_SQUOTE2 = 21, - anon_sym_SQUOTE_SQUOTE_SQUOTE = 22, - aux_sym__multiline_literal_string_token1 = 23, - anon_sym_SQUOTE_SQUOTE_SQUOTE2 = 24, - aux_sym_integer_token1 = 25, - aux_sym_integer_token2 = 26, - aux_sym_integer_token3 = 27, - aux_sym_integer_token4 = 28, - aux_sym_float_token1 = 29, - aux_sym_float_token2 = 30, - sym_boolean = 31, - sym_offset_date_time = 32, - sym_local_date_time = 33, - sym_local_date = 34, - sym_local_time = 35, - anon_sym_COMMA = 36, - anon_sym_LBRACE = 37, - anon_sym_RBRACE = 38, - sym__line_ending_or_eof = 39, + sym_escape_sequence = 15, + sym__escape_line_ending = 16, + anon_sym_SQUOTE = 17, + aux_sym__literal_string_token1 = 18, + anon_sym_SQUOTE2 = 19, + anon_sym_SQUOTE_SQUOTE_SQUOTE = 20, + aux_sym_integer_token1 = 21, + aux_sym_integer_token2 = 22, + aux_sym_integer_token3 = 23, + aux_sym_integer_token4 = 24, + aux_sym_float_token1 = 25, + aux_sym_float_token2 = 26, + sym_boolean = 27, + sym_offset_date_time = 28, + sym_local_date_time = 29, + sym_local_date = 30, + sym_local_time = 31, + anon_sym_COMMA = 32, + anon_sym_LBRACE = 33, + anon_sym_RBRACE = 34, + sym__line_ending_or_eof = 35, + sym__multiline_basic_string_content = 36, + sym__multiline_basic_string_end = 37, + sym__multiline_literal_string_content = 38, + sym__multiline_literal_string_end = 39, sym_document = 40, sym_table = 41, sym_table_array_element = 42, @@ -99,16 +99,12 @@ static const char *ts_symbol_names[] = { [anon_sym_DQUOTE2] = "\"", [anon_sym_DQUOTE_DQUOTE_DQUOTE] = "\"\"\"", [aux_sym__multiline_basic_string_token1] = "_multiline_basic_string_token1", - [aux_sym__multiline_basic_string_token2] = "_multiline_basic_string_token2", - [anon_sym_DQUOTE_DQUOTE_DQUOTE2] = "\"\"\"", [sym_escape_sequence] = "escape_sequence", [sym__escape_line_ending] = "escape_sequence", [anon_sym_SQUOTE] = "'", [aux_sym__literal_string_token1] = "_literal_string_token1", [anon_sym_SQUOTE2] = "'", [anon_sym_SQUOTE_SQUOTE_SQUOTE] = "'''", - [aux_sym__multiline_literal_string_token1] = "_multiline_literal_string_token1", - [anon_sym_SQUOTE_SQUOTE_SQUOTE2] = "'''", [aux_sym_integer_token1] = "integer_token1", [aux_sym_integer_token2] = "integer_token2", [aux_sym_integer_token3] = "integer_token3", @@ -124,6 +120,10 @@ static const char *ts_symbol_names[] = { [anon_sym_LBRACE] = "{", [anon_sym_RBRACE] = "}", [sym__line_ending_or_eof] = "_line_ending_or_eof", + [sym__multiline_basic_string_content] = "_multiline_basic_string_content", + [sym__multiline_basic_string_end] = "_multiline_basic_string_end", + [sym__multiline_literal_string_content] = "_multiline_literal_string_content", + [sym__multiline_literal_string_end] = "_multiline_literal_string_end", [sym_document] = "document", [sym_table] = "table", [sym_table_array_element] = "table_array_element", @@ -168,16 +168,12 @@ static TSSymbol ts_symbol_map[] = { [anon_sym_DQUOTE2] = anon_sym_DQUOTE, [anon_sym_DQUOTE_DQUOTE_DQUOTE] = anon_sym_DQUOTE_DQUOTE_DQUOTE, [aux_sym__multiline_basic_string_token1] = aux_sym__multiline_basic_string_token1, - [aux_sym__multiline_basic_string_token2] = aux_sym__multiline_basic_string_token2, - [anon_sym_DQUOTE_DQUOTE_DQUOTE2] = anon_sym_DQUOTE_DQUOTE_DQUOTE, [sym_escape_sequence] = sym_escape_sequence, [sym__escape_line_ending] = sym_escape_sequence, [anon_sym_SQUOTE] = anon_sym_SQUOTE, [aux_sym__literal_string_token1] = aux_sym__literal_string_token1, [anon_sym_SQUOTE2] = anon_sym_SQUOTE, [anon_sym_SQUOTE_SQUOTE_SQUOTE] = anon_sym_SQUOTE_SQUOTE_SQUOTE, - [aux_sym__multiline_literal_string_token1] = aux_sym__multiline_literal_string_token1, - [anon_sym_SQUOTE_SQUOTE_SQUOTE2] = anon_sym_SQUOTE_SQUOTE_SQUOTE, [aux_sym_integer_token1] = aux_sym_integer_token1, [aux_sym_integer_token2] = aux_sym_integer_token2, [aux_sym_integer_token3] = aux_sym_integer_token3, @@ -193,6 +189,10 @@ static TSSymbol ts_symbol_map[] = { [anon_sym_LBRACE] = anon_sym_LBRACE, [anon_sym_RBRACE] = anon_sym_RBRACE, [sym__line_ending_or_eof] = sym__line_ending_or_eof, + [sym__multiline_basic_string_content] = sym__multiline_basic_string_content, + [sym__multiline_basic_string_end] = sym__multiline_basic_string_end, + [sym__multiline_literal_string_content] = sym__multiline_literal_string_content, + [sym__multiline_literal_string_end] = sym__multiline_literal_string_end, [sym_document] = sym_document, [sym_table] = sym_table, [sym_table_array_element] = sym_table_array_element, @@ -282,14 +282,6 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = false, .named = false, }, - [aux_sym__multiline_basic_string_token2] = { - .visible = false, - .named = false, - }, - [anon_sym_DQUOTE_DQUOTE_DQUOTE2] = { - .visible = true, - .named = false, - }, [sym_escape_sequence] = { .visible = true, .named = true, @@ -314,14 +306,6 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = false, }, - [aux_sym__multiline_literal_string_token1] = { - .visible = false, - .named = false, - }, - [anon_sym_SQUOTE_SQUOTE_SQUOTE2] = { - .visible = true, - .named = false, - }, [aux_sym_integer_token1] = { .visible = false, .named = false, @@ -382,6 +366,22 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = false, .named = true, }, + [sym__multiline_basic_string_content] = { + .visible = false, + .named = true, + }, + [sym__multiline_basic_string_end] = { + .visible = false, + .named = true, + }, + [sym__multiline_literal_string_content] = { + .visible = false, + .named = true, + }, + [sym__multiline_literal_string_end] = { + .visible = false, + .named = true, + }, [sym_document] = { .visible = true, .named = true, @@ -500,363 +500,348 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { eof = lexer->eof(lexer); switch (state) { case 0: - if (eof) ADVANCE(82); - if (lookahead == '\n') ADVANCE(137); - if (lookahead == '\r') ADVANCE(3); - if (lookahead == '"') ADVANCE(133); - if (lookahead == '#') ADVANCE(84); - if (lookahead == '\'') ADVANCE(147); - if (lookahead == '+') ADVANCE(18); - if (lookahead == ',') ADVANCE(175); - if (lookahead == '-') ADVANCE(100); - if (lookahead == '.') ADVANCE(91); - if (lookahead == '0') ADVANCE(97); - if (lookahead == '1') ADVANCE(95); - if (lookahead == '2') ADVANCE(94); - if (lookahead == '=') ADVANCE(90); - if (lookahead == '[') ADVANCE(86); - if (lookahead == '\\') ADVANCE(6); - if (lookahead == ']') ADVANCE(87); - if (lookahead == 'f') ADVANCE(107); - if (lookahead == 'i') ADVANCE(113); - if (lookahead == 'n') ADVANCE(108); - if (lookahead == 't') ADVANCE(114); - if (lookahead == '{') ADVANCE(176); - if (lookahead == '}') ADVANCE(177); + if (eof) ADVANCE(77); + if (lookahead == '\n') ADVANCE(130); + if (lookahead == '\r') ADVANCE(1); + if (lookahead == '"') ADVANCE(128); + if (lookahead == '#') ADVANCE(79); + if (lookahead == '\'') ADVANCE(139); + if (lookahead == '+') ADVANCE(15); + if (lookahead == ',') ADVANCE(163); + if (lookahead == '-') ADVANCE(95); + if (lookahead == '.') ADVANCE(86); + if (lookahead == '0') ADVANCE(92); + if (lookahead == '1') ADVANCE(90); + if (lookahead == '2') ADVANCE(89); + if (lookahead == '=') ADVANCE(85); + if (lookahead == '[') ADVANCE(81); + if (lookahead == '\\') ADVANCE(5); + if (lookahead == ']') ADVANCE(82); + if (lookahead == 'f') ADVANCE(102); + if (lookahead == 'i') ADVANCE(108); + if (lookahead == 'n') ADVANCE(103); + if (lookahead == 't') ADVANCE(109); + if (lookahead == '{') ADVANCE(164); + if (lookahead == '}') ADVANCE(165); if (lookahead == '\t' || - lookahead == ' ') SKIP(80) - if (('3' <= lookahead && lookahead <= '9')) ADVANCE(96); + lookahead == ' ') SKIP(75) + if (('3' <= lookahead && lookahead <= '9')) ADVANCE(91); if (('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); case 1: - if (lookahead == '\t') SKIP(12) - if (lookahead == '\n') ADVANCE(137); - if (lookahead == '\r') ADVANCE(3); - if (lookahead == ' ') ADVANCE(129); - if (lookahead == '"') ADVANCE(136); - if (lookahead == '#') ADVANCE(130); - if (lookahead == '\\') ADVANCE(6); - if (lookahead != 0 && - (lookahead < 0 || 31 < lookahead) && - lookahead != 127) ADVANCE(131); + if (lookahead == '\n') ADVANCE(130); END_STATE(); case 2: - if (lookahead == '\t') SKIP(12) - if (lookahead == ' ') ADVANCE(129); - if (lookahead == '"') ADVANCE(132); - if (lookahead == '#') ADVANCE(130); - if (lookahead == '\\') ADVANCE(34); + if (lookahead == '\n') ADVANCE(130); + if (lookahead == '\r') ADVANCE(1); + if (lookahead == '"') ADVANCE(127); + if (lookahead == '#') ADVANCE(125); + if (lookahead == '\\') ADVANCE(5); + if (lookahead == '\t' || + lookahead == ' ') ADVANCE(124); if (lookahead != 0 && (lookahead < 0 || 31 < lookahead) && - lookahead != 127) ADVANCE(131); + lookahead != 127) ADVANCE(126); END_STATE(); case 3: - if (lookahead == '\n') ADVANCE(137); + if (lookahead == '\n') ADVANCE(130); + if (lookahead == '\r') ADVANCE(1); + if (lookahead == '#') ADVANCE(136); + if (lookahead == '\'') ADVANCE(138); + if (lookahead == '\t' || + lookahead == ' ') ADVANCE(135); + if (lookahead != 0 && + (lookahead < 0 || 31 < lookahead) && + lookahead != 127) ADVANCE(137); END_STATE(); case 4: - if (lookahead == '\n') ADVANCE(137); - if (lookahead == '\r') ADVANCE(3); - if (lookahead == '#') ADVANCE(144); - if (lookahead == '\'') ADVANCE(150); - if (lookahead == '\t' || - lookahead == ' ') ADVANCE(143); - if (lookahead != 0 && - (lookahead < 0 || 31 < lookahead) && - lookahead != 127) ADVANCE(145); + if (lookahead == '\n') ADVANCE(132); END_STATE(); case 5: - if (lookahead == '\n') ADVANCE(140); + if (lookahead == '\n') ADVANCE(132); + if (lookahead == '\r') ADVANCE(4); + if (lookahead == 'U') ADVANCE(74); + if (lookahead == 'u') ADVANCE(70); + if (lookahead == '"' || + lookahead == '\\' || + lookahead == 'b' || + lookahead == 'f' || + lookahead == 'n' || + lookahead == 'r' || + lookahead == 't') ADVANCE(131); END_STATE(); case 6: - if (lookahead == '\n') ADVANCE(140); - if (lookahead == '\r') ADVANCE(5); - if (lookahead == 'U') ADVANCE(79); - if (lookahead == 'u') ADVANCE(75); - if (lookahead == '"' || - lookahead == '\\' || - lookahead == 'b' || - lookahead == 'f' || - lookahead == 'n' || - lookahead == 'r' || - lookahead == 't') ADVANCE(139); + if (lookahead == '\n') ADVANCE(78); END_STATE(); case 7: - if (lookahead == '\n') ADVANCE(83); + if (lookahead == '\n') ADVANCE(78); + if (lookahead == '\r') ADVANCE(6); + if (lookahead == '"') ADVANCE(123); + if (lookahead == '#') ADVANCE(79); + if (lookahead == '\'') ADVANCE(134); + if (lookahead == ',') ADVANCE(163); + if (lookahead == '0') ADVANCE(146); + if (lookahead == '1') ADVANCE(144); + if (lookahead == '2') ADVANCE(143); + if (lookahead == '[') ADVANCE(80); + if (lookahead == ']') ADVANCE(82); + if (lookahead == 'f') ADVANCE(30); + if (lookahead == 'i') ADVANCE(35); + if (lookahead == 'n') ADVANCE(31); + if (lookahead == 't') ADVANCE(37); + if (lookahead == '{') ADVANCE(164); + if (lookahead == '\t' || + lookahead == ' ') SKIP(7) + if (('+' <= lookahead && lookahead <= '-')) ADVANCE(17); + if (('3' <= lookahead && lookahead <= '9')) ADVANCE(145); END_STATE(); case 8: - if (lookahead == '\n') ADVANCE(83); - if (lookahead == '\r') ADVANCE(7); - if (lookahead == '"') ADVANCE(128); - if (lookahead == '#') ADVANCE(84); - if (lookahead == '\'') ADVANCE(142); - if (lookahead == ',') ADVANCE(175); - if (lookahead == '0') ADVANCE(157); - if (lookahead == '1') ADVANCE(155); - if (lookahead == '2') ADVANCE(154); - if (lookahead == '[') ADVANCE(85); - if (lookahead == ']') ADVANCE(87); - if (lookahead == 'f') ADVANCE(36); - if (lookahead == 'i') ADVANCE(41); - if (lookahead == 'n') ADVANCE(37); - if (lookahead == 't') ADVANCE(43); - if (lookahead == '{') ADVANCE(176); - if (lookahead == '\t' || - lookahead == ' ') SKIP(8) - if (('+' <= lookahead && lookahead <= '-')) ADVANCE(20); - if (('3' <= lookahead && lookahead <= '9')) ADVANCE(156); + if (lookahead == '"') ADVANCE(129); END_STATE(); case 9: - if (lookahead == '"') ADVANCE(134); + if (lookahead == '#') ADVANCE(79); + if (lookahead == '\'') ADVANCE(138); + if (lookahead == '.') ADVANCE(86); + if (lookahead == ']') ADVANCE(29); + if (lookahead == '\t' || + lookahead == ' ') SKIP(10) END_STATE(); case 10: - if (lookahead == '#') ADVANCE(84); - if (lookahead == '\'') ADVANCE(146); - if (lookahead == '.') ADVANCE(91); - if (lookahead == ']') ADVANCE(35); + if (lookahead == '#') ADVANCE(79); + if (lookahead == '.') ADVANCE(86); + if (lookahead == ']') ADVANCE(29); if (lookahead == '\t' || - lookahead == ' ') SKIP(11) + lookahead == ' ') SKIP(10) END_STATE(); case 11: - if (lookahead == '#') ADVANCE(84); - if (lookahead == '.') ADVANCE(91); - if (lookahead == ']') ADVANCE(35); - if (lookahead == '\t' || - lookahead == ' ') SKIP(11) + if (lookahead == '\'') ADVANCE(140); END_STATE(); case 12: - if (lookahead == '#') ADVANCE(84); - if (lookahead == '\t' || - lookahead == ' ') SKIP(12) + if (lookahead == '-') ADVANCE(18); + if (lookahead == ':') ADVANCE(46); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(13); END_STATE(); case 13: - if (lookahead == '#') ADVANCE(144); - if (lookahead == '\'') ADVANCE(146); - if (lookahead == '\t' || - lookahead == ' ') ADVANCE(143); - if (lookahead != 0 && - (lookahead < 0 || 31 < lookahead) && - lookahead != 127) ADVANCE(145); + if (lookahead == '-') ADVANCE(18); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(13); END_STATE(); case 14: - if (lookahead == '\'') ADVANCE(148); + if (lookahead == '-') ADVANCE(20); END_STATE(); case 15: - if (lookahead == '-') ADVANCE(21); - if (lookahead == ':') ADVANCE(51); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(16); + if (lookahead == '0') ADVANCE(141); + if (lookahead == 'i') ADVANCE(35); + if (lookahead == 'n') ADVANCE(31); + if (('1' <= lookahead && lookahead <= '9')) ADVANCE(149); END_STATE(); case 16: - if (lookahead == '-') ADVANCE(21); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(16); + if (lookahead == '0') ADVANCE(161); END_STATE(); case 17: - if (lookahead == '-') ADVANCE(25); + if (lookahead == '0') ADVANCE(148); + if (lookahead == 'i') ADVANCE(35); + if (lookahead == 'n') ADVANCE(31); + if (('1' <= lookahead && lookahead <= '9')) ADVANCE(147); END_STATE(); case 18: - if (lookahead == '0') ADVANCE(152); - if (lookahead == 'i') ADVANCE(41); - if (lookahead == 'n') ADVANCE(37); - if (('1' <= lookahead && lookahead <= '9')) ADVANCE(160); + if (lookahead == '0') ADVANCE(50); + if (lookahead == '1') ADVANCE(43); END_STATE(); case 19: - if (lookahead == '0') ADVANCE(173); + if (lookahead == '0') ADVANCE(158); END_STATE(); case 20: - if (lookahead == '0') ADVANCE(159); - if (lookahead == 'i') ADVANCE(41); - if (lookahead == 'n') ADVANCE(37); - if (('1' <= lookahead && lookahead <= '9')) ADVANCE(158); + if (lookahead == '0') ADVANCE(51); + if (lookahead == '3') ADVANCE(42); + if (lookahead == '1' || + lookahead == '2') ADVANCE(59); END_STATE(); case 21: - if (lookahead == '0') ADVANCE(55); - if (lookahead == '1') ADVANCE(48); + if (lookahead == '2') ADVANCE(44); + if (lookahead == '0' || + lookahead == '1') ADVANCE(63); END_STATE(); case 22: - if (lookahead == '0') ADVANCE(164); - if (lookahead == '+' || - lookahead == '-') ADVANCE(23); - if (('1' <= lookahead && lookahead <= '9')) ADVANCE(166); + if (lookahead == '2') ADVANCE(45); + if (lookahead == '0' || + lookahead == '1') ADVANCE(64); END_STATE(); case 23: - if (lookahead == '0') ADVANCE(164); - if (('1' <= lookahead && lookahead <= '9')) ADVANCE(166); + if (lookahead == '6') ADVANCE(16); + if (('0' <= lookahead && lookahead <= '5')) ADVANCE(54); END_STATE(); case 24: - if (lookahead == '0') ADVANCE(170); + if (lookahead == '6') ADVANCE(19); + if (('0' <= lookahead && lookahead <= '5')) ADVANCE(60); END_STATE(); case 25: - if (lookahead == '0') ADVANCE(56); - if (lookahead == '3') ADVANCE(47); - if (lookahead == '1' || - lookahead == '2') ADVANCE(64); + if (lookahead == ':') ADVANCE(23); END_STATE(); case 26: - if (lookahead == '2') ADVANCE(49); - if (lookahead == '0' || - lookahead == '1') ADVANCE(68); + if (lookahead == ':') ADVANCE(47); END_STATE(); case 27: - if (lookahead == '2') ADVANCE(50); - if (lookahead == '0' || - lookahead == '1') ADVANCE(69); + if (lookahead == ':') ADVANCE(24); END_STATE(); case 28: - if (lookahead == '6') ADVANCE(19); - if (('0' <= lookahead && lookahead <= '5')) ADVANCE(59); + if (lookahead == ':') ADVANCE(48); END_STATE(); case 29: - if (lookahead == '6') ADVANCE(24); - if (('0' <= lookahead && lookahead <= '5')) ADVANCE(65); + if (lookahead == ']') ADVANCE(84); END_STATE(); case 30: - if (lookahead == ':') ADVANCE(28); + if (lookahead == 'a') ADVANCE(34); END_STATE(); case 31: - if (lookahead == ':') ADVANCE(52); + if (lookahead == 'a') ADVANCE(36); END_STATE(); case 32: - if (lookahead == ':') ADVANCE(29); + if (lookahead == 'e') ADVANCE(156); END_STATE(); case 33: - if (lookahead == ':') ADVANCE(53); + if (lookahead == 'f') ADVANCE(155); END_STATE(); case 34: - if (lookahead == 'U') ADVANCE(79); - if (lookahead == 'u') ADVANCE(75); - if (lookahead == '"' || - lookahead == '\\' || - lookahead == 'b' || - lookahead == 'f' || - lookahead == 'n' || - lookahead == 'r' || - lookahead == 't') ADVANCE(139); + if (lookahead == 'l') ADVANCE(38); END_STATE(); case 35: - if (lookahead == ']') ADVANCE(89); + if (lookahead == 'n') ADVANCE(33); END_STATE(); case 36: - if (lookahead == 'a') ADVANCE(40); + if (lookahead == 'n') ADVANCE(155); END_STATE(); case 37: - if (lookahead == 'a') ADVANCE(42); + if (lookahead == 'r') ADVANCE(39); END_STATE(); case 38: - if (lookahead == 'e') ADVANCE(168); + if (lookahead == 's') ADVANCE(32); END_STATE(); case 39: - if (lookahead == 'f') ADVANCE(167); + if (lookahead == 'u') ADVANCE(32); END_STATE(); case 40: - if (lookahead == 'l') ADVANCE(44); + if (lookahead == '+' || + lookahead == '-') ADVANCE(58); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(154); END_STATE(); case 41: - if (lookahead == 'n') ADVANCE(39); + if (lookahead == '0' || + lookahead == '1') ADVANCE(152); END_STATE(); case 42: - if (lookahead == 'n') ADVANCE(167); + if (lookahead == '0' || + lookahead == '1') ADVANCE(160); END_STATE(); case 43: - if (lookahead == 'r') ADVANCE(45); + if (('0' <= lookahead && lookahead <= '2')) ADVANCE(14); END_STATE(); case 44: - if (lookahead == 's') ADVANCE(38); + if (('0' <= lookahead && lookahead <= '3')) ADVANCE(28); END_STATE(); case 45: - if (lookahead == 'u') ADVANCE(38); + if (('0' <= lookahead && lookahead <= '3')) ADVANCE(26); END_STATE(); case 46: - if (lookahead == '0' || - lookahead == '1') ADVANCE(163); + if (('0' <= lookahead && lookahead <= '5')) ADVANCE(53); END_STATE(); case 47: - if (lookahead == '0' || - lookahead == '1') ADVANCE(172); + if (('0' <= lookahead && lookahead <= '5')) ADVANCE(61); END_STATE(); case 48: - if (('0' <= lookahead && lookahead <= '2')) ADVANCE(17); + if (('0' <= lookahead && lookahead <= '5')) ADVANCE(65); END_STATE(); case 49: - if (('0' <= lookahead && lookahead <= '3')) ADVANCE(33); + if (('0' <= lookahead && lookahead <= '7')) ADVANCE(151); END_STATE(); case 50: - if (('0' <= lookahead && lookahead <= '3')) ADVANCE(31); + if (('1' <= lookahead && lookahead <= '9')) ADVANCE(14); END_STATE(); case 51: - if (('0' <= lookahead && lookahead <= '5')) ADVANCE(58); + if (('1' <= lookahead && lookahead <= '9')) ADVANCE(160); END_STATE(); case 52: - if (('0' <= lookahead && lookahead <= '5')) ADVANCE(66); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(149); END_STATE(); case 53: - if (('0' <= lookahead && lookahead <= '5')) ADVANCE(70); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(25); END_STATE(); case 54: - if (('0' <= lookahead && lookahead <= '7')) ADVANCE(162); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(161); END_STATE(); case 55: - if (('1' <= lookahead && lookahead <= '9')) ADVANCE(17); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(162); END_STATE(); case 56: - if (('1' <= lookahead && lookahead <= '9')) ADVANCE(172); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(147); END_STATE(); case 57: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(160); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(153); END_STATE(); case 58: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(30); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(154); END_STATE(); case 59: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(173); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(160); END_STATE(); case 60: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(174); - END_STATE(); - case 61: if (('0' <= lookahead && lookahead <= '9')) ADVANCE(158); END_STATE(); + case 61: + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(157); + END_STATE(); case 62: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(165); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(159); END_STATE(); case 63: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(166); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(28); END_STATE(); case 64: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(172); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(26); END_STATE(); case 65: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(170); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(27); END_STATE(); case 66: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(169); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(131); END_STATE(); case 67: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(171); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(150); END_STATE(); case 68: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(33); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(66); END_STATE(); case 69: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(31); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(68); END_STATE(); case 70: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(32); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(69); END_STATE(); case 71: if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'F') || - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(139); + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(70); END_STATE(); case 72: if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'F') || - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(161); + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(71); END_STATE(); case 73: if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'F') || - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(71); + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(72); END_STATE(); case 74: if (('0' <= lookahead && lookahead <= '9') || @@ -864,706 +849,658 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { ('a' <= lookahead && lookahead <= 'f')) ADVANCE(73); END_STATE(); case 75: - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'F') || - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(74); - END_STATE(); - case 76: - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'F') || - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(75); - END_STATE(); - case 77: - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'F') || - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(76); - END_STATE(); - case 78: - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'F') || - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(77); - END_STATE(); - case 79: - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'F') || - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(78); - END_STATE(); - case 80: - if (eof) ADVANCE(82); - if (lookahead == '\n') ADVANCE(83); - if (lookahead == '\r') ADVANCE(7); - if (lookahead == '"') ADVANCE(128); - if (lookahead == '#') ADVANCE(84); - if (lookahead == '\'') ADVANCE(142); - if (lookahead == '+') ADVANCE(18); - if (lookahead == ',') ADVANCE(175); - if (lookahead == '-') ADVANCE(100); - if (lookahead == '.') ADVANCE(91); - if (lookahead == '0') ADVANCE(97); - if (lookahead == '1') ADVANCE(95); - if (lookahead == '2') ADVANCE(94); - if (lookahead == '=') ADVANCE(90); - if (lookahead == '[') ADVANCE(86); - if (lookahead == ']') ADVANCE(87); - if (lookahead == 'f') ADVANCE(107); - if (lookahead == 'i') ADVANCE(113); - if (lookahead == 'n') ADVANCE(108); - if (lookahead == 't') ADVANCE(114); - if (lookahead == '{') ADVANCE(176); - if (lookahead == '}') ADVANCE(177); + if (eof) ADVANCE(77); + if (lookahead == '\n') ADVANCE(78); + if (lookahead == '\r') ADVANCE(6); + if (lookahead == '"') ADVANCE(123); + if (lookahead == '#') ADVANCE(79); + if (lookahead == '\'') ADVANCE(134); + if (lookahead == '+') ADVANCE(15); + if (lookahead == ',') ADVANCE(163); + if (lookahead == '-') ADVANCE(95); + if (lookahead == '.') ADVANCE(86); + if (lookahead == '0') ADVANCE(92); + if (lookahead == '1') ADVANCE(90); + if (lookahead == '2') ADVANCE(89); + if (lookahead == '=') ADVANCE(85); + if (lookahead == '[') ADVANCE(81); + if (lookahead == ']') ADVANCE(82); + if (lookahead == 'f') ADVANCE(102); + if (lookahead == 'i') ADVANCE(108); + if (lookahead == 'n') ADVANCE(103); + if (lookahead == 't') ADVANCE(109); + if (lookahead == '{') ADVANCE(164); + if (lookahead == '}') ADVANCE(165); if (lookahead == '\t' || - lookahead == ' ') SKIP(80) - if (('3' <= lookahead && lookahead <= '9')) ADVANCE(96); + lookahead == ' ') SKIP(75) + if (('3' <= lookahead && lookahead <= '9')) ADVANCE(91); if (('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); - case 81: - if (eof) ADVANCE(82); - if (lookahead == '\n') ADVANCE(83); - if (lookahead == '\r') ADVANCE(7); - if (lookahead == '"') ADVANCE(127); - if (lookahead == '#') ADVANCE(84); - if (lookahead == '\'') ADVANCE(141); - if (lookahead == ',') ADVANCE(175); - if (lookahead == '.') ADVANCE(91); - if (lookahead == '=') ADVANCE(90); - if (lookahead == '[') ADVANCE(86); - if (lookahead == ']') ADVANCE(87); - if (lookahead == '}') ADVANCE(177); + case 76: + if (eof) ADVANCE(77); + if (lookahead == '\n') ADVANCE(78); + if (lookahead == '\r') ADVANCE(6); + if (lookahead == '"') ADVANCE(122); + if (lookahead == '#') ADVANCE(79); + if (lookahead == '\'') ADVANCE(133); + if (lookahead == ',') ADVANCE(163); + if (lookahead == '.') ADVANCE(86); + if (lookahead == '=') ADVANCE(85); + if (lookahead == '[') ADVANCE(81); + if (lookahead == ']') ADVANCE(82); + if (lookahead == '}') ADVANCE(165); if (lookahead == '\t' || - lookahead == ' ') SKIP(81) + lookahead == ' ') SKIP(76) if (lookahead == '-' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); - case 82: + case 77: ACCEPT_TOKEN(ts_builtin_sym_end); END_STATE(); - case 83: + case 78: ACCEPT_TOKEN(aux_sym_document_token1); END_STATE(); - case 84: + case 79: ACCEPT_TOKEN(sym_comment); if (lookahead != 0 && - lookahead != '\n') ADVANCE(84); + (lookahead < 0 || 8 < lookahead) && + (lookahead < '\n' || 31 < lookahead) && + lookahead != 127) ADVANCE(79); END_STATE(); - case 85: + case 80: ACCEPT_TOKEN(anon_sym_LBRACK); END_STATE(); - case 86: + case 81: ACCEPT_TOKEN(anon_sym_LBRACK); - if (lookahead == '[') ADVANCE(88); + if (lookahead == '[') ADVANCE(83); END_STATE(); - case 87: + case 82: ACCEPT_TOKEN(anon_sym_RBRACK); END_STATE(); - case 88: + case 83: ACCEPT_TOKEN(anon_sym_LBRACK_LBRACK); END_STATE(); - case 89: + case 84: ACCEPT_TOKEN(anon_sym_RBRACK_RBRACK); END_STATE(); - case 90: + case 85: ACCEPT_TOKEN(anon_sym_EQ); END_STATE(); - case 91: + case 86: ACCEPT_TOKEN(anon_sym_DOT); END_STATE(); - case 92: + case 87: ACCEPT_TOKEN(sym__bare_key); - if (lookahead == '-') ADVANCE(101); - if (lookahead == ':') ADVANCE(51); - if (lookahead == '_') ADVANCE(124); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(96); + if (lookahead == '-') ADVANCE(96); + if (lookahead == ':') ADVANCE(46); + if (lookahead == '_') ADVANCE(119); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(91); if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); - case 93: + case 88: ACCEPT_TOKEN(sym__bare_key); - if (lookahead == '-') ADVANCE(101); - if (lookahead == ':') ADVANCE(51); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(98); - if (('A' <= lookahead && lookahead <= 'Z') || - lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); - END_STATE(); - case 94: - ACCEPT_TOKEN(sym__bare_key); - if (lookahead == '-') ADVANCE(101); - if (lookahead == '_') ADVANCE(124); - if (('0' <= lookahead && lookahead <= '3')) ADVANCE(92); - if (('4' <= lookahead && lookahead <= '9')) ADVANCE(96); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); - END_STATE(); - case 95: - ACCEPT_TOKEN(sym__bare_key); - if (lookahead == '-') ADVANCE(101); - if (lookahead == '_') ADVANCE(124); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(92); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); - END_STATE(); - case 96: - ACCEPT_TOKEN(sym__bare_key); - if (lookahead == '-') ADVANCE(101); - if (lookahead == '_') ADVANCE(124); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(96); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); - END_STATE(); - case 97: - ACCEPT_TOKEN(sym__bare_key); - if (lookahead == '-') ADVANCE(101); - if (lookahead == 'b') ADVANCE(118); - if (lookahead == 'o') ADVANCE(120); - if (lookahead == 'x') ADVANCE(125); + if (lookahead == '-') ADVANCE(96); + if (lookahead == ':') ADVANCE(46); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(93); if (('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); - case 98: + case 89: ACCEPT_TOKEN(sym__bare_key); - if (lookahead == '-') ADVANCE(101); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(98); + if (lookahead == '-') ADVANCE(96); + if (lookahead == '_') ADVANCE(119); + if (('0' <= lookahead && lookahead <= '3')) ADVANCE(87); + if (('4' <= lookahead && lookahead <= '9')) ADVANCE(91); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); + END_STATE(); + case 90: + ACCEPT_TOKEN(sym__bare_key); + if (lookahead == '-') ADVANCE(96); + if (lookahead == '_') ADVANCE(119); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(87); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); + END_STATE(); + case 91: + ACCEPT_TOKEN(sym__bare_key); + if (lookahead == '-') ADVANCE(96); + if (lookahead == '_') ADVANCE(119); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(91); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); + END_STATE(); + case 92: + ACCEPT_TOKEN(sym__bare_key); + if (lookahead == '-') ADVANCE(96); + if (lookahead == 'b') ADVANCE(113); + if (lookahead == 'o') ADVANCE(115); + if (lookahead == 'x') ADVANCE(120); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(88); if (('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); - case 99: + case 93: ACCEPT_TOKEN(sym__bare_key); - if (lookahead == '-') ADVANCE(102); + if (lookahead == '-') ADVANCE(96); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(93); + if (('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); + END_STATE(); + case 94: + ACCEPT_TOKEN(sym__bare_key); + if (lookahead == '-') ADVANCE(97); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); - case 100: + case 95: ACCEPT_TOKEN(sym__bare_key); - if (lookahead == '0') ADVANCE(126); - if (lookahead == 'i') ADVANCE(113); - if (lookahead == 'n') ADVANCE(108); - if (('1' <= lookahead && lookahead <= '9')) ADVANCE(106); + if (lookahead == '0') ADVANCE(121); + if (lookahead == 'i') ADVANCE(108); + if (lookahead == 'n') ADVANCE(103); + if (('1' <= lookahead && lookahead <= '9')) ADVANCE(101); if (lookahead == '-' || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); - case 101: + case 96: ACCEPT_TOKEN(sym__bare_key); - if (lookahead == '0') ADVANCE(122); - if (lookahead == '1') ADVANCE(119); + if (lookahead == '0') ADVANCE(117); + if (lookahead == '1') ADVANCE(114); if (lookahead == '-' || ('2' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); - case 102: + case 97: ACCEPT_TOKEN(sym__bare_key); - if (lookahead == '0') ADVANCE(121); - if (lookahead == '3') ADVANCE(117); + if (lookahead == '0') ADVANCE(116); + if (lookahead == '3') ADVANCE(112); if (lookahead == '1' || - lookahead == '2') ADVANCE(123); + lookahead == '2') ADVANCE(118); if (lookahead == '-' || ('4' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); - case 103: + case 98: ACCEPT_TOKEN(sym__bare_key); - if (lookahead == '_') ADVANCE(118); + if (lookahead == '_') ADVANCE(113); if (lookahead == '0' || - lookahead == '1') ADVANCE(103); + lookahead == '1') ADVANCE(98); if (lookahead == '-' || ('2' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); - case 104: + case 99: ACCEPT_TOKEN(sym__bare_key); - if (lookahead == '_') ADVANCE(120); - if (('0' <= lookahead && lookahead <= '7')) ADVANCE(104); + if (lookahead == '_') ADVANCE(115); + if (('0' <= lookahead && lookahead <= '7')) ADVANCE(99); if (lookahead == '-' || lookahead == '8' || lookahead == '9' || ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); + END_STATE(); + case 100: + ACCEPT_TOKEN(sym__bare_key); + if (lookahead == '_') ADVANCE(120); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(100); + if (lookahead == '-' || + ('G' <= lookahead && lookahead <= 'Z') || + ('g' <= lookahead && lookahead <= 'z')) ADVANCE(121); + END_STATE(); + case 101: + ACCEPT_TOKEN(sym__bare_key); + if (lookahead == '_') ADVANCE(119); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(101); + if (lookahead == '-' || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); + END_STATE(); + case 102: + ACCEPT_TOKEN(sym__bare_key); + if (lookahead == 'a') ADVANCE(106); + if (lookahead == '-' || + ('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('b' <= lookahead && lookahead <= 'z')) ADVANCE(121); + END_STATE(); + case 103: + ACCEPT_TOKEN(sym__bare_key); + if (lookahead == 'a') ADVANCE(107); + if (lookahead == '-' || + ('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('b' <= lookahead && lookahead <= 'z')) ADVANCE(121); + END_STATE(); + case 104: + ACCEPT_TOKEN(sym__bare_key); + if (lookahead == 'e') ADVANCE(121); + if (lookahead == '-' || + ('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); case 105: ACCEPT_TOKEN(sym__bare_key); - if (lookahead == '_') ADVANCE(125); - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'F') || - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(105); + if (lookahead == 'f') ADVANCE(121); if (lookahead == '-' || - ('G' <= lookahead && lookahead <= 'Z') || - ('g' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); case 106: ACCEPT_TOKEN(sym__bare_key); - if (lookahead == '_') ADVANCE(124); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(106); + if (lookahead == 'l') ADVANCE(110); if (lookahead == '-' || + ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); case 107: ACCEPT_TOKEN(sym__bare_key); - if (lookahead == 'a') ADVANCE(111); + if (lookahead == 'n') ADVANCE(121); if (lookahead == '-' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('b' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); case 108: ACCEPT_TOKEN(sym__bare_key); - if (lookahead == 'a') ADVANCE(112); + if (lookahead == 'n') ADVANCE(105); if (lookahead == '-' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('b' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); case 109: ACCEPT_TOKEN(sym__bare_key); - if (lookahead == 'e') ADVANCE(126); + if (lookahead == 'r') ADVANCE(111); if (lookahead == '-' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); case 110: ACCEPT_TOKEN(sym__bare_key); - if (lookahead == 'f') ADVANCE(126); + if (lookahead == 's') ADVANCE(104); if (lookahead == '-' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); case 111: ACCEPT_TOKEN(sym__bare_key); - if (lookahead == 'l') ADVANCE(115); + if (lookahead == 'u') ADVANCE(104); if (lookahead == '-' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); case 112: ACCEPT_TOKEN(sym__bare_key); - if (lookahead == 'n') ADVANCE(126); + if (lookahead == '0' || + lookahead == '1') ADVANCE(121); if (lookahead == '-' || - ('0' <= lookahead && lookahead <= '9') || + ('2' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); case 113: ACCEPT_TOKEN(sym__bare_key); - if (lookahead == 'n') ADVANCE(110); + if (lookahead == '0' || + lookahead == '1') ADVANCE(98); if (lookahead == '-' || - ('0' <= lookahead && lookahead <= '9') || + ('2' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); case 114: ACCEPT_TOKEN(sym__bare_key); - if (lookahead == 'r') ADVANCE(116); - if (lookahead == '-' || - ('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'Z') || - lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); - END_STATE(); - case 115: - ACCEPT_TOKEN(sym__bare_key); - if (lookahead == 's') ADVANCE(109); - if (lookahead == '-' || - ('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'Z') || - lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); - END_STATE(); - case 116: - ACCEPT_TOKEN(sym__bare_key); - if (lookahead == 'u') ADVANCE(109); - if (lookahead == '-' || - ('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'Z') || - lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); - END_STATE(); - case 117: - ACCEPT_TOKEN(sym__bare_key); - if (lookahead == '0' || - lookahead == '1') ADVANCE(126); - if (lookahead == '-' || - ('2' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'Z') || - lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); - END_STATE(); - case 118: - ACCEPT_TOKEN(sym__bare_key); - if (lookahead == '0' || - lookahead == '1') ADVANCE(103); - if (lookahead == '-' || - ('2' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'Z') || - lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); - END_STATE(); - case 119: - ACCEPT_TOKEN(sym__bare_key); - if (('0' <= lookahead && lookahead <= '2')) ADVANCE(99); + if (('0' <= lookahead && lookahead <= '2')) ADVANCE(94); if (lookahead == '-' || ('3' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); - case 120: + case 115: ACCEPT_TOKEN(sym__bare_key); - if (('0' <= lookahead && lookahead <= '7')) ADVANCE(104); + if (('0' <= lookahead && lookahead <= '7')) ADVANCE(99); if (lookahead == '-' || lookahead == '8' || lookahead == '9' || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); - case 121: + case 116: ACCEPT_TOKEN(sym__bare_key); - if (('1' <= lookahead && lookahead <= '9')) ADVANCE(126); + if (('1' <= lookahead && lookahead <= '9')) ADVANCE(121); if (lookahead == '-' || lookahead == '0' || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); - case 122: + case 117: ACCEPT_TOKEN(sym__bare_key); - if (('1' <= lookahead && lookahead <= '9')) ADVANCE(99); + if (('1' <= lookahead && lookahead <= '9')) ADVANCE(94); if (lookahead == '-' || lookahead == '0' || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); - case 123: + case 118: ACCEPT_TOKEN(sym__bare_key); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(126); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(121); if (lookahead == '-' || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); - case 124: + case 119: ACCEPT_TOKEN(sym__bare_key); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(106); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(101); if (lookahead == '-' || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); - case 125: + case 120: ACCEPT_TOKEN(sym__bare_key); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'F') || - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(105); + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(100); if (lookahead == '-' || ('G' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('g' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('g' <= lookahead && lookahead <= 'z')) ADVANCE(121); END_STATE(); - case 126: + case 121: ACCEPT_TOKEN(sym__bare_key); if (lookahead == '-' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(126); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(121); + END_STATE(); + case 122: + ACCEPT_TOKEN(anon_sym_DQUOTE); + END_STATE(); + case 123: + ACCEPT_TOKEN(anon_sym_DQUOTE); + if (lookahead == '"') ADVANCE(8); + END_STATE(); + case 124: + ACCEPT_TOKEN(aux_sym__basic_string_token1); + if (lookahead == '#') ADVANCE(125); + if (lookahead == '\t' || + lookahead == ' ') ADVANCE(124); + if (lookahead != 0 && + (lookahead < 0 || 31 < lookahead) && + lookahead != '"' && + lookahead != '\\' && + lookahead != 127) ADVANCE(126); + END_STATE(); + case 125: + ACCEPT_TOKEN(aux_sym__basic_string_token1); + if (lookahead == '"' || + lookahead == '\\') ADVANCE(79); + if (lookahead != 0 && + (lookahead < 0 || 8 < lookahead) && + (lookahead < '\n' || 31 < lookahead) && + lookahead != 127) ADVANCE(125); + END_STATE(); + case 126: + ACCEPT_TOKEN(aux_sym__basic_string_token1); + if (lookahead != 0 && + (lookahead < 0 || 8 < lookahead) && + (lookahead < '\n' || 31 < lookahead) && + lookahead != '"' && + lookahead != '\\' && + lookahead != 127) ADVANCE(126); END_STATE(); case 127: - ACCEPT_TOKEN(anon_sym_DQUOTE); + ACCEPT_TOKEN(anon_sym_DQUOTE2); END_STATE(); case 128: - ACCEPT_TOKEN(anon_sym_DQUOTE); - if (lookahead == '"') ADVANCE(9); + ACCEPT_TOKEN(anon_sym_DQUOTE2); + if (lookahead == '"') ADVANCE(8); END_STATE(); case 129: - ACCEPT_TOKEN(aux_sym__basic_string_token1); - if (lookahead == ' ') ADVANCE(129); - if (lookahead == '#') ADVANCE(130); - if (lookahead != 0 && - (lookahead < 0 || 31 < lookahead) && - lookahead != '"' && - lookahead != '\\' && - lookahead != 127) ADVANCE(131); - END_STATE(); - case 130: - ACCEPT_TOKEN(aux_sym__basic_string_token1); - if ((0 <= lookahead && lookahead <= '\t') || - (11 <= lookahead && lookahead <= 31) || - lookahead == '"' || - lookahead == '\\' || - lookahead == 127) ADVANCE(84); - if (lookahead != 0 && - lookahead != '\n') ADVANCE(130); - END_STATE(); - case 131: - ACCEPT_TOKEN(aux_sym__basic_string_token1); - if (lookahead != 0 && - (lookahead < 0 || 31 < lookahead) && - lookahead != '"' && - lookahead != '\\' && - lookahead != 127) ADVANCE(131); - END_STATE(); - case 132: - ACCEPT_TOKEN(anon_sym_DQUOTE2); - END_STATE(); - case 133: - ACCEPT_TOKEN(anon_sym_DQUOTE2); - if (lookahead == '"') ADVANCE(9); - END_STATE(); - case 134: ACCEPT_TOKEN(anon_sym_DQUOTE_DQUOTE_DQUOTE); END_STATE(); - case 135: + case 130: ACCEPT_TOKEN(aux_sym__multiline_basic_string_token1); - if (lookahead == '"') ADVANCE(138); END_STATE(); - case 136: - ACCEPT_TOKEN(aux_sym__multiline_basic_string_token1); - if (lookahead == '"') ADVANCE(135); - END_STATE(); - case 137: - ACCEPT_TOKEN(aux_sym__multiline_basic_string_token2); - END_STATE(); - case 138: - ACCEPT_TOKEN(anon_sym_DQUOTE_DQUOTE_DQUOTE2); - END_STATE(); - case 139: + case 131: ACCEPT_TOKEN(sym_escape_sequence); END_STATE(); - case 140: + case 132: ACCEPT_TOKEN(sym__escape_line_ending); END_STATE(); - case 141: + case 133: ACCEPT_TOKEN(anon_sym_SQUOTE); END_STATE(); - case 142: + case 134: ACCEPT_TOKEN(anon_sym_SQUOTE); - if (lookahead == '\'') ADVANCE(14); + if (lookahead == '\'') ADVANCE(11); END_STATE(); - case 143: + case 135: ACCEPT_TOKEN(aux_sym__literal_string_token1); - if (lookahead == '#') ADVANCE(144); + if (lookahead == '#') ADVANCE(136); if (lookahead == '\t' || - lookahead == ' ') ADVANCE(143); + lookahead == ' ') ADVANCE(135); if (lookahead != 0 && (lookahead < 0 || 31 < lookahead) && lookahead != '\'' && - lookahead != 127) ADVANCE(145); + lookahead != 127) ADVANCE(137); END_STATE(); - case 144: + case 136: ACCEPT_TOKEN(aux_sym__literal_string_token1); - if ((0 <= lookahead && lookahead <= 8) || - (11 <= lookahead && lookahead <= 31) || - lookahead == '\'' || - lookahead == 127) ADVANCE(84); + if (lookahead == '\'') ADVANCE(79); if (lookahead != 0 && - lookahead != '\n') ADVANCE(144); + (lookahead < 0 || 8 < lookahead) && + (lookahead < '\n' || 31 < lookahead) && + lookahead != 127) ADVANCE(136); END_STATE(); - case 145: + case 137: ACCEPT_TOKEN(aux_sym__literal_string_token1); if (lookahead != 0 && (lookahead < 0 || 8 < lookahead) && (lookahead < '\n' || 31 < lookahead) && lookahead != '\'' && - lookahead != 127) ADVANCE(145); + lookahead != 127) ADVANCE(137); END_STATE(); - case 146: + case 138: ACCEPT_TOKEN(anon_sym_SQUOTE2); END_STATE(); - case 147: + case 139: ACCEPT_TOKEN(anon_sym_SQUOTE2); - if (lookahead == '\'') ADVANCE(14); + if (lookahead == '\'') ADVANCE(11); END_STATE(); - case 148: + case 140: ACCEPT_TOKEN(anon_sym_SQUOTE_SQUOTE_SQUOTE); END_STATE(); + case 141: + ACCEPT_TOKEN(aux_sym_integer_token1); + END_STATE(); + case 142: + ACCEPT_TOKEN(aux_sym_integer_token1); + if (lookahead == '-') ADVANCE(18); + if (lookahead == '.') ADVANCE(57); + if (lookahead == ':') ADVANCE(46); + if (lookahead == '_') ADVANCE(56); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(40); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(145); + END_STATE(); + case 143: + ACCEPT_TOKEN(aux_sym_integer_token1); + if (lookahead == '-') ADVANCE(18); + if (lookahead == '.') ADVANCE(57); + if (lookahead == '_') ADVANCE(56); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(40); + if (('0' <= lookahead && lookahead <= '3')) ADVANCE(142); + if (('4' <= lookahead && lookahead <= '9')) ADVANCE(145); + END_STATE(); + case 144: + ACCEPT_TOKEN(aux_sym_integer_token1); + if (lookahead == '-') ADVANCE(18); + if (lookahead == '.') ADVANCE(57); + if (lookahead == '_') ADVANCE(56); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(40); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(142); + END_STATE(); + case 145: + ACCEPT_TOKEN(aux_sym_integer_token1); + if (lookahead == '-') ADVANCE(18); + if (lookahead == '.') ADVANCE(57); + if (lookahead == '_') ADVANCE(56); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(40); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(145); + END_STATE(); + case 146: + ACCEPT_TOKEN(aux_sym_integer_token1); + if (lookahead == '-') ADVANCE(18); + if (lookahead == '.') ADVANCE(57); + if (lookahead == 'b') ADVANCE(41); + if (lookahead == 'o') ADVANCE(49); + if (lookahead == 'x') ADVANCE(67); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(40); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(12); + END_STATE(); + case 147: + ACCEPT_TOKEN(aux_sym_integer_token1); + if (lookahead == '.') ADVANCE(57); + if (lookahead == '_') ADVANCE(56); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(40); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(147); + END_STATE(); + case 148: + ACCEPT_TOKEN(aux_sym_integer_token1); + if (lookahead == '.') ADVANCE(57); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(40); + END_STATE(); case 149: - ACCEPT_TOKEN(aux_sym__multiline_literal_string_token1); - if (lookahead == '\'') ADVANCE(151); + ACCEPT_TOKEN(aux_sym_integer_token1); + if (lookahead == '_') ADVANCE(52); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(149); END_STATE(); case 150: - ACCEPT_TOKEN(aux_sym__multiline_literal_string_token1); - if (lookahead == '\'') ADVANCE(149); - END_STATE(); - case 151: - ACCEPT_TOKEN(anon_sym_SQUOTE_SQUOTE_SQUOTE2); - END_STATE(); - case 152: - ACCEPT_TOKEN(aux_sym_integer_token1); - END_STATE(); - case 153: - ACCEPT_TOKEN(aux_sym_integer_token1); - if (lookahead == '-') ADVANCE(21); - if (lookahead == '.') ADVANCE(62); - if (lookahead == ':') ADVANCE(51); - if (lookahead == '_') ADVANCE(61); - if (lookahead == 'E' || - lookahead == 'e') ADVANCE(22); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(156); - END_STATE(); - case 154: - ACCEPT_TOKEN(aux_sym_integer_token1); - if (lookahead == '-') ADVANCE(21); - if (lookahead == '.') ADVANCE(62); - if (lookahead == '_') ADVANCE(61); - if (lookahead == 'E' || - lookahead == 'e') ADVANCE(22); - if (('0' <= lookahead && lookahead <= '3')) ADVANCE(153); - if (('4' <= lookahead && lookahead <= '9')) ADVANCE(156); - END_STATE(); - case 155: - ACCEPT_TOKEN(aux_sym_integer_token1); - if (lookahead == '-') ADVANCE(21); - if (lookahead == '.') ADVANCE(62); - if (lookahead == '_') ADVANCE(61); - if (lookahead == 'E' || - lookahead == 'e') ADVANCE(22); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(153); - END_STATE(); - case 156: - ACCEPT_TOKEN(aux_sym_integer_token1); - if (lookahead == '-') ADVANCE(21); - if (lookahead == '.') ADVANCE(62); - if (lookahead == '_') ADVANCE(61); - if (lookahead == 'E' || - lookahead == 'e') ADVANCE(22); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(156); - END_STATE(); - case 157: - ACCEPT_TOKEN(aux_sym_integer_token1); - if (lookahead == '-') ADVANCE(21); - if (lookahead == '.') ADVANCE(62); - if (lookahead == 'b') ADVANCE(46); - if (lookahead == 'o') ADVANCE(54); - if (lookahead == 'x') ADVANCE(72); - if (lookahead == 'E' || - lookahead == 'e') ADVANCE(22); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(15); - END_STATE(); - case 158: - ACCEPT_TOKEN(aux_sym_integer_token1); - if (lookahead == '.') ADVANCE(62); - if (lookahead == '_') ADVANCE(61); - if (lookahead == 'E' || - lookahead == 'e') ADVANCE(22); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(158); - END_STATE(); - case 159: - ACCEPT_TOKEN(aux_sym_integer_token1); - if (lookahead == '.') ADVANCE(62); - if (lookahead == 'E' || - lookahead == 'e') ADVANCE(22); - END_STATE(); - case 160: - ACCEPT_TOKEN(aux_sym_integer_token1); - if (lookahead == '_') ADVANCE(57); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(160); - END_STATE(); - case 161: ACCEPT_TOKEN(aux_sym_integer_token2); - if (lookahead == '_') ADVANCE(72); + if (lookahead == '_') ADVANCE(67); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'F') || - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(161); + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(150); END_STATE(); - case 162: + case 151: ACCEPT_TOKEN(aux_sym_integer_token3); - if (lookahead == '_') ADVANCE(54); - if (('0' <= lookahead && lookahead <= '7')) ADVANCE(162); + if (lookahead == '_') ADVANCE(49); + if (('0' <= lookahead && lookahead <= '7')) ADVANCE(151); END_STATE(); - case 163: + case 152: ACCEPT_TOKEN(aux_sym_integer_token4); - if (lookahead == '_') ADVANCE(46); + if (lookahead == '_') ADVANCE(41); if (lookahead == '0' || - lookahead == '1') ADVANCE(163); + lookahead == '1') ADVANCE(152); END_STATE(); - case 164: + case 153: ACCEPT_TOKEN(aux_sym_float_token1); - END_STATE(); - case 165: - ACCEPT_TOKEN(aux_sym_float_token1); - if (lookahead == '_') ADVANCE(62); + if (lookahead == '_') ADVANCE(57); if (lookahead == 'E' || - lookahead == 'e') ADVANCE(22); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(165); + lookahead == 'e') ADVANCE(40); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(153); END_STATE(); - case 166: + case 154: ACCEPT_TOKEN(aux_sym_float_token1); - if (lookahead == '_') ADVANCE(63); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(166); + if (lookahead == '_') ADVANCE(58); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(154); END_STATE(); - case 167: + case 155: ACCEPT_TOKEN(aux_sym_float_token2); END_STATE(); - case 168: + case 156: ACCEPT_TOKEN(sym_boolean); END_STATE(); - case 169: + case 157: ACCEPT_TOKEN(sym_offset_date_time); END_STATE(); - case 170: + case 158: ACCEPT_TOKEN(sym_local_date_time); - if (lookahead == '.') ADVANCE(67); + if (lookahead == '.') ADVANCE(62); if (lookahead == '+' || - lookahead == '-') ADVANCE(27); + lookahead == '-') ADVANCE(22); if (lookahead == 'Z' || - lookahead == 'z') ADVANCE(169); + lookahead == 'z') ADVANCE(157); END_STATE(); - case 171: + case 159: ACCEPT_TOKEN(sym_local_date_time); if (lookahead == '+' || - lookahead == '-') ADVANCE(27); + lookahead == '-') ADVANCE(22); if (lookahead == 'Z' || - lookahead == 'z') ADVANCE(169); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(171); + lookahead == 'z') ADVANCE(157); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(159); END_STATE(); - case 172: + case 160: ACCEPT_TOKEN(sym_local_date); if (lookahead == ' ' || lookahead == 'T' || - lookahead == 't') ADVANCE(26); + lookahead == 't') ADVANCE(21); END_STATE(); - case 173: + case 161: ACCEPT_TOKEN(sym_local_time); - if (lookahead == '.') ADVANCE(60); + if (lookahead == '.') ADVANCE(55); END_STATE(); - case 174: + case 162: ACCEPT_TOKEN(sym_local_time); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(174); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(162); END_STATE(); - case 175: + case 163: ACCEPT_TOKEN(anon_sym_COMMA); END_STATE(); - case 176: + case 164: ACCEPT_TOKEN(anon_sym_LBRACE); END_STATE(); - case 177: + case 165: ACCEPT_TOKEN(anon_sym_RBRACE); END_STATE(); default: @@ -1573,99 +1510,99 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { static TSLexMode ts_lex_modes[STATE_COUNT] = { [0] = {.lex_state = 0, .external_lex_state = 1}, - [1] = {.lex_state = 81}, - [2] = {.lex_state = 8}, - [3] = {.lex_state = 8}, - [4] = {.lex_state = 8}, - [5] = {.lex_state = 8}, - [6] = {.lex_state = 8}, - [7] = {.lex_state = 8}, - [8] = {.lex_state = 8}, - [9] = {.lex_state = 8}, - [10] = {.lex_state = 8}, - [11] = {.lex_state = 8}, - [12] = {.lex_state = 8}, - [13] = {.lex_state = 8}, - [14] = {.lex_state = 8}, - [15] = {.lex_state = 8}, - [16] = {.lex_state = 8}, - [17] = {.lex_state = 8}, - [18] = {.lex_state = 8}, - [19] = {.lex_state = 8}, - [20] = {.lex_state = 8}, - [21] = {.lex_state = 8}, - [22] = {.lex_state = 8}, - [23] = {.lex_state = 8}, - [24] = {.lex_state = 8}, - [25] = {.lex_state = 8}, - [26] = {.lex_state = 8}, - [27] = {.lex_state = 81}, - [28] = {.lex_state = 81}, - [29] = {.lex_state = 81}, - [30] = {.lex_state = 81}, - [31] = {.lex_state = 81}, - [32] = {.lex_state = 81}, - [33] = {.lex_state = 81}, - [34] = {.lex_state = 81}, - [35] = {.lex_state = 81}, - [36] = {.lex_state = 81}, - [37] = {.lex_state = 81}, - [38] = {.lex_state = 1}, - [39] = {.lex_state = 1}, - [40] = {.lex_state = 1}, - [41] = {.lex_state = 1}, - [42] = {.lex_state = 1}, - [43] = {.lex_state = 81}, - [44] = {.lex_state = 81}, - [45] = {.lex_state = 81}, - [46] = {.lex_state = 81}, + [1] = {.lex_state = 76}, + [2] = {.lex_state = 7}, + [3] = {.lex_state = 7}, + [4] = {.lex_state = 7}, + [5] = {.lex_state = 7}, + [6] = {.lex_state = 7}, + [7] = {.lex_state = 7}, + [8] = {.lex_state = 7}, + [9] = {.lex_state = 7}, + [10] = {.lex_state = 7}, + [11] = {.lex_state = 7}, + [12] = {.lex_state = 7}, + [13] = {.lex_state = 7}, + [14] = {.lex_state = 7}, + [15] = {.lex_state = 7}, + [16] = {.lex_state = 7}, + [17] = {.lex_state = 7}, + [18] = {.lex_state = 7}, + [19] = {.lex_state = 7}, + [20] = {.lex_state = 7}, + [21] = {.lex_state = 7}, + [22] = {.lex_state = 7}, + [23] = {.lex_state = 7}, + [24] = {.lex_state = 7}, + [25] = {.lex_state = 7}, + [26] = {.lex_state = 7}, + [27] = {.lex_state = 76}, + [28] = {.lex_state = 76}, + [29] = {.lex_state = 76}, + [30] = {.lex_state = 76}, + [31] = {.lex_state = 76}, + [32] = {.lex_state = 76}, + [33] = {.lex_state = 76}, + [34] = {.lex_state = 76}, + [35] = {.lex_state = 76}, + [36] = {.lex_state = 76}, + [37] = {.lex_state = 76}, + [38] = {.lex_state = 2, .external_lex_state = 2}, + [39] = {.lex_state = 2, .external_lex_state = 2}, + [40] = {.lex_state = 2, .external_lex_state = 2}, + [41] = {.lex_state = 2, .external_lex_state = 2}, + [42] = {.lex_state = 2, .external_lex_state = 2}, + [43] = {.lex_state = 76}, + [44] = {.lex_state = 76}, + [45] = {.lex_state = 76}, + [46] = {.lex_state = 76}, [47] = {.lex_state = 0}, [48] = {.lex_state = 0}, - [49] = {.lex_state = 81}, - [50] = {.lex_state = 81}, - [51] = {.lex_state = 81}, + [49] = {.lex_state = 76}, + [50] = {.lex_state = 76}, + [51] = {.lex_state = 76}, [52] = {.lex_state = 0}, - [53] = {.lex_state = 81}, - [54] = {.lex_state = 81}, - [55] = {.lex_state = 81}, - [56] = {.lex_state = 4}, - [57] = {.lex_state = 81}, - [58] = {.lex_state = 81}, - [59] = {.lex_state = 4}, - [60] = {.lex_state = 4}, - [61] = {.lex_state = 81}, - [62] = {.lex_state = 4}, - [63] = {.lex_state = 4}, - [64] = {.lex_state = 81}, - [65] = {.lex_state = 81}, - [66] = {.lex_state = 81}, - [67] = {.lex_state = 81}, - [68] = {.lex_state = 81}, + [53] = {.lex_state = 76}, + [54] = {.lex_state = 76}, + [55] = {.lex_state = 76}, + [56] = {.lex_state = 3, .external_lex_state = 3}, + [57] = {.lex_state = 76}, + [58] = {.lex_state = 76}, + [59] = {.lex_state = 3, .external_lex_state = 3}, + [60] = {.lex_state = 3, .external_lex_state = 3}, + [61] = {.lex_state = 76}, + [62] = {.lex_state = 3, .external_lex_state = 3}, + [63] = {.lex_state = 3, .external_lex_state = 3}, + [64] = {.lex_state = 76}, + [65] = {.lex_state = 76}, + [66] = {.lex_state = 76}, + [67] = {.lex_state = 76}, + [68] = {.lex_state = 76}, [69] = {.lex_state = 2}, [70] = {.lex_state = 2}, [71] = {.lex_state = 2}, [72] = {.lex_state = 2}, [73] = {.lex_state = 2}, - [74] = {.lex_state = 81}, + [74] = {.lex_state = 76}, [75] = {.lex_state = 2}, [76] = {.lex_state = 2}, - [77] = {.lex_state = 81}, - [78] = {.lex_state = 81}, - [79] = {.lex_state = 81}, - [80] = {.lex_state = 81}, - [81] = {.lex_state = 81}, - [82] = {.lex_state = 81}, - [83] = {.lex_state = 81}, - [84] = {.lex_state = 81}, - [85] = {.lex_state = 81}, - [86] = {.lex_state = 81}, - [87] = {.lex_state = 81}, - [88] = {.lex_state = 81}, - [89] = {.lex_state = 81}, - [90] = {.lex_state = 81}, - [91] = {.lex_state = 81}, - [92] = {.lex_state = 81}, - [93] = {.lex_state = 81}, + [77] = {.lex_state = 76}, + [78] = {.lex_state = 76}, + [79] = {.lex_state = 76}, + [80] = {.lex_state = 76}, + [81] = {.lex_state = 76}, + [82] = {.lex_state = 76}, + [83] = {.lex_state = 76}, + [84] = {.lex_state = 76}, + [85] = {.lex_state = 76}, + [86] = {.lex_state = 76}, + [87] = {.lex_state = 76}, + [88] = {.lex_state = 76}, + [89] = {.lex_state = 76}, + [90] = {.lex_state = 76}, + [91] = {.lex_state = 76}, + [92] = {.lex_state = 76}, + [93] = {.lex_state = 76}, [94] = {.lex_state = 0}, [95] = {.lex_state = 0}, [96] = {.lex_state = 0}, @@ -1680,63 +1617,86 @@ static TSLexMode ts_lex_modes[STATE_COUNT] = { [105] = {.lex_state = 0}, [106] = {.lex_state = 0}, [107] = {.lex_state = 0}, - [108] = {.lex_state = 10}, - [109] = {.lex_state = 10}, + [108] = {.lex_state = 9}, + [109] = {.lex_state = 9}, [110] = {.lex_state = 0}, [111] = {.lex_state = 0}, - [112] = {.lex_state = 13}, + [112] = {.lex_state = 3}, [113] = {.lex_state = 0}, - [114] = {.lex_state = 13}, + [114] = {.lex_state = 3}, [115] = {.lex_state = 0}, - [116] = {.lex_state = 10}, - [117] = {.lex_state = 10}, - [118] = {.lex_state = 10}, - [119] = {.lex_state = 10}, - [120] = {.lex_state = 13}, + [116] = {.lex_state = 9}, + [117] = {.lex_state = 9}, + [118] = {.lex_state = 9}, + [119] = {.lex_state = 9}, + [120] = {.lex_state = 3}, [121] = {.lex_state = 0}, - [122] = {.lex_state = 10}, - [123] = {.lex_state = 0, .external_lex_state = 1}, - [124] = {.lex_state = 0, .external_lex_state = 1}, - [125] = {.lex_state = 0, .external_lex_state = 1}, - [126] = {.lex_state = 0, .external_lex_state = 1}, - [127] = {.lex_state = 0, .external_lex_state = 1}, - [128] = {.lex_state = 0, .external_lex_state = 1}, - [129] = {.lex_state = 0, .external_lex_state = 1}, - [130] = {.lex_state = 0, .external_lex_state = 1}, - [131] = {.lex_state = 0, .external_lex_state = 1}, - [132] = {.lex_state = 0, .external_lex_state = 1}, - [133] = {.lex_state = 0, .external_lex_state = 1}, - [134] = {.lex_state = 0, .external_lex_state = 1}, - [135] = {.lex_state = 10}, - [136] = {.lex_state = 0, .external_lex_state = 1}, - [137] = {.lex_state = 0, .external_lex_state = 1}, - [138] = {.lex_state = 0, .external_lex_state = 1}, - [139] = {.lex_state = 0, .external_lex_state = 1}, - [140] = {.lex_state = 10}, - [141] = {.lex_state = 0, .external_lex_state = 1}, - [142] = {.lex_state = 0, .external_lex_state = 1}, - [143] = {.lex_state = 0, .external_lex_state = 1}, + [122] = {.lex_state = 9}, + [123] = {.lex_state = 0, .external_lex_state = 4}, + [124] = {.lex_state = 0, .external_lex_state = 4}, + [125] = {.lex_state = 0, .external_lex_state = 4}, + [126] = {.lex_state = 0, .external_lex_state = 4}, + [127] = {.lex_state = 0, .external_lex_state = 4}, + [128] = {.lex_state = 0, .external_lex_state = 4}, + [129] = {.lex_state = 0, .external_lex_state = 4}, + [130] = {.lex_state = 0, .external_lex_state = 4}, + [131] = {.lex_state = 0, .external_lex_state = 4}, + [132] = {.lex_state = 0, .external_lex_state = 4}, + [133] = {.lex_state = 0, .external_lex_state = 4}, + [134] = {.lex_state = 0, .external_lex_state = 4}, + [135] = {.lex_state = 9}, + [136] = {.lex_state = 0, .external_lex_state = 4}, + [137] = {.lex_state = 0, .external_lex_state = 4}, + [138] = {.lex_state = 0, .external_lex_state = 4}, + [139] = {.lex_state = 0, .external_lex_state = 4}, + [140] = {.lex_state = 9}, + [141] = {.lex_state = 0, .external_lex_state = 4}, + [142] = {.lex_state = 0, .external_lex_state = 4}, + [143] = {.lex_state = 0, .external_lex_state = 4}, [144] = {.lex_state = 0}, - [145] = {.lex_state = 0, .external_lex_state = 1}, - [146] = {.lex_state = 0, .external_lex_state = 1}, - [147] = {.lex_state = 0, .external_lex_state = 1}, - [148] = {.lex_state = 0, .external_lex_state = 1}, - [149] = {.lex_state = 0, .external_lex_state = 1}, - [150] = {.lex_state = 10}, - [151] = {.lex_state = 0, .external_lex_state = 1}, + [145] = {.lex_state = 0, .external_lex_state = 4}, + [146] = {.lex_state = 0, .external_lex_state = 4}, + [147] = {.lex_state = 0, .external_lex_state = 4}, + [148] = {.lex_state = 0, .external_lex_state = 4}, + [149] = {.lex_state = 0, .external_lex_state = 4}, + [150] = {.lex_state = 9}, + [151] = {.lex_state = 0, .external_lex_state = 4}, }; enum { ts_external_token__line_ending_or_eof = 0, + ts_external_token__multiline_basic_string_content = 1, + ts_external_token__multiline_basic_string_end = 2, + ts_external_token__multiline_literal_string_content = 3, + ts_external_token__multiline_literal_string_end = 4, }; static TSSymbol ts_external_scanner_symbol_map[EXTERNAL_TOKEN_COUNT] = { [ts_external_token__line_ending_or_eof] = sym__line_ending_or_eof, + [ts_external_token__multiline_basic_string_content] = sym__multiline_basic_string_content, + [ts_external_token__multiline_basic_string_end] = sym__multiline_basic_string_end, + [ts_external_token__multiline_literal_string_content] = sym__multiline_literal_string_content, + [ts_external_token__multiline_literal_string_end] = sym__multiline_literal_string_end, }; -static bool ts_external_scanner_states[2][EXTERNAL_TOKEN_COUNT] = { +static bool ts_external_scanner_states[5][EXTERNAL_TOKEN_COUNT] = { [1] = { [ts_external_token__line_ending_or_eof] = true, + [ts_external_token__multiline_basic_string_content] = true, + [ts_external_token__multiline_basic_string_end] = true, + [ts_external_token__multiline_literal_string_content] = true, + [ts_external_token__multiline_literal_string_end] = true, + }, + [2] = { + [ts_external_token__multiline_basic_string_content] = true, + [ts_external_token__multiline_basic_string_end] = true, + }, + [3] = { + [ts_external_token__multiline_literal_string_content] = true, + [ts_external_token__multiline_literal_string_end] = true, + }, + [4] = { + [ts_external_token__line_ending_or_eof] = true, }, }; @@ -1754,7 +1714,7 @@ static uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_DQUOTE] = ACTIONS(1), [anon_sym_DQUOTE2] = ACTIONS(1), [anon_sym_DQUOTE_DQUOTE_DQUOTE] = ACTIONS(1), - [aux_sym__multiline_basic_string_token2] = ACTIONS(1), + [aux_sym__multiline_basic_string_token1] = ACTIONS(1), [sym_escape_sequence] = ACTIONS(1), [sym__escape_line_ending] = ACTIONS(1), [anon_sym_SQUOTE] = ACTIONS(1), @@ -1772,6 +1732,10 @@ static uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_LBRACE] = ACTIONS(1), [anon_sym_RBRACE] = ACTIONS(1), [sym__line_ending_or_eof] = ACTIONS(1), + [sym__multiline_basic_string_content] = ACTIONS(1), + [sym__multiline_basic_string_end] = ACTIONS(1), + [sym__multiline_literal_string_content] = ACTIONS(1), + [sym__multiline_literal_string_end] = ACTIONS(1), }, [1] = { [sym_document] = STATE(144), @@ -3252,71 +3216,71 @@ static uint16_t ts_small_parse_table[] = { [1959] = 5, ACTIONS(196), 1, sym_comment, + ACTIONS(198), 1, + aux_sym__basic_string_token1, ACTIONS(202), 1, - anon_sym_DQUOTE_DQUOTE_DQUOTE2, + sym__multiline_basic_string_end, STATE(39), 1, aux_sym__multiline_basic_string_repeat1, - ACTIONS(198), 2, - aux_sym__basic_string_token1, + ACTIONS(200), 4, + sym__multiline_basic_string_content, aux_sym__multiline_basic_string_token1, - ACTIONS(200), 3, - aux_sym__multiline_basic_string_token2, sym_escape_sequence, sym__escape_line_ending, [1978] = 5, ACTIONS(196), 1, sym_comment, + ACTIONS(204), 1, + aux_sym__basic_string_token1, ACTIONS(210), 1, - anon_sym_DQUOTE_DQUOTE_DQUOTE2, + sym__multiline_basic_string_end, STATE(39), 1, aux_sym__multiline_basic_string_repeat1, - ACTIONS(204), 2, - aux_sym__basic_string_token1, + ACTIONS(207), 4, + sym__multiline_basic_string_content, aux_sym__multiline_basic_string_token1, - ACTIONS(207), 3, - aux_sym__multiline_basic_string_token2, sym_escape_sequence, sym__escape_line_ending, [1997] = 5, ACTIONS(196), 1, sym_comment, + ACTIONS(212), 1, + aux_sym__basic_string_token1, ACTIONS(216), 1, - anon_sym_DQUOTE_DQUOTE_DQUOTE2, + sym__multiline_basic_string_end, STATE(38), 1, aux_sym__multiline_basic_string_repeat1, - ACTIONS(212), 2, - aux_sym__basic_string_token1, + ACTIONS(214), 4, + sym__multiline_basic_string_content, aux_sym__multiline_basic_string_token1, - ACTIONS(214), 3, - aux_sym__multiline_basic_string_token2, sym_escape_sequence, sym__escape_line_ending, [2016] = 5, ACTIONS(196), 1, sym_comment, + ACTIONS(218), 1, + aux_sym__basic_string_token1, ACTIONS(222), 1, - anon_sym_DQUOTE_DQUOTE_DQUOTE2, + sym__multiline_basic_string_end, STATE(42), 1, aux_sym__multiline_basic_string_repeat1, - ACTIONS(218), 2, - aux_sym__basic_string_token1, + ACTIONS(220), 4, + sym__multiline_basic_string_content, aux_sym__multiline_basic_string_token1, - ACTIONS(220), 3, - aux_sym__multiline_basic_string_token2, sym_escape_sequence, sym__escape_line_ending, [2035] = 5, ACTIONS(196), 1, sym_comment, + ACTIONS(198), 1, + aux_sym__basic_string_token1, ACTIONS(224), 1, - anon_sym_DQUOTE_DQUOTE_DQUOTE2, + sym__multiline_basic_string_end, STATE(39), 1, aux_sym__multiline_basic_string_repeat1, - ACTIONS(198), 2, - aux_sym__basic_string_token1, + ACTIONS(200), 4, + sym__multiline_basic_string_content, aux_sym__multiline_basic_string_token1, - ACTIONS(200), 3, - aux_sym__multiline_basic_string_token2, sym_escape_sequence, sym__escape_line_ending, [2054] = 6, @@ -3482,15 +3446,15 @@ static uint16_t ts_small_parse_table[] = { [2270] = 5, ACTIONS(196), 1, sym_comment, - ACTIONS(260), 1, - aux_sym__multiline_basic_string_token2, + ACTIONS(262), 1, + aux_sym__literal_string_token1, ACTIONS(264), 1, - anon_sym_SQUOTE_SQUOTE_SQUOTE2, + sym__multiline_literal_string_end, STATE(60), 1, aux_sym__multiline_literal_string_repeat1, - ACTIONS(262), 2, - aux_sym__literal_string_token1, - aux_sym__multiline_literal_string_token1, + ACTIONS(260), 2, + sym__multiline_literal_string_content, + aux_sym__multiline_basic_string_token1, [2287] = 6, ACTIONS(3), 1, sym_comment, @@ -3520,27 +3484,27 @@ static uint16_t ts_small_parse_table[] = { [2325] = 5, ACTIONS(196), 1, sym_comment, - ACTIONS(268), 1, - aux_sym__multiline_basic_string_token2, + ACTIONS(270), 1, + aux_sym__literal_string_token1, ACTIONS(272), 1, - anon_sym_SQUOTE_SQUOTE_SQUOTE2, + sym__multiline_literal_string_end, STATE(63), 1, aux_sym__multiline_literal_string_repeat1, - ACTIONS(270), 2, - aux_sym__literal_string_token1, - aux_sym__multiline_literal_string_token1, + ACTIONS(268), 2, + sym__multiline_literal_string_content, + aux_sym__multiline_basic_string_token1, [2342] = 5, ACTIONS(196), 1, sym_comment, - ACTIONS(274), 1, - aux_sym__multiline_basic_string_token2, + ACTIONS(277), 1, + aux_sym__literal_string_token1, ACTIONS(280), 1, - anon_sym_SQUOTE_SQUOTE_SQUOTE2, + sym__multiline_literal_string_end, STATE(60), 1, aux_sym__multiline_literal_string_repeat1, - ACTIONS(277), 2, - aux_sym__literal_string_token1, - aux_sym__multiline_literal_string_token1, + ACTIONS(274), 2, + sym__multiline_literal_string_content, + aux_sym__multiline_basic_string_token1, [2359] = 6, ACTIONS(3), 1, sym_comment, @@ -3557,27 +3521,27 @@ static uint16_t ts_small_parse_table[] = { [2378] = 5, ACTIONS(196), 1, sym_comment, - ACTIONS(286), 1, - aux_sym__multiline_basic_string_token2, + ACTIONS(288), 1, + aux_sym__literal_string_token1, ACTIONS(290), 1, - anon_sym_SQUOTE_SQUOTE_SQUOTE2, + sym__multiline_literal_string_end, STATE(56), 1, aux_sym__multiline_literal_string_repeat1, - ACTIONS(288), 2, - aux_sym__literal_string_token1, - aux_sym__multiline_literal_string_token1, + ACTIONS(286), 2, + sym__multiline_literal_string_content, + aux_sym__multiline_basic_string_token1, [2395] = 5, ACTIONS(196), 1, sym_comment, - ACTIONS(260), 1, - aux_sym__multiline_basic_string_token2, + ACTIONS(262), 1, + aux_sym__literal_string_token1, ACTIONS(292), 1, - anon_sym_SQUOTE_SQUOTE_SQUOTE2, + sym__multiline_literal_string_end, STATE(60), 1, aux_sym__multiline_literal_string_repeat1, - ACTIONS(262), 2, - aux_sym__literal_string_token1, - aux_sym__multiline_literal_string_token1, + ACTIONS(260), 2, + sym__multiline_literal_string_content, + aux_sym__multiline_basic_string_token1, [2412] = 6, ACTIONS(3), 1, sym_comment, diff --git a/src/scanner.c b/src/scanner.c index f4a76a7..0aac170 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -6,7 +6,11 @@ #endif enum TokenType { - LINE_ENDING_OR_EOF + LINE_ENDING_OR_EOF, + MULTILINE_BASIC_STRING_CONTENT, + MULTILINE_BASIC_STRING_END, + MULTILINE_LITERAL_STRING_CONTENT, + MULTILINE_LITERAL_STRING_END, }; void *tree_sitter_toml_external_scanner_create() { return NULL; } @@ -14,28 +18,71 @@ void tree_sitter_toml_external_scanner_destroy(void *payload) {} unsigned tree_sitter_toml_external_scanner_serialize(void *payload, char *buffer) { return 0; } void tree_sitter_toml_external_scanner_deserialize(void *payload, const char *buffer, unsigned length) {} +bool tree_sitter_toml_external_scanner_scan_multiline_string_end(TSLexer *lexer, const bool *valid_symbols, int32_t delimiter, enum TokenType content_symbol, enum TokenType end_symbol) { + if (!valid_symbols[end_symbol] || lexer->lookahead != delimiter) { + return false; + } + + lexer->advance(lexer, false); + lexer->mark_end(lexer); + + if (lexer->lookahead != delimiter) { + lexer->result_symbol = content_symbol; + return true; + } + + lexer->advance(lexer, false); + + if (lexer->lookahead != delimiter) { + lexer->mark_end(lexer); + lexer->result_symbol = content_symbol; + return true; + } + + lexer->advance(lexer, false); + + if (lexer->lookahead != delimiter) { + lexer->mark_end(lexer); + lexer->result_symbol = end_symbol; + return true; + } + + lexer->result_symbol = content_symbol; + return true; +} + bool tree_sitter_toml_external_scanner_scan( void *payload, TSLexer *lexer, const bool *valid_symbols ) { - lexer->result_symbol = LINE_ENDING_OR_EOF; - - while (lexer->lookahead == ' ' || lexer->lookahead == '\t') { - lexer->advance(lexer, true); - } - - if (lexer->lookahead == 0 || lexer->lookahead == '\n') { + if ( + tree_sitter_toml_external_scanner_scan_multiline_string_end(lexer, valid_symbols, '"', MULTILINE_BASIC_STRING_CONTENT, MULTILINE_BASIC_STRING_END) + || tree_sitter_toml_external_scanner_scan_multiline_string_end(lexer, valid_symbols, '\'', MULTILINE_LITERAL_STRING_CONTENT, MULTILINE_LITERAL_STRING_END) + ) { return true; } - if (lexer->lookahead == '\r') { - lexer->advance(lexer, true); - if (lexer->lookahead == '\n') { + if (valid_symbols[LINE_ENDING_OR_EOF]) { + lexer->result_symbol = LINE_ENDING_OR_EOF; + + while (lexer->lookahead == ' ' || lexer->lookahead == '\t') { + lexer->advance(lexer, true); + } + + if (lexer->lookahead == 0 || lexer->lookahead == '\n') { return true; } + + if (lexer->lookahead == '\r') { + lexer->advance(lexer, true); + if (lexer->lookahead == '\n') { + return true; + } + } } + return false; } diff --git a/toml-spec/spec.md b/toml-spec/spec.md new file mode 100644 index 0000000..74baacf --- /dev/null +++ b/toml-spec/spec.md @@ -0,0 +1,1031 @@ +TOML v1.0.0-rc.1 +================ + +Tom's Obvious, Minimal Language. + +By Tom Preston-Werner, Pradyun Gedam, et al. + +Objectives +---------- + +TOML aims to be a minimal configuration file format that's easy to read due to +obvious semantics. TOML is designed to map unambiguously to a hash table. TOML +should be easy to parse into data structures in a wide variety of languages. + +Table of contents +------- + +- [Example](#user-content-example) +- [Spec](#user-content-spec) +- [Comment](#user-content-comment) +- [Key/Value Pair](#user-content-keyvalue-pair) +- [Keys](#user-content-keys) +- [String](#user-content-string) +- [Integer](#user-content-integer) +- [Float](#user-content-float) +- [Boolean](#user-content-boolean) +- [Offset Date-Time](#user-content-offset-date-time) +- [Local Date-Time](#user-content-local-date-time) +- [Local Date](#user-content-local-date) +- [Local Time](#user-content-local-time) +- [Array](#user-content-array) +- [Table](#user-content-table) +- [Inline Table](#user-content-inline-table) +- [Array of Tables](#user-content-array-of-tables) +- [Filename Extension](#user-content-filename-extension) +- [MIME Type](#user-content-mime-type) +- [Comparison with Other Formats](#user-content-comparison-with-other-formats) +- [Get Involved](#user-content-get-involved) +- [Wiki](#user-content-wiki) + +Example +------- + +```toml +# This is a TOML document. + +title = "TOML Example" + +[owner] +name = "Tom Preston-Werner" +dob = 1979-05-27T07:32:00-08:00 # First class dates + +[database] +server = "192.168.1.1" +ports = [ 8001, 8001, 8002 ] +connection_max = 5000 +enabled = true + +[servers] + + # Indentation (tabs and/or spaces) is allowed but not required + [servers.alpha] + ip = "10.0.0.1" + dc = "eqdc10" + + [servers.beta] + ip = "10.0.0.2" + dc = "eqdc10" + +[clients] +data = [ ["gamma", "delta"], [1, 2] ] + +# Line breaks are OK when inside arrays +hosts = [ + "alpha", + "omega" +] +``` + +Spec +---- + +* TOML is case sensitive. +* A TOML file must be a valid UTF-8 encoded Unicode document. +* Whitespace means tab (0x09) or space (0x20). +* Newline means LF (0x0A) or CRLF (0x0D 0x0A). + +Comment +------- + +A hash symbol marks the rest of the line as a comment, except when inside a string. + +```toml +# This is a full-line comment +key = "value" # This is a comment at the end of a line +another = "# This is not a comment" +``` + +Control characters other than tab (U+0000 to U+0008, U+000A to U+001F, U+007F) +are not permitted in comments. + +Key/Value Pair +-------------- + +The primary building block of a TOML document is the key/value pair. + +Keys are on the left of the equals sign and values are on the right. Whitespace +is ignored around key names and values. The key, equals sign, and value must be +on the same line (though some values can be broken over multiple lines). + +```toml +key = "value" +``` + +Values must have one of the following types. + +- [String](#user-content-string) +- [Integer](#user-content-integer) +- [Float](#user-content-float) +- [Boolean](#user-content-boolean) +- [Offset Date-Time](#user-content-offset-date-time) +- [Local Date-Time](#user-content-local-date-time) +- [Local Date](#user-content-local-date) +- [Local Time](#user-content-local-time) +- [Array](#user-content-array) +- [Inline Table](#user-content-inline-table) + +Unspecified values are invalid. + +```toml +key = # INVALID +``` + +There must be a newline after a key/value pair. +(See [Inline Table](#user-content-inline-table) for exceptions.) + +``` +first = "Tom" last = "Preston-Werner" # INVALID +``` + +Keys +---- + +A key may be either bare, quoted or dotted. + +**Bare keys** may only contain ASCII letters, ASCII digits, underscores, and +dashes (`A-Za-z0-9_-`). Note that bare keys are allowed to be composed of only +ASCII digits, e.g. `1234`, but are always interpreted as strings. + +```toml +key = "value" +bare_key = "value" +bare-key = "value" +1234 = "value" +``` + +**Quoted keys** follow the exact same rules as either basic strings or literal +strings and allow you to use a much broader set of key names. Best practice is +to use bare keys except when absolutely necessary. + +```toml +"127.0.0.1" = "value" +"character encoding" = "value" +"ʎǝʞ" = "value" +'key2' = "value" +'quoted "value"' = "value" +``` + +A bare key must be non-empty, but an empty quoted key is allowed (though +discouraged). + +```toml += "no key name" # INVALID +"" = "blank" # VALID but discouraged +'' = 'blank' # VALID but discouraged +``` + +**Dotted keys** are a sequence of bare or quoted keys joined with a dot. This +allows for grouping similar properties together: + +```toml +name = "Orange" +physical.color = "orange" +physical.shape = "round" +site."google.com" = true +``` + +In JSON land, that would give you the following structure: + +```json +{ + "name": "Orange", + "physical": { + "color": "orange", + "shape": "round" + }, + "site": { + "google.com": true + } +} +``` + +Whitespace around dot-separated parts is ignored, however, best practice is to +not use any extraneous whitespace. + +Defining a key multiple times is invalid. + +``` +# DO NOT DO THIS +name = "Tom" +name = "Pradyun" +``` + +Since bare keys are allowed to compose of only ASCII integers, it is possible +to write dotted keys that look like floats but are 2-part dotted keys. Don't do +this unless you have a good reason to (you probably don't). + +```toml +3.14159 = "pi" +``` + +The above TOML maps to the following JSON. + +```json +{ "3": { "14159": "pi" } } +``` + +As long as a key hasn't been directly defined, you may still write to it and +to names within it. + +``` +# This makes the key "fruit" into a table. +fruit.apple.smooth = true + +# So then you can add to the table "fruit" like so: +fruit.orange = 2 +``` + +``` +# THE FOLLOWING IS INVALID + +# This defines the value of fruit.apple to be an integer. +fruit.apple = 1 + +# But then this treats fruit.apple like it's a table. +# You can't turn an integer into a table. +fruit.apple.smooth = true +``` + +Defining dotted keys out-of-order is discouraged. + +```toml +# VALID BUT DISCOURAGED + +apple.type = "fruit" +orange.type = "fruit" + +apple.skin = "thin" +orange.skin = "thick" + +apple.color = "red" +orange.color = "orange" +``` + +```toml +# RECOMMENDED + +apple.type = "fruit" +apple.skin = "thin" +apple.color = "red" + +orange.type = "fruit" +orange.skin = "thick" +orange.color = "orange" +``` + +String +------ + +There are four ways to express strings: basic, multi-line basic, literal, and +multi-line literal. All strings must contain only valid UTF-8 characters. + +**Basic strings** are surrounded by quotation marks. Any Unicode character may +be used except those that must be escaped: quotation mark, backslash, and the +control characters other than tab (U+0000 to U+0008, U+000A to U+001F, U+007F). + +```toml +str = "I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF." +``` + +For convenience, some popular characters have a compact escape sequence. + +``` +\b - backspace (U+0008) +\t - tab (U+0009) +\n - linefeed (U+000A) +\f - form feed (U+000C) +\r - carriage return (U+000D) +\" - quote (U+0022) +\\ - backslash (U+005C) +\uXXXX - unicode (U+XXXX) +\UXXXXXXXX - unicode (U+XXXXXXXX) +``` + +Any Unicode character may be escaped with the `\uXXXX` or `\UXXXXXXXX` forms. +The escape codes must be valid Unicode [scalar values](http://unicode.org/glossary/#unicode_scalar_value). + +All other escape sequences not listed above are reserved and, if used, TOML +should produce an error. + +Sometimes you need to express passages of text (e.g. translation files) or would +like to break up a very long string into multiple lines. TOML makes this easy. + +**Multi-line basic strings** are surrounded by three quotation marks on each +side and allow newlines. A newline immediately following the opening delimiter +will be trimmed. All other whitespace and newline characters remain intact. + +```toml +str1 = """ +Roses are red +Violets are blue""" +``` + +TOML parsers should feel free to normalize newline to whatever makes sense for +their platform. + +```toml +# On a Unix system, the above multi-line string will most likely be the same as: +str2 = "Roses are red\nViolets are blue" + +# On a Windows system, it will most likely be equivalent to: +str3 = "Roses are red\r\nViolets are blue" +``` + +For writing long strings without introducing extraneous whitespace, use a "line +ending backslash". When the last non-whitespace character on a line is a `\`, it +will be trimmed along with all whitespace (including newlines) up to the next +non-whitespace character or closing delimiter. All of the escape sequences that +are valid for basic strings are also valid for multi-line basic strings. + +```toml +# The following strings are byte-for-byte equivalent: +str1 = "The quick brown fox jumps over the lazy dog." + +str2 = """ +The quick brown \ + + + fox jumps over \ + the lazy dog.""" + +str3 = """\ + The quick brown \ + fox jumps over \ + the lazy dog.\ + """ +``` + +Any Unicode character may be used except those that must be escaped: backslash +and the control characters other than tab, line feed, and carriage return +(U+0000 to U+0008, U+000B, U+000C, U+000E to U+001F, U+007F). + +You can write a quotation mark, or two adjacent quotation marks, anywhere +inside a multi-line basic string. They can also be written just inside the +delimiters. + +```toml +str4 = """Here are two quotation marks: "". Simple enough.""" +# str5 = """Here are three quotation marks: """.""" # INVALID +str5 = """Here are three quotation marks: ""\".""" +str6 = """Here are fifteen quotation marks: ""\"""\"""\"""\"""\".""" + +# "This," she said, "is just a pointless statement." +str7 = """"This," she said, "is just a pointless statement."""" +``` + +If you're a frequent specifier of Windows paths or regular expressions, then +having to escape backslashes quickly becomes tedious and error prone. To help, +TOML supports literal strings which do not allow escaping at all. + +**Literal strings** are surrounded by single quotes. Like basic strings, they +must appear on a single line: + +```toml +# What you see is what you get. +winpath = 'C:\Users\nodejs\templates' +winpath2 = '\\ServerX\admin$\system32\' +quoted = 'Tom "Dubs" Preston-Werner' +regex = '<\i\c*\s*>' +``` + +Since there is no escaping, there is no way to write a single quote inside a +literal string enclosed by single quotes. Luckily, TOML supports a multi-line +version of literal strings that solves this problem. + +**Multi-line literal strings** are surrounded by three single quotes on each +side and allow newlines. Like literal strings, there is no escaping whatsoever. +A newline immediately following the opening delimiter will be trimmed. All +other content between the delimiters is interpreted as-is without modification. + +```toml +regex2 = '''I [dw]on't need \d{2} apples''' +lines = ''' +The first newline is +trimmed in raw strings. + All other whitespace + is preserved. +''' +``` + +You can write 1 or 2 single quotes anywhere within a multi-line literal string, +but sequences of three or more single quotes are not permitted. + +```toml +quot15 = '''Here are fifteen quotation marks: """""""""""""""''' + +# apos15 = '''Here are fifteen apostrophes: '''''''''''''''''' # INVALID +apos15 = "Here are fifteen apostrophes: '''''''''''''''" + +# 'That's still pointless', she said. +str = ''''That's still pointless', she said.''' +``` + +Control characters other than tab are not permitted in a literal string. Thus, +for binary data it is recommended that you use Base64 or another suitable ASCII +or UTF-8 encoding. The handling of that encoding will be application specific. + +Integer +------- + +Integers are whole numbers. Positive numbers may be prefixed with a plus sign. +Negative numbers are prefixed with a minus sign. + +```toml +int1 = +99 +int2 = 42 +int3 = 0 +int4 = -17 +``` + +For large numbers, you may use underscores between digits to enhance +readability. Each underscore must be surrounded by at least one digit on each +side. + +```toml +int5 = 1_000 +int6 = 5_349_221 +int7 = 1_2_3_4_5 # VALID but discouraged +``` + +Leading zeros are not allowed. Integer values `-0` and `+0` are valid and +identical to an unprefixed zero. + +Non-negative integer values may also be expressed in hexadecimal, octal, or +binary. In these formats, leading `+` is not allowed and leading zeros are +allowed (after the prefix). Hex values are case insensitive. Underscores are +allowed between digits (but not between the prefix and the value). + +```toml +# hexadecimal with prefix `0x` +hex1 = 0xDEADBEEF +hex2 = 0xdeadbeef +hex3 = 0xdead_beef + +# octal with prefix `0o` +oct1 = 0o01234567 +oct2 = 0o755 # useful for Unix file permissions + +# binary with prefix `0b` +bin1 = 0b11010110 +``` + +64 bit (signed long) range expected (−9,223,372,036,854,775,808 to +9,223,372,036,854,775,807). + +Float +----- + +Floats should be implemented as IEEE 754 binary64 values. + +A float consists of an integer part (which follows the same rules as decimal +integer values) followed by a fractional part and/or an exponent part. If both a +fractional part and exponent part are present, the fractional part must precede +the exponent part. + +```toml +# fractional +flt1 = +1.0 +flt2 = 3.1415 +flt3 = -0.01 + +# exponent +flt4 = 5e+22 +flt5 = 1e06 +flt6 = -2E-2 + +# both +flt7 = 6.626e-34 +``` + +A fractional part is a decimal point followed by one or more digits. + +An exponent part is an E (upper or lower case) followed by an integer part +(which follows the same rules as decimal integer values but may include leading +zeros). + +Similar to integers, you may use underscores to enhance readability. Each +underscore must be surrounded by at least one digit. + +```toml +flt8 = 224_617.445_991_228 +``` + +Float values `-0.0` and `+0.0` are valid and should map according to IEEE 754. + +Special float values can also be expressed. They are always lowercase. + +```toml +# infinity +sf1 = inf # positive infinity +sf2 = +inf # positive infinity +sf3 = -inf # negative infinity + +# not a number +sf4 = nan # actual sNaN/qNaN encoding is implementation specific +sf5 = +nan # same as `nan` +sf6 = -nan # valid, actual encoding is implementation specific +``` + +Boolean +------- + +Booleans are just the tokens you're used to. Always lowercase. + +```toml +bool1 = true +bool2 = false +``` + +Offset Date-Time +--------------- + +To unambiguously represent a specific instant in time, you may use an +[RFC 3339](http://tools.ietf.org/html/rfc3339) formatted date-time with offset. + +```toml +odt1 = 1979-05-27T07:32:00Z +odt2 = 1979-05-27T00:32:00-07:00 +odt3 = 1979-05-27T00:32:00.999999-07:00 +``` + +For the sake of readability, you may replace the T delimiter between date and +time with a space (as permitted by RFC 3339 section 5.6). + +```toml +odt4 = 1979-05-27 07:32:00Z +``` + +The precision of fractional seconds is implementation specific, but at least +millisecond precision is expected. If the value contains greater precision than +the implementation can support, the additional precision must be truncated, not +rounded. + +Local Date-Time +-------------- + +If you omit the offset from an [RFC 3339](http://tools.ietf.org/html/rfc3339) +formatted date-time, it will represent the given date-time without any relation +to an offset or timezone. It cannot be converted to an instant in time without +additional information. Conversion to an instant, if required, is implementation +specific. + +```toml +ldt1 = 1979-05-27T07:32:00 +ldt2 = 1979-05-27T00:32:00.999999 +``` + +The precision of fractional seconds is implementation specific, but at least +millisecond precision is expected. If the value contains greater precision than +the implementation can support, the additional precision must be truncated, not +rounded. + +Local Date +---------- + +If you include only the date portion of an +[RFC 3339](http://tools.ietf.org/html/rfc3339) formatted date-time, it will +represent that entire day without any relation to an offset or timezone. + +```toml +ld1 = 1979-05-27 +``` + +Local Time +---------- + +If you include only the time portion of an [RFC +3339](http://tools.ietf.org/html/rfc3339) formatted date-time, it will represent +that time of day without any relation to a specific day or any offset or +timezone. + +```toml +lt1 = 07:32:00 +lt2 = 00:32:00.999999 +``` + +The precision of fractional seconds is implementation specific, but at least +millisecond precision is expected. If the value contains greater precision than +the implementation can support, the additional precision must be truncated, not +rounded. + +Array +----- + +Arrays are square brackets with values inside. Whitespace is ignored. Elements +are separated by commas. Arrays can contain values of the same data types as +allowed in key/value pairs. Values of different types may be mixed. + +```toml +integers = [ 1, 2, 3 ] +colors = [ "red", "yellow", "green" ] +nested_array_of_int = [ [ 1, 2 ], [3, 4, 5] ] +nested_mixed_array = [ [ 1, 2 ], ["a", "b", "c"] ] +string_array = [ "all", 'strings', """are the same""", '''type''' ] + +# Mixed-type arrays are allowed +numbers = [ 0.1, 0.2, 0.5, 1, 2, 5 ] +contributors = [ + "Foo Bar ", + { name = "Baz Qux", email = "bazqux@example.com", url = "https://example.com/bazqux" } +] +``` + +Arrays can span multiple lines. A terminating comma (also called trailing comma) +is ok after the last value of the array. There can be an arbitrary number of +newlines and comments before a value and before the closing bracket. + +```toml +integers2 = [ + 1, 2, 3 +] + +integers3 = [ + 1, + 2, # this is ok +] +``` + +Table +----- + +Tables (also known as hash tables or dictionaries) are collections of key/value +pairs. They appear in square brackets on a line by themselves. You can tell them +apart from arrays because arrays are only ever values. + +```toml +[table] +``` + +Under that, and until the next table or EOF are the key/values of that table. +Key/value pairs within tables are not guaranteed to be in any specific order. + +```toml +[table-1] +key1 = "some string" +key2 = 123 + +[table-2] +key1 = "another string" +key2 = 456 +``` + +Naming rules for tables are the same as for keys (see definition of Keys above). + +```toml +[dog."tater.man"] +type.name = "pug" +``` + +In JSON land, that would give you the following structure: + +```json +{ "dog": { "tater.man": { "type": { "name": "pug" } } } } +``` + +Whitespace around the key is ignored, however, best practice is to not use any +extraneous whitespace. + +```toml +[a.b.c] # this is best practice +[ d.e.f ] # same as [d.e.f] +[ g . h . i ] # same as [g.h.i] +[ j . "ʞ" . 'l' ] # same as [j."ʞ".'l'] +``` + +You don't need to specify all the super-tables if you don't want to. TOML knows +how to do it for you. + +```toml +# [x] you +# [x.y] don't +# [x.y.z] need these +[x.y.z.w] # for this to work + +[x] # defining a super-table afterwards is ok +``` + +Empty tables are allowed and simply have no key/value pairs within them. + +Like keys, you cannot define any table more than once. Doing so is invalid. + +``` +# DO NOT DO THIS + +[fruit] +apple = "red" + +[fruit] +orange = "orange" +``` + +``` +# DO NOT DO THIS EITHER + +[fruit] +apple = "red" + +[fruit.apple] +texture = "smooth" +``` + +Defining tables out-of-order is discouraged. + +```toml +# VALID BUT DISCOURAGED +[fruit.apple] +[animal] +[fruit.orange] +``` + +```toml +# RECOMMENDED +[fruit.apple] +[fruit.orange] +[animal] +``` + +Dotted keys define everything to the left of each dot as a table. Since tables +cannot be defined more than once, redefining such tables using a `[table]` +header is not allowed. Likewise, using dotted keys to redefine tables already +defined in `[table]` form is not allowed. + +The `[table]` form can, however, be used to define sub-tables within tables +defined via dotted keys. + +```toml +[fruit] +apple.color = "red" +apple.taste.sweet = true + +# [fruit.apple] # INVALID +# [fruit.apple.taste] # INVALID + +[fruit.apple.texture] # you can add sub-tables +smooth = true +``` + +Inline Table +------------ + +Inline tables provide a more compact syntax for expressing tables. They are +especially useful for grouped data that can otherwise quickly become verbose. +Inline tables are enclosed in curly braces `{` and `}`. Within the braces, zero +or more comma separated key/value pairs may appear. Key/value pairs take the +same form as key/value pairs in standard tables. All value types are allowed, +including inline tables. + +Inline tables are intended to appear on a single line. A terminating comma (also +called trailing comma) is not permitted after the last key/value pair in an +inline table. No newlines are allowed between the curly braces unless they are +valid within a value. Even so, it is strongly discouraged to break an inline +table onto multiples lines. If you find yourself gripped with this desire, it +means you should be using standard tables. + +```toml +name = { first = "Tom", last = "Preston-Werner" } +point = { x = 1, y = 2 } +animal = { type.name = "pug" } +``` + +The inline tables above are identical to the following standard table +definitions: + +```toml +[name] +first = "Tom" +last = "Preston-Werner" + +[point] +x = 1 +y = 2 + +[animal] +type.name = "pug" + +``` + +Inline tables fully define the keys and sub-tables within them. New keys and +sub-tables cannot be added to them. + +```toml +[product] +type = { name = "Nail" } +# type.edible = false # INVALID +``` + +Similarly, inline tables can not be used to add keys or sub-tables to an +already-defined table. + +```toml +[product] +type.name = "Nail" +# type = { edible = false } # INVALID +``` + +Array of Tables +--------------- + +The last type that has not yet been expressed is an array of tables. These can +be expressed by using a table name in double brackets. Under that, and until the +next table or EOF are the key/values of that table. Each table with the same +double bracketed name will be an element in the array of tables. The tables are +inserted in the order encountered. A double bracketed table without any +key/value pairs will be considered an empty table. + +```toml +[[products]] +name = "Hammer" +sku = 738594937 + +[[products]] + +[[products]] +name = "Nail" +sku = 284758393 + +color = "gray" +``` + +In JSON land, that would give you the following structure. + +```json +{ + "products": [ + { "name": "Hammer", "sku": 738594937 }, + { }, + { "name": "Nail", "sku": 284758393, "color": "gray" } + ] +} +``` + +You can create nested arrays of tables as well. Just use the same double bracket +syntax on sub-tables. Each double-bracketed sub-table will belong to the most +recently defined table element. Normal sub-tables (not arrays) likewise belong +to the most recently defined table element. + +```toml +[[fruit]] + name = "apple" + + [fruit.physical] # subtable + color = "red" + shape = "round" + + [[fruit.variety]] # nested array of tables + name = "red delicious" + + [[fruit.variety]] + name = "granny smith" + +[[fruit]] + name = "banana" + + [[fruit.variety]] + name = "plantain" +``` + +The above TOML maps to the following JSON. + +```json +{ + "fruit": [ + { + "name": "apple", + "physical": { + "color": "red", + "shape": "round" + }, + "variety": [ + { "name": "red delicious" }, + { "name": "granny smith" } + ] + }, + { + "name": "banana", + "variety": [ + { "name": "plantain" } + ] + } + ] +} +``` + +If the parent of a table or array of tables is an array element, that element +must already have been defined before the child can be defined. Attempts to +reverse that ordering must produce an error at parse time. + +``` +# INVALID TOML DOC +[fruit.physical] # subtable, but to which parent element should it belong? + color = "red" + shape = "round" + +[[fruit]] # parser must throw an error upon discovering that "fruit" is + # an array rather than a table + name = "apple" +``` + +Attempting to append to a statically defined array, even if that array is empty +or of compatible type, must produce an error at parse time. + +``` +# INVALID TOML DOC +fruit = [] + +[[fruit]] # Not allowed +``` + +Attempting to define a normal table with the same name as an already established +array must produce an error at parse time. Attempting to redefine a normal table +as an array must likewise produce a parse-time error. + +``` +# INVALID TOML DOC +[[fruit]] + name = "apple" + + [[fruit.variety]] + name = "red delicious" + + # INVALID: This table conflicts with the previous array of tables + [fruit.variety] + name = "granny smith" + + [fruit.physical] + color = "red" + shape = "round" + + # INVALID: This array of tables conflicts with the previous table + [[fruit.physical]] + color = "green" +``` + +You may also use inline tables where appropriate: + +```toml +points = [ { x = 1, y = 2, z = 3 }, + { x = 7, y = 8, z = 9 }, + { x = 2, y = 4, z = 8 } ] +``` + +Filename Extension +------------------ + +TOML files should use the extension `.toml`. + +MIME Type +--------- + +When transferring TOML files over the internet, the appropriate MIME type is +`application/toml`. + +Comparison with Other Formats +----------------------------- + +TOML shares traits with other file formats used for application configuration +and data serialization, such as YAML and JSON. TOML and JSON both are simple and +use ubiquitous data types, making them easy to code for or parse with machines. +TOML and YAML both emphasize human readability features, like comments that make +it easier to understand the purpose of a given line. TOML differs in combining +these, allowing comments (unlike JSON) but preserving simplicity (unlike YAML). + +Because TOML is explicitly intended as a configuration file format, parsing it +is easy, but it is not intended for serializing arbitrary data structures. TOML +always has a hash table at the top level of the file, which can easily have data +nested inside its keys, but it doesn't permit top-level arrays or floats, so it +cannot directly serialize some data. There is also no standard identifying the +start or end of a TOML file, which can complicate sending it through a stream. +These details must be negotiated on the application layer. + +INI files are frequently compared to TOML for their similarities in syntax and +use as configuration files. However, there is no standardized format for INI +and they do not gracefully handle more than one or two levels of nesting. + +Further reading: + * YAML spec: https://yaml.org/spec/1.2/spec.html + * JSON spec: https://tools.ietf.org/html/rfc8259 + * Wikipedia on INI files: https://en.wikipedia.org/wiki/INI_file + +Get Involved +------------ + +Documentation, bug reports, pull requests, and all other contributions +are welcome! + +Wiki +---------------------------------------------------------------------- + +We have an [Official TOML Wiki](https://github.com/toml-lang/toml/wiki) that +catalogs the following: + +* Projects using TOML +* Implementations +* Validators +* Language agnostic test suite for TOML decoders and encoders +* Editor support +* Encoders +* Converters + +Please take a look if you'd like to view or add to that list. Thanks for being +a part of the TOML community!