From b2ffd589614b283c1061059611ecf7327d9d1078 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Sun, 7 Apr 2024 22:18:32 +0200 Subject: [PATCH] Add location information to TOML values, let the parser set it Add a Location primitive to TOML_Value and enhance all TOML_Value constructors so that they can specify a location to assign to created values. Also enhance the parser so that it assigns the right location to each TOML value it creates. --- src/toml-generic_parse.adb | 76 ++++++++++++++------- src/toml.adb | 127 +++++++++++++++++++++++++---------- src/toml.ads | 65 +++++++++++++----- tests/locations/example.toml | 24 +++++++ tests/locations/main.adb | 48 +++++++++++++ tests/locations/test.out | 54 +++++++++++++++ tests/locations/test.yaml | 1 + 7 files changed, 319 insertions(+), 76 deletions(-) create mode 100644 tests/locations/example.toml create mode 100644 tests/locations/main.adb create mode 100644 tests/locations/test.out create mode 100644 tests/locations/test.yaml diff --git a/src/toml-generic_parse.adb b/src/toml-generic_parse.adb index 8bac16c..a40fd31 100644 --- a/src/toml-generic_parse.adb +++ b/src/toml-generic_parse.adb @@ -293,12 +293,14 @@ is function Get_Table (Key : Unbounded_UTF8_String; Table : in out TOML_Value; - Traverse_Arrays : Boolean := False) return Boolean; + Traverse_Arrays : Boolean := False; + Location : Source_Location) return Boolean; -- Look for a sub-table in Table correspondig to Key. On success, store it -- in Table and return True. Otherwise, return False and put an error in -- Result. -- - -- If there is no Key entry in Table, create one and register it. + -- If there is no Key entry in Table, create one with the given location + -- and register it. -- -- If this entry is an array, then assuming all the following hold: -- @@ -323,10 +325,12 @@ is function Parse_Dotted_Keys (Table : in out TOML_Value; Key : out Unbounded_UTF8_String; - Traverse_Arrays : Boolean := False) return Boolean; + Traverse_Arrays : Boolean := False; + Location : Source_Location) return Boolean; -- Parse a sequence of dotted keys and interpret it as a reference into -- Table. Put the last key in Key, and update Table to the referenced table - -- (i.e. the one in which Key will reference/create an entry). + -- (i.e. the one in which Key will reference/create an entry), creating it + -- if needed (and if so, using the given location). -- -- This assumes that the first token that constitutes the dotted keys is in -- Token_Buffer. When this returns, the token just passed the dotted keys @@ -2237,7 +2241,11 @@ is -- the key to insert (Key) and make sure there is no existing -- entry for Key. - if not Parse_Dotted_Keys (Table, Key, Traverse_Arrays => False) + if not Parse_Dotted_Keys + (Table, + Key, + Traverse_Arrays => False, + Location => Token_Buffer.Location) then return False; elsif Table.Has (Key) then @@ -2283,12 +2291,13 @@ is function Get_Table (Key : Unbounded_UTF8_String; Table : in out TOML_Value; - Traverse_Arrays : Boolean := False) return Boolean + Traverse_Arrays : Boolean := False; + Location : Source_Location) return Boolean is Next_Table : TOML_Value := Table.Get_Or_Null (Key); begin if Next_Table.Is_Null then - Next_Table := Create_Table; + Next_Table := Create_Table (Location); Next_Table.Set_Implicitly_Created; Table.Set (Key, Next_Table); Table := Next_Table; @@ -2335,7 +2344,12 @@ is elsif Token_Buffer.EOF then return Create_Syntax_Error; - elsif not Parse_Dotted_Keys (Table, Key, Traverse_Arrays => True) then + elsif not Parse_Dotted_Keys + (Table, + Key, + Traverse_Arrays => True, + Location => Opening_Bracket_Location) + then return False; -- At this point, Parse_Dotted_Keys left the first non-key token in @@ -2365,7 +2379,7 @@ is Arr : TOML_Value := Table.Get_Or_Null (Key); begin if Arr.Is_Null then - Arr := Create_Array; + Arr := Create_Array (Opening_Bracket_Location); Arr.Set_Implicitly_Created; Table.Set (Key, Arr); elsif Arr.Kind /= TOML_Array then @@ -2379,7 +2393,7 @@ is -- Create a new table and append it to this array - Current_Table := Create_Table; + Current_Table := Create_Table (Opening_Bracket_Location); Arr.Append (Current_Table); end; @@ -2400,7 +2414,7 @@ is ("cannot create tables twice", Opening_Bracket_Location); end if; else - Current_Table := Create_Table; + Current_Table := Create_Table (Opening_Bracket_Location); Table.Set (Key, Current_Table); end if; end if; @@ -2415,7 +2429,8 @@ is function Parse_Dotted_Keys (Table : in out TOML_Value; Key : out Unbounded_UTF8_String; - Traverse_Arrays : Boolean := False) return Boolean + Traverse_Arrays : Boolean := False; + Location : Source_Location) return Boolean is Has_Key : Boolean := False; -- Whether we parsed at least one key @@ -2433,7 +2448,9 @@ is -- We are about to parse a key. If we already parsed one, we need to -- fetch the corresponding table. - if Has_Key and then not Get_Table (Key, Table, Traverse_Arrays) then + if Has_Key + and then not Get_Table (Key, Table, Traverse_Arrays, Location) + then return False; end if; Key := Token_Buffer.Token.String_Value; @@ -2471,30 +2488,37 @@ is case Token_Buffer.Token.Kind is when Boolean_Literal => - Value := Create_Boolean (Token_Buffer.Token.Boolean_Value); + Value := Create_Boolean + (Token_Buffer.Token.Boolean_Value, Token_Buffer.Location); when Integer_Literal => - Value := Create_Integer (Token_Buffer.Token.Integer_Value); + Value := Create_Integer + (Token_Buffer.Token.Integer_Value, Token_Buffer.Location); when Float_Literal => - Value := Create_Float (Token_Buffer.Token.Float_Value); + Value := Create_Float + (Token_Buffer.Token.Float_Value, Token_Buffer.Location); when String_Literal => - Value := Create_String (Token_Buffer.Token.String_Value); + Value := Create_String + (Token_Buffer.Token.String_Value, Token_Buffer.Location); when Offset_Datetime_Literal => Value := Create_Offset_Datetime - (Token_Buffer.Token.Offset_Datetime_Value); + (Token_Buffer.Token.Offset_Datetime_Value, + Token_Buffer.Location); when Local_Datetime_Literal => Value := Create_Local_Datetime - (Token_Buffer.Token.Local_Datetime_Value); + (Token_Buffer.Token.Local_Datetime_Value, Token_Buffer.Location); when Local_Date_Literal => - Value := Create_Local_Date (Token_Buffer.Token.Local_Date_Value); + Value := Create_Local_Date + (Token_Buffer.Token.Local_Date_Value, Token_Buffer.Location); when Local_Time_Literal => - Value := Create_Local_Time (Token_Buffer.Token.Local_Time_Value); + Value := Create_Local_Time + (Token_Buffer.Token.Local_Time_Value, Token_Buffer.Location); when Square_Bracket_Open => return Parse_Array (Value); @@ -2517,7 +2541,7 @@ is function Parse_Array (Value : out TOML_Value) return Boolean is Comma_Allowed : Boolean := False; begin - Value := Create_Array; + Value := Create_Array (Token_Buffer.Location); loop -- Fetch the next token. We need one, so reaching end of stream is a @@ -2588,7 +2612,7 @@ is Key : Unbounded_UTF8_String; Table : TOML_Value; begin - Value := Create_Table; + Value := Create_Table (Token_Buffer.Location); loop -- Fetch the next token (a potential key for the next table entry, or @@ -2634,7 +2658,11 @@ is -- followed by an equal token. Table := Value; - if not Parse_Dotted_Keys (Table, Key, Traverse_Arrays => False) + if not Parse_Dotted_Keys + (Table, + Key, + Traverse_Arrays => False, + Location => Token_Buffer.Location) then return False; elsif Token_Buffer.EOF or else Token_Buffer.Token.Kind /= Equal diff --git a/src/toml.adb b/src/toml.adb index 0011558..b2fb24b 100644 --- a/src/toml.adb +++ b/src/toml.adb @@ -30,6 +30,7 @@ package body TOML is type TOML_Value_Record (Kind : Any_Value_Kind) is limited record Ref_Count : Natural; + Location : Source_Location; case Kind is when TOML_Table => @@ -104,6 +105,26 @@ package body TOML is Location => Location); end Create_Error; + --------------------- + -- Format_Location -- + --------------------- + + function Format_Location (Location : Source_Location) return String is + begin + if Location.Line = 0 then + return ""; + end if; + + declare + L : constant String := Location.Line'Image; + C : constant String := Location.Column'Image; + begin + return L (L'First + 1 .. L'Last) + & ":" + & C (C'First + 1 .. C'Last); + end; + end Format_Location; + ------------- -- Is_Null -- ------------- @@ -196,50 +217,61 @@ package body TOML is return True; end Equals; + -------------- + -- Location -- + -------------- + + function Location (Value : TOML_Value) return Source_Location is + begin + return Value.Value.Location; + end Location; + ----------- -- Clone -- ----------- function Clone (Value : TOML_Value) return TOML_Value is Result : TOML_Value; + Loc : constant Source_Location := Location (Value); begin case Value.Kind is when TOML_Table => - Result := Create_Table; + Result := Create_Table (Loc); for Key of Value.Keys loop Result.Set (Key, Value.Get (Key).Clone); end loop; when TOML_Array => - Result := Create_Array; + Result := Create_Array (Loc); for I in 1 .. Value.Length loop Result.Append (Value.Item (I)); end loop; when TOML_String => - Result := Create_String (Value.Value.String_Value); + Result := Create_String (Value.Value.String_Value, Loc); when TOML_Integer => - Result := Create_Integer (Value.Value.Integer_Value); + Result := Create_Integer (Value.Value.Integer_Value, Loc); when TOML_Boolean => - Result := Create_Boolean (Value.Value.Boolean_Value); + Result := Create_Boolean (Value.Value.Boolean_Value, Loc); when TOML_Offset_Datetime => Result := - Create_Offset_Datetime (Value.Value.Offset_Datetime_Value); + Create_Offset_Datetime (Value.Value.Offset_Datetime_Value, Loc); when TOML_Local_Datetime => - Result := Create_Local_Datetime (Value.Value.Local_Datetime_Value); + Result := Create_Local_Datetime + (Value.Value.Local_Datetime_Value, Loc); when TOML_Local_Date => - Result := Create_Local_Date (Value.Value.Local_Date_Value); + Result := Create_Local_Date (Value.Value.Local_Date_Value, Loc); when TOML_Local_Time => - Result := Create_Local_Time (Value.Value.Local_Time_Value); + Result := Create_Local_Time (Value.Value.Local_Time_Value, Loc); when TOML_Float => - Result := Create_Float (Value.Value.Float_Value); + Result := Create_Float (Value.Value.Float_Value, Loc); end case; return Result; @@ -445,50 +477,70 @@ package body TOML is -- Create_Boolean -- -------------------- - function Create_Boolean (Value : Boolean) return TOML_Value is + function Create_Boolean + (Value : Boolean; + Location : Source_Location := No_Location) return TOML_Value is begin return Create_Value (new TOML_Value_Record' - (Kind => TOML_Boolean, Ref_Count => 1, Boolean_Value => Value)); + (Kind => TOML_Boolean, + Ref_Count => 1, + Location => Location, + Boolean_Value => Value)); end Create_Boolean; -------------------- -- Create_Integer -- -------------------- - function Create_Integer (Value : Any_Integer) return TOML_Value is + function Create_Integer + (Value : Any_Integer; + Location : Source_Location := No_Location) return TOML_Value is begin return Create_Value (new TOML_Value_Record' - (Kind => TOML_Integer, Ref_Count => 1, Integer_Value => Value)); + (Kind => TOML_Integer, + Ref_Count => 1, + Location => Location, + Integer_Value => Value)); end Create_Integer; ------------------ -- Create_Float -- ------------------ - function Create_Float (Value : Any_Float) return TOML_Value is + function Create_Float + (Value : Any_Float; + Location : Source_Location := No_Location) return TOML_Value is begin return Create_Value (new TOML_Value_Record' - (Kind => TOML_Float, Ref_Count => 1, Float_Value => Value)); + (Kind => TOML_Float, + Ref_Count => 1, + Location => Location, + Float_Value => Value)); end Create_Float; ------------------- -- Create_String -- ------------------- - function Create_String (Value : String) return TOML_Value is + function Create_String + (Value : String; + Location : Source_Location := No_Location) return TOML_Value is begin - return Create_String (To_Unbounded_String (Value)); + return Create_String (To_Unbounded_String (Value), Location); end Create_String; ------------------- -- Create_String -- ------------------- - function Create_String (Value : Unbounded_UTF8_String) return TOML_Value is + function Create_String + (Value : Unbounded_UTF8_String; + Location : Source_Location := No_Location) return TOML_Value is begin return Create_Value (new TOML_Value_Record' (Kind => TOML_String, Ref_Count => 1, + Location => Location, String_Value => Value)); end Create_String; @@ -497,11 +549,13 @@ package body TOML is ---------------------------- function Create_Offset_Datetime - (Value : Any_Offset_Datetime) return TOML_Value is + (Value : Any_Offset_Datetime; + Location : Source_Location := No_Location) return TOML_Value is begin return Create_Value (new TOML_Value_Record' (Kind => TOML_Offset_Datetime, Ref_Count => 1, + Location => Location, Offset_Datetime_Value => Value)); end Create_Offset_Datetime; @@ -510,11 +564,13 @@ package body TOML is --------------------------- function Create_Local_Datetime - (Value : Any_Local_Datetime) return TOML_Value is + (Value : Any_Local_Datetime; + Location : Source_Location := No_Location) return TOML_Value is begin return Create_Value (new TOML_Value_Record' (Kind => TOML_Local_Datetime, Ref_Count => 1, + Location => Location, Local_Datetime_Value => Value)); end Create_Local_Datetime; @@ -522,11 +578,14 @@ package body TOML is -- Create_Local_Date -- ----------------------- - function Create_Local_Date (Value : Any_Local_Date) return TOML_Value is + function Create_Local_Date + (Value : Any_Local_Date; + Location : Source_Location := No_Location) return TOML_Value is begin return Create_Value (new TOML_Value_Record' (Kind => TOML_Local_Date, Ref_Count => 1, + Location => Location, Local_Date_Value => Value)); end Create_Local_Date; @@ -534,11 +593,14 @@ package body TOML is -- Create_Local_Time -- ----------------------- - function Create_Local_Time (Value : Any_Local_Time) return TOML_Value is + function Create_Local_Time + (Value : Any_Local_Time; + Location : Source_Location := No_Location) return TOML_Value is begin return Create_Value (new TOML_Value_Record' (Kind => TOML_Local_Time, Ref_Count => 1, + Location => Location, Local_Time_Value => Value)); end Create_Local_Time; @@ -546,11 +608,13 @@ package body TOML is -- Create_Table -- ------------------ - function Create_Table return TOML_Value is + function Create_Table + (Location : Source_Location := No_Location) return TOML_Value is begin return Create_Value (new TOML_Value_Record' (Kind => TOML_Table, Ref_Count => 1, + Location => Location, Map_Value => <>, Table_Implicitly_Created => False)); end Create_Table; @@ -671,11 +735,13 @@ package body TOML is -- Create_Array -- ------------------ - function Create_Array return TOML_Value is + function Create_Array + (Location : Source_Location := No_Location) return TOML_Value is begin return Create_Value (new TOML_Value_Record' (Kind => TOML_Array, Ref_Count => 1, + Location => Location, Array_Value => <>, Array_Implicitly_Created => False)); end Create_Array; @@ -779,15 +845,8 @@ package body TOML is Formatted : Unbounded_UTF8_String; begin if Result.Location.Line /= 0 then - declare - L : constant String := Result.Location.Line'Image; - C : constant String := Result.Location.Column'Image; - begin - Append (Formatted, L (L'First + 1 .. L'Last)); - Append (Formatted, ":"); - Append (Formatted, C (C'First + 1 .. C'Last)); - Append (Formatted, ": "); - end; + Append (Formatted, Format_Location (Result.Location)); + Append (Formatted, ": "); end if; Append (Formatted, Result.Message); diff --git a/src/toml.ads b/src/toml.ads index c304bef..fad5d5d 100644 --- a/src/toml.ads +++ b/src/toml.ads @@ -96,6 +96,17 @@ package TOML with Preelaborate is with Dynamic_Predicate => not Any_Offset_Datetime.Unknown_Offset or else Any_Offset_Datetime.Offset = 0; + type Source_Location is record + Line, Column : Natural; + end record; + -- Source location inside a TOML document + + No_Location : constant Source_Location := (0, 0); + + function Format_Location (Location : Source_Location) return String; + -- Format the given location into the "LINE:COLUMN" format, or an empty + -- string if it is No_Location. + ----------------------- -- Generic accessors -- ----------------------- @@ -116,7 +127,13 @@ package TOML with Preelaborate is -- -- Note that this is very different from the built-in "=" operator: -- the TOML_Value type has by-reference meaning, so "=" compares identity, - -- not structural equivalence. + -- not structural equivalence. Also note that source locations are ignored + -- for equivalence checks. + + function Location (Value : TOML_Value) return Source_Location + with Pre => Value.Is_Present; + -- Return the first source location that triggered the creation of Value + -- while parsing a TOML document. Return No_Location if unknown. function Clone (Value : TOML_Value) return TOML_Value with Pre => Value.Is_Present; @@ -233,51 +250,67 @@ package TOML with Preelaborate is -- Atom creators -- ------------------- - function Create_Boolean (Value : Boolean) return TOML_Value + function Create_Boolean + (Value : Boolean; + Location : Source_Location := No_Location) return TOML_Value with Post => Create_Boolean'Result.Kind = TOML_Boolean and then Create_Boolean'Result.As_Boolean = Value; -- Create a TOML boolean value - function Create_Integer (Value : Any_Integer) return TOML_Value + function Create_Integer + (Value : Any_Integer; + Location : Source_Location := No_Location) return TOML_Value with Post => Create_Integer'Result.Kind = TOML_Integer and then Create_Integer'Result.As_Integer = Value; -- Create a TOML integer value - function Create_Float (Value : Any_Float) return TOML_Value + function Create_Float + (Value : Any_Float; + Location : Source_Location := No_Location) return TOML_Value with Post => Create_Float'Result.Kind = TOML_Float and then Create_Float'Result.As_Float = Value; -- Create a TOML integer value - function Create_String (Value : String) return TOML_Value + function Create_String + (Value : String; + Location : Source_Location := No_Location) return TOML_Value with Post => Create_String'Result.Kind = TOML_String and then Create_String'Result.As_String = Value; -- Create a TOML string value. Value must be a valid UTF-8 string. - function Create_String (Value : Unbounded_UTF8_String) return TOML_Value + function Create_String + (Value : Unbounded_UTF8_String; + Location : Source_Location := No_Location) return TOML_Value with Post => Create_String'Result.Kind = TOML_String and then Create_String'Result.As_Unbounded_String = Value; -- Create a TOML string value function Create_Offset_Datetime - (Value : Any_Offset_Datetime) return TOML_Value + (Value : Any_Offset_Datetime; + Location : Source_Location := No_Location) return TOML_Value with Post => Create_Offset_Datetime'Result.Kind = TOML_Offset_Datetime and then Create_Offset_Datetime'Result.As_Offset_Datetime = Value; -- Create a TOML offset datetime value function Create_Local_Datetime - (Value : Any_Local_Datetime) return TOML_Value + (Value : Any_Local_Datetime; + Location : Source_Location := No_Location) return TOML_Value with Post => Create_Local_Datetime'Result.Kind = TOML_Local_Datetime and then Create_Local_Datetime'Result.As_Local_Datetime = Value; -- Create a TOML local datetime value - function Create_Local_Date (Value : Any_Local_Date) return TOML_Value + function Create_Local_Date + (Value : Any_Local_Date; + Location : Source_Location := No_Location) return TOML_Value with Post => Create_Local_Date'Result.Kind = TOML_Local_Date and then Create_Local_Date'Result.As_Local_Date = Value; -- Create a TOML local date value - function Create_Local_Time (Value : Any_Local_Time) return TOML_Value + function Create_Local_Time + (Value : Any_Local_Time; + Location : Source_Location := No_Location) return TOML_Value with Post => Create_Local_Time'Result.Kind = TOML_Local_Time and then Create_Local_Time'Result.As_Local_Time = Value; -- Create a TOML local date value @@ -286,7 +319,8 @@ package TOML with Preelaborate is -- Table modifiers -- --------------------- - function Create_Table return TOML_Value + function Create_Table + (Location : Source_Location := No_Location) return TOML_Value with Post => Create_Table'Result.Kind = TOML_Table; -- Create an empty TOML table @@ -345,7 +379,8 @@ package TOML with Preelaborate is -- Array modifiers -- --------------------- - function Create_Array return TOML_Value + function Create_Array + (Location : Source_Location := No_Location) return TOML_Value with Post => Create_Array'Result.Kind = TOML_Array; -- Create a TOML array @@ -366,12 +401,6 @@ package TOML with Preelaborate is -- Input/Output -- ------------------ - type Source_Location is record - Line, Column : Natural; - end record; - - No_Location : constant Source_Location := (0, 0); - -- Result of TOML document parsing. If the parsing was successful, contains -- the corresponding TOML value, otherwise, contains an error message that -- describes why parsing failed. diff --git a/tests/locations/example.toml b/tests/locations/example.toml new file mode 100644 index 0000000..5764559 --- /dev/null +++ b/tests/locations/example.toml @@ -0,0 +1,24 @@ +[[bar.array]] +a = true + +[foo] +bool = false +int = 12 +float = 0.98e12 +string = "bar" +multiline_string = """ + blip + blop +""" +local_date = 2134-01-19 +local_time = 12:34:56 +local_datetime = 2134-01-19 12:34:56 +offset_datetime = 2134-01-19 12:34:56+02:00 + +inline_arrays = [ + 1, 2, [3, + 4], 5 +] +inline_table = { foo = 1, bar = {a = 2, b = 3} } +dotted.keys.a = 1 +dotted.keys.b = 2 diff --git a/tests/locations/main.adb b/tests/locations/main.adb new file mode 100644 index 0000000..39c5efa --- /dev/null +++ b/tests/locations/main.adb @@ -0,0 +1,48 @@ +with Ada.Strings.Unbounded; +with Ada.Text_IO; + +with TOML; +with TOML.File_IO; + +procedure Main is + package TIO renames Ada.Text_IO; + + procedure Process (Value : TOML.TOML_Value; Prefix : String); + + ------------- + -- Process -- + ------------- + + procedure Process (Value : TOML.TOML_Value; Prefix : String) is + K : constant TOML.Any_Value_Kind := Value.Kind; + begin + TIO.Put (Prefix & "* " & K'Image); + if Value.Location.Line = 0 then + TIO.Put_Line (" [no location]"); + else + TIO.Put_Line (" at " & TOML.Format_Location (Value.Location)); + end if; + case K is + when TOML.TOML_Table => + for E of Value.Iterate_On_Table loop + TIO.Put_Line + (Prefix + & " " & Ada.Strings.Unbounded.To_String (E.Key) & ":"); + Process (E.Value, Prefix & " "); + end loop; + + when TOML.TOML_Array => + for I in 1 .. Value.Length loop + Process (Value.Item (I), Prefix & " "); + end loop; + + when others => + null; + end case; + end Process; + + Value : constant TOML.TOML_Value := + TOML.File_IO.Load_File ("example.toml").Value; +begin + Process (Value, ""); +end Main; diff --git a/tests/locations/test.out b/tests/locations/test.out new file mode 100644 index 0000000..efd9e76 --- /dev/null +++ b/tests/locations/test.out @@ -0,0 +1,54 @@ +* TOML_TABLE [no location] + bar: + * TOML_TABLE at 1:1 + array: + * TOML_ARRAY at 1:1 + * TOML_TABLE at 1:1 + a: + * TOML_BOOLEAN at 2:5 + foo: + * TOML_TABLE at 4:1 + bool: + * TOML_BOOLEAN at 5:8 + dotted: + * TOML_TABLE at 23:1 + keys: + * TOML_TABLE at 23:1 + a: + * TOML_INTEGER at 23:17 + b: + * TOML_INTEGER at 24:17 + float: + * TOML_FLOAT at 7:9 + inline_arrays: + * TOML_ARRAY at 18:17 + * TOML_INTEGER at 19:4 + * TOML_INTEGER at 19:7 + * TOML_ARRAY at 19:10 + * TOML_INTEGER at 19:12 + * TOML_INTEGER at 20:4 + * TOML_INTEGER at 20:8 + inline_table: + * TOML_TABLE at 22:16 + bar: + * TOML_TABLE at 22:33 + a: + * TOML_INTEGER at 22:38 + b: + * TOML_INTEGER at 22:45 + foo: + * TOML_INTEGER at 22:24 + int: + * TOML_INTEGER at 6:7 + local_date: + * TOML_LOCAL_DATE at 13:14 + local_datetime: + * TOML_LOCAL_DATETIME at 15:18 + local_time: + * TOML_LOCAL_TIME at 14:14 + multiline_string: + * TOML_STRING at 9:20 + offset_datetime: + * TOML_OFFSET_DATETIME at 16:19 + string: + * TOML_STRING at 8:10 diff --git a/tests/locations/test.yaml b/tests/locations/test.yaml new file mode 100644 index 0000000..89ee1c0 --- /dev/null +++ b/tests/locations/test.yaml @@ -0,0 +1 @@ +driver: run-program