[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/wisi b15b60a 1/2: Publish wisi version 3.1.3
From: |
Stephen Leake |
Subject: |
[elpa] externals/wisi b15b60a 1/2: Publish wisi version 3.1.3 |
Date: |
Mon, 26 Jul 2021 20:33:24 -0400 (EDT) |
branch: externals/wisi
commit b15b60abfb4c703730a0976dd88372996c52aa97
Author: Stephen Leake <stephen_leake@stephe-leake.org>
Commit: Stephen Leake <stephen_leake@stephe-leake.org>
Publish wisi version 3.1.3
* README: Bump version.
* gen_emacs_wisi_packrat_parse.adb: Delete.
* gen_emacs_wisi_packrat_parse.ads: Delete.
* gen_run_wisi_libadalang_parse.adb: Delete.
* gen_run_wisi_libadalang_parse.ads: Delete.
* gen_run_wisi_packrat_parse.adb: Delete.
* gen_run_wisi_packrat_parse.ads: Delete.
* sal-gen_unbounded_definite_red_black_trees.adb (): Change WORKAROUND
default to match gnat community 2020.
* wisi.el: Bump version.
* wisi.texi: Bump version.
---
README | 2 +-
gen_emacs_wisi_packrat_parse.adb | 180 ------------------
gen_emacs_wisi_packrat_parse.ads | 42 -----
gen_run_wisi_libadalang_parse.adb | 176 ------------------
gen_run_wisi_libadalang_parse.ads | 30 ---
gen_run_wisi_packrat_parse.adb | 241 -------------------------
gen_run_wisi_packrat_parse.ads | 36 ----
sal-gen_unbounded_definite_red_black_trees.adb | 17 +-
wisi.el | 4 +-
wisi.texi | 6 +-
10 files changed, 15 insertions(+), 719 deletions(-)
diff --git a/README b/README
index 5898d91..7e3ef01 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-Emacs wisi package 3.1.2
+Emacs wisi package 3.1.3
The wisi package provides utilities for using generalized
error-correcting LR parsers (in external processes) to do indentation,
diff --git a/gen_emacs_wisi_packrat_parse.adb b/gen_emacs_wisi_packrat_parse.adb
deleted file mode 100644
index b4e95f6..0000000
--- a/gen_emacs_wisi_packrat_parse.adb
+++ /dev/null
@@ -1,180 +0,0 @@
--- Abstract :
---
--- See spec.
---
--- Copyright (C) 2018 All Rights Reserved.
---
--- This program is free software; you can redistribute it and/or
--- modify it under terms of the GNU General Public License as
--- published by the Free Software Foundation; either version 3, or (at
--- your option) any later version. This program is distributed in the
--- hope that it will be useful, but WITHOUT ANY WARRANTY; without even
--- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
--- PURPOSE. See the GNU General Public License for more details. You
--- should have received a copy of the GNU General Public License
--- distributed with this program; see file COPYING. If not, write to
--- the Free Software Foundation, 51 Franklin Street, Suite 500, Boston,
--- MA 02110-1335, USA.
-
-pragma License (GPL);
-
-with Ada.Command_Line;
-with Ada.Exceptions;
-with Ada.Strings.Fixed;
-with Ada.Strings.Unbounded;
-with Ada.Text_IO; use Ada.Text_IO;
-with Emacs_Wisi_Common_Parse; use Emacs_Wisi_Common_Parse;
-with GNAT.OS_Lib;
-with GNAT.Traceback.Symbolic;
-with System.Storage_Elements;
-with WisiToken.Lexer;
-with WisiToken.Parse.Packrat;
-with WisiToken.Text_IO_Trace;
-procedure Gen_Emacs_Wisi_Parse_Packrat
-is
- use WisiToken; -- "+", "-" Unbounded_string
-
- Trace : aliased WisiToken.Text_IO_Trace.Trace (Descriptor'Access);
- Parser : WisiToken.Parse.Packrat.Parser;
- Parse_Data : aliased Parse_Data_Type (Parser.Line_Begin_Token'Access);
-
-begin
- Create_Parser (Parser, Trace'Unrestricted_Access,
Parse_Data'Unchecked_Access);
-
- declare
- use Ada.Command_Line;
- begin
- case Argument_Count is
- when 0 =>
- null;
-
- when others =>
- Usage (Name);
- raise Programmer_Error with "invalid option count: " & Integer'Image
(Argument_Count);
- end case;
- end;
-
- Put_Line (Name & " " & Version & ", protocol version " & Protocol_Version);
-
- -- Read commands and tokens from standard_input via GNAT.OS_Lib,
- -- send results to standard_output.
- loop
- Put (Prompt); Flush;
- declare
- Command_Length : constant Integer := Get_Command_Length;
- Command_Line : aliased String (1 .. Command_Length);
- Last : Integer;
-
- function Match (Target : in String) return Boolean
- is begin
- Last := Command_Line'First + Target'Length - 1;
- return Last <= Command_Line'Last and then Command_Line
(Command_Line'First .. Last) = Target;
- end Match;
- begin
- Read_Input (Command_Line'Address, Command_Length);
-
- Put_Line (";; " & Command_Line);
-
- if Match ("parse") then
- -- Args: see Usage
- -- Input: <source text>
- -- Response:
- -- [response elisp vector]...
- -- [elisp error form]...
- -- prompt
- declare
- use Wisi;
- Cl_Params : constant Command_Line_Params := Get_Cl_Params
(Command_Line, Last);
- Buffer : Ada.Strings.Unbounded.String_Access;
-
- procedure Clean_Up
- is begin
- Parser.Lexer.Discard_Rest_Of_Input;
- Parser.Put_Errors (-Cl_Param.Source_File_Name);
- Ada.Strings.Unbounded.Free (Buffer);
- end Clean_Up;
-
- begin
- -- Computing Line_Count in elisp allows parsing in parallel
with
- -- sending source text.
-
- Trace_Parse := Cl_Params.Parse_Verbosity;
- Trace_McKenzie := Cl_Params.McKenzie_Verbosity;
- Trace_Action := Cl_Params.Action_Verbosity;
- Debug_Mode := Cl_Params.Debug_Mode;
-
- Parse_Data.Initialize
- (Post_Parse_Action => Cl_Params.Post_Parse_Action,
- Descriptor => Descriptor'Access,
- Source_File_Name => -Cl_Params.Source_File_Name,
- Line_Count => Cl_Params.Line_Count,
- Params => Command_Line (Last + 2 ..
Command_Line'Last));
-
- Buffer := new String (1 .. Cl_Params.Byte_Count);
- Read_Input (Buffer (1)'Address, Cl_Params.Byte_Count);
-
- Parser.Lexer.Reset_With_String_Access (Buffer);
- Parser.Parse;
- Parser.Execute_Actions;
- Put (Parse_Data);
- Clean_Up;
-
- exception
- when Syntax_Error =>
- Clean_Up;
- Put_Line ("(parse_error)");
-
- when E : Parse_Error =>
- Clean_Up;
- Put_Line ("(parse_error """ & Ada.Exceptions.Exception_Message
(E) & """)");
-
- when E : Fatal_Error =>
- Clean_Up;
- Put_Line ("(error """ & Ada.Exceptions.Exception_Message (E) &
""")");
- end;
-
- elsif Match ("noop") then
- -- Args: <source byte count>
- -- Input: <source text>
- -- Response: prompt
- declare
- Byte_Count : constant Integer :=
Get_Integer (Command_Line, Last);
- Buffer : constant Ada.Strings.Unbounded.String_Access :=
new String (1 .. Byte_Count);
- Token : Base_Token;
- Lexer_Error : Boolean;
- pragma Unreferenced (Lexer_Error);
- begin
- Token.ID := Invalid_Token_ID;
- Read_Input (Buffer (1)'Address, Byte_Count);
-
- Parser.Lexer.Reset_With_String_Access (Buffer);
- loop
- exit when Token.ID = Parser.Trace.Descriptor.EOF_ID;
- Lexer_Error := Parser.Lexer.Find_Next (Token);
- end loop;
- exception
- when Syntax_Error =>
- Parser.Lexer.Discard_Rest_Of_Input;
- end;
-
- elsif Match ("quit") then
- exit;
-
- else
- Put_Line ("(error ""bad command: '" & Command_Line & "'"")");
- end if;
- exception
- when E : Protocol_Error =>
- -- don't exit the loop; allow debugging bad elisp
- Put_Line ("(error ""protocol error "": " &
Ada.Exceptions.Exception_Message (E) & """)");
- end;
- end loop;
-exception
-when E : others =>
- Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
- New_Line (2);
- Put_Line
- ("(error ""unhandled exception: " & Ada.Exceptions.Exception_Name (E) &
": " &
- Ada.Exceptions.Exception_Message (E) & """)");
- Put_Line (GNAT.Traceback.Symbolic.Symbolic_Traceback (E));
-end Gen_Emacs_Wisi_Parse_Packrat;
diff --git a/gen_emacs_wisi_packrat_parse.ads b/gen_emacs_wisi_packrat_parse.ads
deleted file mode 100644
index 79c69ec..0000000
--- a/gen_emacs_wisi_packrat_parse.ads
+++ /dev/null
@@ -1,42 +0,0 @@
--- Abstract :
---
--- Generic Emacs background process; packrat parse token stream,
--- return parser actions.
---
--- See gen_run_wisi_parse_packrat.ads for a standalone version.
---
--- References :
---
--- See gen_emacs_wisi_parse.ads
---
--- Copyright (C) 2018 Free Software Foundation, Inc.
---
--- This program is free software; you can redistribute it and/or
--- modify it under terms of the GNU General Public License as
--- published by the Free Software Foundation; either version 3, or (at
--- your option) any later version. This program is distributed in the
--- hope that it will be useful, but WITHOUT ANY WARRANTY; without even
--- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
--- PURPOSE. See the GNU General Public License for more details. You
--- should have received a copy of the GNU General Public License
--- distributed with this program; see file COPYING. If not, write to
--- the Free Software Foundation, 51 Franklin Street, Suite 500, Boston,
--- MA 02110-1335, USA.
-
-pragma License (GPL);
-
-with WisiToken.Parse.Packrat;
-with WisiToken.Syntax_Trees;
-with WisiToken.Wisi_Runtime;
-generic
- type Parse_Data_Type is new WisiToken.Wisi_Runtime.Parse_Data_Type with
private;
-
- Name : in String; -- for Usage, error messages.
"_wisi_parse_packrat" will be appended
- Descriptor : in WisiToken.Descriptor;
-
- with procedure Create_Parser
- (Parser : out WisiToken.Parse.Packrat.Parser;
- Trace : not null access WisiToken.Trace'Class;
- User_Data : in WisiToken.Syntax_Trees.User_Data_Access);
-
-procedure Gen_Emacs_Wisi_Parse_Packrat;
diff --git a/gen_run_wisi_libadalang_parse.adb
b/gen_run_wisi_libadalang_parse.adb
deleted file mode 100644
index c154136..0000000
--- a/gen_run_wisi_libadalang_parse.adb
+++ /dev/null
@@ -1,176 +0,0 @@
--- Abstract :
---
--- See spec.
---
--- Copyright (C) 2018 All Rights Reserved.
---
--- This program is free software; you can redistribute it and/or
--- modify it under terms of the GNU General Public License as
--- published by the Free Software Foundation; either version 3, or (at
--- your option) any later version. This program is distributed in the
--- hope that it will be useful, but WITHOUT ANY WARRANTY; without even
--- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
--- PURPOSE. See the GNU General Public License for more details. You
--- should have received a copy of the GNU General Public License
--- distributed with this program; see file COPYING. If not, write to
--- the Free Software Foundation, 51 Franklin Street, Suite 500, Boston,
--- MA 02110-1335, USA.
-
-pragma License (GPL);
-
-with Ada.Command_Line;
-with Ada.Exceptions;
-with Ada.Real_Time;
-with Ada.Strings.Unbounded;
-with Ada.Text_IO; use Ada.Text_IO;
-with GNAT.Traceback.Symbolic;
-with Wisi.Libadalang;
-with WisiToken.Text_IO_Trace;
-procedure Gen_Run_Wisi_Libadalang_Parse
-is
- use WisiToken; -- Token_ID, "+", "-" Unbounded_string
-
- Trace : aliased WisiToken.Text_IO_Trace.Trace
(Descriptor'Unrestricted_Access);
- Parser : Wisi.Libadalang.Parser;
- Parse_Data : aliased Parse_Data_Type (Parser.Line_Begin_Token'Access);
-
- procedure Put_Usage
- is begin
- Put_Line ("usage: <file_name> <parse_action> [options]");
- Put_Line ("parse_action: {Navigate | Face | Indent}");
- Put_Line ("options:");
- Put_Line ("--verbosity n m : parse, action");
- Put_Line ("--lang_params <language-specific params>");
- Put_Line ("--repeat_count n : repeat parse count times, for profiling;
default 1");
- New_Line;
- end Put_Usage;
-
- Source_File_Name : Ada.Strings.Unbounded.Unbounded_String;
- Post_Parse_Action : Wisi.Post_Parse_Action_Type;
- Lang_Params : Ada.Strings.Unbounded.Unbounded_String;
-
- Repeat_Count : Integer := 1;
- Arg : Integer;
- Start : Ada.Real_Time.Time;
-
-begin
- declare
- use Ada.Command_Line;
- begin
- if Argument_Count < 1 then
- Put_Usage;
- Set_Exit_Status (Failure);
- return;
- end if;
-
- Source_File_Name := +Ada.Command_Line.Argument (1);
- Post_Parse_Action := Wisi.Post_Parse_Action_Type'Value
(Ada.Command_Line.Argument (2));
- Arg := 3;
-
- loop
- exit when Arg > Argument_Count;
-
- if Argument (Arg) = "--lang_params" then
- Lang_Params := +Argument (Arg + 1);
- Arg := Arg + 2;
-
- elsif Argument (Arg) = "--repeat_count" then
- Repeat_Count := Integer'Value (Argument (Arg + 1));
- Arg := Arg + 2;
-
- elsif Argument (Arg) = "--verbosity" then
- WisiToken.Trace_Parse := Integer'Value (Argument (Arg + 1));
- WisiToken.Trace_Action := Integer'Value (Argument (Arg + 2));
- Arg := Arg + 3;
-
- else
- Put_Line ("unrecognized option: '" & Argument (Arg) & "'");
- Put_Usage;
- return;
- end if;
- end loop;
- end;
-
- Parser.Trace := Trace'Unrestricted_Access;
- Parser.Lexer := new Wisi.Libadalang.Lexer
(Trace'Unrestricted_Access);
- Parser.User_Data := Parse_Data'Unrestricted_Access;
- Parser.Source_File_Name := Source_File_Name;
-
- Parser.Tree.Initialize (Shared_Tree =>
Parser.Base_Tree'Unrestricted_Access, Flush => True);
-
- Parse_Data.Initialize
- (Post_Parse_Action => Post_Parse_Action,
- Descriptor => Descriptor'Unrestricted_Access,
- Source_File_Name => -Source_File_Name,
- Line_Count => 1, -- FIXME: fix wisi_runtime to not need this!
- Params => -Lang_Params);
-
- if Repeat_Count > 1 then
- Start := Ada.Real_Time.Clock;
- end if;
-
- for I in 1 .. Repeat_Count loop
- declare
- procedure Clean_Up
- is begin
- if I = 1 then
- null;
- -- FIXME: Errors!
- -- Parse_Data.Put
- -- (Parser.Lexer.Errors,
- -- Parser.Parsers.First.State_Ref.Errors,
- -- Parser.Parsers.First.State_Ref.Tree);
- end if;
- end Clean_Up;
-
- begin
- Parse_Data.Reset;
- Parser.Parse;
- Parser.Execute_Actions;
-
- if Repeat_Count = 1 then
- Parse_Data.Put;
-
- -- FIXME: put errors via parse_data.put
- if Parser.Any_Errors then
- Parser.Put_Errors;
- end if;
- -- Parse_Data.Put
- -- (Parser.Lexer.Errors,
- -- Parser.Parsers.First.State_Ref.Errors,
- -- Parser.Parsers.First.State_Ref.Tree);
- end if;
- exception
- when WisiToken.Syntax_Error =>
- Clean_Up;
- Put_Line ("(parse_error)");
-
- when E : WisiToken.Parse_Error =>
- Clean_Up;
- Put_Line ("(parse_error """ & Ada.Exceptions.Exception_Message (E) &
""")");
-
- when E : WisiToken.Fatal_Error =>
- Clean_Up;
- Put_Line ("(error """ & Ada.Exceptions.Exception_Message (E) & """)");
- end;
- end loop;
-
- if Repeat_Count > 1 then
- declare
- use Ada.Real_Time;
- Finish : constant Time := Clock;
- begin
- Put_Line ("Total time:" & Duration'Image (To_Duration (Finish -
Start)));
- Put_Line ("per iteration:" & Duration'Image (To_Duration ((Finish -
Start) / Repeat_Count)));
- end;
- end if;
-
-exception
-when E : others =>
- Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
- New_Line (2);
- Put_Line
- ("(error ""unhandled exception: " & Ada.Exceptions.Exception_Name (E) &
": " &
- Ada.Exceptions.Exception_Message (E) & """)");
- Put_Line (GNAT.Traceback.Symbolic.Symbolic_Traceback (E));
-end Gen_Run_Wisi_Libadalang_Parse;
diff --git a/gen_run_wisi_libadalang_parse.ads
b/gen_run_wisi_libadalang_parse.ads
deleted file mode 100644
index 356c67d..0000000
--- a/gen_run_wisi_libadalang_parse.ads
+++ /dev/null
@@ -1,30 +0,0 @@
--- Abstract :
---
--- Run an Emacs libadalang parser as a standalone executable, for debugging.
---
--- See gen_emacs_wisi_libadalang_parse.ads for the Emacs background process.
---
--- Copyright (C) 2018 Free Software Foundation, Inc.
---
--- This program is free software; you can redistribute it and/or
--- modify it under terms of the GNU General Public License as
--- published by the Free Software Foundation; either version 3, or (at
--- your option) any later version. This program is distributed in the
--- hope that it will be useful, but WITHOUT ANY WARRANTY; without even
--- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
--- PURPOSE. See the GNU General Public License for more details. You
--- should have received a copy of the GNU General Public License
--- distributed with this program; see file COPYING. If not, write to
--- the Free Software Foundation, 51 Franklin Street, Suite 500, Boston,
--- MA 02110-1335, USA.
-
-pragma License (GPL);
-
-with Wisi;
-with WisiToken;
-generic
- type Parse_Data_Type is new Wisi.Parse_Data_Type with private;
-
- Descriptor : in WisiToken.Descriptor;
-
-procedure Gen_Run_Wisi_Libadalang_Parse;
diff --git a/gen_run_wisi_packrat_parse.adb b/gen_run_wisi_packrat_parse.adb
deleted file mode 100644
index fb3e900..0000000
--- a/gen_run_wisi_packrat_parse.adb
+++ /dev/null
@@ -1,241 +0,0 @@
--- Abstract :
---
--- See spec.
---
--- Copyright (C) 2018 All Rights Reserved.
---
--- This program is free software; you can redistribute it and/or
--- modify it under terms of the GNU General Public License as
--- published by the Free Software Foundation; either version 3, or (at
--- your option) any later version. This program is distributed in the
--- hope that it will be useful, but WITHOUT ANY WARRANTY; without even
--- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
--- PURPOSE. See the GNU General Public License for more details. You
--- should have received a copy of the GNU General Public License
--- distributed with this program; see file COPYING. If not, write to
--- the Free Software Foundation, 51 Franklin Street, Suite 500, Boston,
--- MA 02110-1335, USA.
-
-pragma License (GPL);
-
-with Ada.Command_Line;
-with Ada.Exceptions;
-with Ada.IO_Exceptions;
-with Ada.Real_Time;
-with Ada.Strings.Unbounded;
-with Ada.Text_IO; use Ada.Text_IO;
-with GNAT.Traceback.Symbolic;
-with WisiToken.Lexer;
-with WisiToken.Text_IO_Trace;
-procedure Gen_Run_Wisi_Parse_Packrat
-is
- use WisiToken; -- Token_ID, "+", "-" Unbounded_string
-
- Trace : aliased WisiToken.Text_IO_Trace.Trace (Descriptor'Access);
- Parser : WisiToken.Parse.Packrat.Parser;
- Parse_Data : aliased Parse_Data_Type (Parser.Line_Begin_Token'Access);
-
- procedure Put_Usage
- is begin
- Put_Line ("usage: " & Name & "_wisi_parse <file_name> <parse_action>
[options]");
- Put_Line ("parse_action: {Navigate | Face | Indent}");
- Put_Line ("options:");
- Put_Line ("--verbosity n m l:");
- Put_Line (" n: parser; m: mckenzie; l: action");
- Put_Line (" 0 - only report parse errors");
- Put_Line (" 1 - shows spawn/terminate parallel parsers, error recovery
enter/exit");
- Put_Line (" 2 - add each parser cycle, error recovery enqueue/check");
- Put_Line (" 3 - parse stack in each cycle, error recovery parse
actions");
- Put_Line (" 4 - add lexer debug");
- Put_Line ("--lang_params <language-specific params>");
- Put_Line ("--lexer_only : only run lexer, for profiling");
- Put_Line ("--repeat_count n : repeat parse count times, for profiling;
default 1");
- Put_Line ("--pause : when repeating, prompt for <enter> after each
parse; allows seeing memory leaks");
- New_Line;
- end Put_Usage;
-
- Source_File_Name : Ada.Strings.Unbounded.Unbounded_String;
- Post_Parse_Action : WisiToken.Wisi_Runtime.Post_Parse_Action_Type;
-
- Line_Count : WisiToken.Line_Number_Type := 1;
- Lexer_Only : Boolean := False;
- Repeat_Count : Integer := 1;
- Pause : Boolean := False;
- Arg : Integer;
- Lang_Params : Ada.Strings.Unbounded.Unbounded_String;
- Start : Ada.Real_Time.Time;
-begin
- Create_Parser (Parser, Trace'Unrestricted_Access,
Parse_Data'Unchecked_Access);
-
- declare
- use Ada.Command_Line;
- begin
- if Argument_Count < 1 then
- Put_Usage;
- Set_Exit_Status (Failure);
- return;
- end if;
-
- Source_File_Name := +Ada.Command_Line.Argument (1);
- Post_Parse_Action := WisiToken.Wisi_Runtime.Post_Parse_Action_Type'Value
(Ada.Command_Line.Argument (2));
- Arg := 3;
-
- loop
- exit when Arg > Argument_Count;
-
- if Argument (Arg) = "--verbosity" then
- WisiToken.Trace_Parse := Integer'Value (Argument (Arg + 1));
- WisiToken.Trace_McKenzie := Integer'Value (Argument (Arg + 2));
- WisiToken.Trace_Action := Integer'Value (Argument (Arg + 3));
- Arg := Arg + 4;
-
- elsif Argument (Arg) = "--lang_params" then
- Lang_Params := +Argument (Arg + 1);
- Arg := Arg + 2;
-
- elsif Argument (Arg) = "--lexer_only" then
- Lexer_Only := True;
- Arg := Arg + 1;
-
- elsif Argument (Arg) = "--pause" then
- Pause := True;
- Arg := Arg + 1;
-
- elsif Argument (Arg) = "--repeat_count" then
- Repeat_Count := Integer'Value (Argument (Arg + 1));
- Arg := Arg + 2;
-
- else
- Put_Line ("unrecognized option: '" & Argument (Arg) & "'");
- Put_Usage;
- return;
- end if;
- end loop;
- end;
-
- -- Do this after setting Trace_Parse so lexer verbosity is set
- begin
- Parser.Lexer.Reset_With_File (-Source_File_Name);
- exception
- when Ada.IO_Exceptions.Name_Error =>
- Put_Line (Standard_Error, "'" & (-Source_File_Name) & "' cannot be
opened");
- return;
- end;
-
- -- See comment in wisi-wisi_runtime.ads for why we still need this.
- declare
- Token : Base_Token;
- Lexer_Error : Boolean;
- pragma Unreferenced (Lexer_Error);
- begin
- loop
- begin
- Lexer_Error := Parser.Lexer.Find_Next (Token);
- exit when Token.ID = Descriptor.EOF_ID;
- exception
- when WisiToken.Syntax_Error =>
- Parser.Lexer.Discard_Rest_Of_Input;
- Parser.Put_Errors (-Source_File_Name);
- Put_Line ("(lexer_error)");
- end;
- end loop;
- Line_Count := Token.Line;
- end;
-
- if WisiToken.Trace_Action > WisiToken.Outline then
- Put_Line ("line_count:" & Line_Number_Type'Image (Line_Count));
- end if;
-
- Parse_Data.Initialize
- (Post_Parse_Action => Post_Parse_Action,
- Descriptor => Descriptor'Access,
- Source_File_Name => -Source_File_Name,
- Line_Count => Line_Count,
- Params => -Lang_Params);
-
- if Repeat_Count > 1 then
- Start := Ada.Real_Time.Clock;
- end if;
-
- for I in 1 .. Repeat_Count loop
- declare
- procedure Clean_Up
- is begin
- Parser.Lexer.Discard_Rest_Of_Input;
- if Repeat_Count = 1 then
- Parser.Put_Errors (-Source_File_Name);
- end if;
- end Clean_Up;
-
- begin
- Parse_Data.Reset;
- Parser.Lexer.Reset;
-
- if Lexer_Only then
- declare
- Token : Base_Token;
- Lexer_Error : Boolean;
- pragma Unreferenced (Lexer_Error);
- begin
- Parser.Lexer.Reset;
- loop
- Lexer_Error := Parser.Lexer.Find_Next (Token);
- exit when Token.ID = Descriptor.EOF_ID;
- end loop;
- -- We don't handle errors here; that was done in the count
lines loop
- -- above.
- end;
- else
- Parser.Parse;
- Parser.Execute_Actions;
-
- if Repeat_Count = 1 then
- Parse_Data.Put;
- Parser.Put_Errors (-Source_File_Name);
- end if;
- end if;
- exception
- when WisiToken.Syntax_Error =>
- Clean_Up;
- Put_Line ("(parse_error)");
-
- when E : WisiToken.Parse_Error =>
- Clean_Up;
- Put_Line ("(parse_error """ & Ada.Exceptions.Exception_Message (E) &
""")");
-
- when E : WisiToken.Fatal_Error =>
- Clean_Up;
- Put_Line ("(error """ & Ada.Exceptions.Exception_Message (E) & """)");
- end;
-
- if Pause then
- Put_Line ("Enter to continue:");
- Flush (Standard_Output);
- declare
- Junk : constant String := Get_Line;
- pragma Unreferenced (Junk);
- begin
- null;
- end;
- end if;
- end loop;
-
- if Repeat_Count > 1 then
- declare
- use Ada.Real_Time;
- Finish : constant Time := Clock;
- begin
- Put_Line ("Total time:" & Duration'Image (To_Duration (Finish -
Start)));
- Put_Line ("per iteration:" & Duration'Image (To_Duration ((Finish -
Start) / Repeat_Count)));
- end;
- end if;
-
-exception
-when E : others =>
- Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
- New_Line (2);
- Put_Line
- ("(error ""unhandled exception: " & Ada.Exceptions.Exception_Name (E) &
": " &
- Ada.Exceptions.Exception_Message (E) & """)");
- Put_Line (GNAT.Traceback.Symbolic.Symbolic_Traceback (E));
-end Gen_Run_Wisi_Parse_Packrat;
diff --git a/gen_run_wisi_packrat_parse.ads b/gen_run_wisi_packrat_parse.ads
deleted file mode 100644
index 538da1d..0000000
--- a/gen_run_wisi_packrat_parse.ads
+++ /dev/null
@@ -1,36 +0,0 @@
--- Abstract :
---
--- Run an Emacs packrate parser as a standalone executable, for debugging.
---
--- See gen_emacs_wisi_parse_packrat.ads for the Emacs background process.
---
--- Copyright (C) 2018 Free Software Foundation, Inc.
---
--- This program is free software; you can redistribute it and/or
--- modify it under terms of the GNU General Public License as
--- published by the Free Software Foundation; either version 3, or (at
--- your option) any later version. This program is distributed in the
--- hope that it will be useful, but WITHOUT ANY WARRANTY; without even
--- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
--- PURPOSE. See the GNU General Public License for more details. You
--- should have received a copy of the GNU General Public License
--- distributed with this program; see file COPYING. If not, write to
--- the Free Software Foundation, 51 Franklin Street, Suite 500, Boston,
--- MA 02110-1335, USA.
-
-pragma License (GPL);
-
-with WisiToken.Parse.Packrat;
-with WisiToken.Syntax_Trees;
-with WisiToken.Wisi_Runtime;
-generic
- type Parse_Data_Type is new WisiToken.Wisi_Runtime.Parse_Data_Type with
private;
-
- Descriptor : in WisiToken.Descriptor;
-
- with procedure Create_Parser
- (Parser : out WisiToken.Parse.Packrat.Parser;
- Trace : not null access WisiToken.Trace'Class;
- User_Data : in WisiToken.Syntax_Trees.User_Data_Access);
-
-procedure Gen_Run_Wisi_Parse_Packrat;
diff --git a/sal-gen_unbounded_definite_red_black_trees.adb
b/sal-gen_unbounded_definite_red_black_trees.adb
index 0cbd6dd..fc26c5a 100644
--- a/sal-gen_unbounded_definite_red_black_trees.adb
+++ b/sal-gen_unbounded_definite_red_black_trees.adb
@@ -2,7 +2,7 @@
--
-- Generic unbounded red-black tree with definite elements.
--
--- Copyright (C) 2017 - 2020 Free Software Foundation, Inc.
+-- Copyright (C) 2017 - 2021 Free Software Foundation, Inc.
--
-- This library is free software; you can redistribute it and/or modify it
-- under terms of the GNU General Public License as published by the Free
@@ -318,12 +318,13 @@ package body SAL.Gen_Unbounded_Definite_Red_Black_Trees is
if Node = null then
raise Not_Found;
else
- -- WORKAROUND: GNAT Community 2019 requires .all here, GNAT Pro 21.0w
- -- 20200426 requires it _not_ be here. The code is technically legal
- -- either way, so both compilers have a bug. Keeping .all for now;
- -- just delete it if you are using 21.0w. Hopefully 21 will fix the
- -- bug. AdaCore ticket T503-001 on Eurocontrol support contract.
- return (Element => Node.all.Element'Access, Dummy => 1);
+ -- WORKAROUND: GNAT Community 2019 requires Node.all.Element'Access
+ -- here, Community 2020 and GNAT Pro 21.0w 20200426 requires
+ -- Node.Element'Access (no .all). The code is technically legal
+ -- either way, so both compilers have a bug. This code is compatible
+ -- with 2020. AdaCore ticket T503-001 on Eurocontrol support
+ -- contract.
+ return (Element => Node.Element'Access, Dummy => 1);
end if;
end Constant_Reference;
@@ -335,7 +336,7 @@ package body SAL.Gen_Unbounded_Definite_Red_Black_Trees is
pragma Unreferenced (Container);
begin
-- WORKAROUND: see note in Constant_Reference
- return (Element => Position.Node.all.Element'Access, Dummy => 1);
+ return (Element => Position.Node.Element'Access, Dummy => 1);
end Variable_Reference;
function Variable_Reference
diff --git a/wisi.el b/wisi.el
index a7b88ff..3c095c7 100644
--- a/wisi.el
+++ b/wisi.el
@@ -1,13 +1,13 @@
;;; wisi.el --- Utilities for implementing an indentation/navigation engine
using a generalized LALR parser -*- lexical-binding:t -*-
;;
-;; Copyright (C) 2012 - 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012 - 2021 Free Software Foundation, Inc.
;;
;; Author: Stephen Leake <stephen_leake@stephe-leake.org>
;; Maintainer: Stephen Leake <stephen_leake@stephe-leake.org>
;; Keywords: parser
;; indentation
;; navigation
-;; Version: 3.1.3
+;; Version: 3.1.4
;; package-requires: ((emacs "25.0") (seq "2.20"))
;; URL: http://stephe-leake.org/ada/wisitoken.html
;;
diff --git a/wisi.texi b/wisi.texi
index 3a7d3b3..8028810 100644
--- a/wisi.texi
+++ b/wisi.texi
@@ -2,7 +2,7 @@
@settitle Wisi
@copying
-Copyright @copyright{} 1999 - 2020 Free Software Foundation, Inc.
+Copyright @copyright{} 1999 - 2021 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
@@ -25,7 +25,7 @@ developing GNU and promoting software freedom.''
@titlepage
@sp 10
-@title Wisi Version 3.1.2
+@title Wisi Version 3.1.3
@page
@vskip 0pt plus 1filll
@insertcopying
@@ -37,7 +37,7 @@ developing GNU and promoting software freedom.''
@node Top
@top Top
-Wisi Version 3.1.2
+Wisi Version 3.1.3
@end ifnottex
@menu