Commit Graph

  • 6a8a79fd95 (No_Context_Token): New constant. (Table): Add No_Context entry. (Mode_Value): Fix tests to exit from this routine. (Is_No_Context): New routine. (No_Context): New routine. release-8.3.0 Pascal Obry 2004-09-18 12:27:28 +00:00
  • 7f429c23fa (Filter.Mode): Add No_Context. (Filter.No_Context): New routine. (Filter.Is_No_Context): New routine. (Get_Filter_Set): Check that if no context filter is given it is in the first position. (Translate): Call the context callback after handling the default tags and only if there is no NO_CONTEXT filter specified. Pascal Obry 2004-09-18 12:27:21 +00:00
  • a8e0b123b3 Fix code to use new AI302 container Is_In prototype. Pascal Obry 2004-09-02 16:14:05 +00:00
  • d983d8d298 (Clear): Properly initialize Min and Max as done in Initialize. Pascal Obry 2004-08-05 06:41:25 +00:00
  • 6edbc182ec Some changes due to new Tag record structure to fix reference semantic implementation. Pascal Obry 2004-07-07 19:46:52 +00:00
  • a619d08b2f (Get): New procedure. Lot of changes due to new Tag record structure to fix reference semantic implementation. Pascal Obry 2004-07-07 19:46:17 +00:00
  • b44a67dba6 (Tag): Add comments about reference semantic. Fix referenc semantic implementation. (Get): New procedure. Pascal Obry 2004-07-07 19:46:11 +00:00
  • c661800593 Some fixes due to AI302 changes. Pascal Obry 2004-06-25 20:32:27 +00:00
  • ae94a18c98 (Parse): Minor reformatting. Add some comments. release-8.1.0 Pascal Obry 2004-06-14 16:56:25 +00:00
  • aa36bb1378 (Print_Tree): Output the include file parameters. Pascal Obry 2004-06-14 16:56:18 +00:00
  • 49aa31f316 (Tag_Var): Add N field (include parameter index). (Is_Include_Variable): New function. (Build) [Tag_Var]: Detect include variable and set index N. (Max_Include_Parameters): New constant. (Include_Parameters): New type. (No_Parameter): New constant. (Node): Add I_Params field. (Replace_Include_Variables): Removed. We do not want to expand the include parameters at load time as, in the case of cached files, the include tree can be shared by multiple templates. This will be handled at parsing time. (Load_Include_Parameters): New procedure that create a Data.Tree for each include parameter in I_Params field. (Parse): Use it instead of Replace_Include_Variables. (Table_State): Renamed Parse_State. (Parse) [Unbounded_String]: Add I_Params field in Parse_State. (I_Translate): New procedure. (Flush); New procedure. (Add): Use Flush. (Analyse) [Data.Tree]: Handle include variables. (Analyse) [Expr.Tree]: Idem. (Analyse) []: Adjust state aggregates with new field. (Release) [Tree]: Free memory associated with include parameters. Pascal Obry 2004-06-14 16:56:11 +00:00
  • 97d94c777c (Clear): Initialize Nested_Level to 1. (Initialize): Idem. (Translate) [Tag_Var]: Improve error messages. Patch contributed by Emmanuel Briot. ("&") [Tag]: Properly set the nested level if the left value already contains values. Pascal Obry 2004-06-04 16:20:14 +00:00
  • 9fafaa3a14 (Remove): New routine. (Get): New routine. (Parse) [all versions]: Context is now of Context_Access type. Fix accessibility check problem. Pascal Obry 2004-05-26 16:34:49 +00:00
  • de2fda6294 (Null_Association): New constant. (Remove): New routine. (Get): New routine. (TP_Context): Removed. (Parse) [all versions]: Context is now of Context_Access type. Pascal Obry 2004-05-26 16:34:44 +00:00
  • b1623b6af3 (Translate): Do not call Callback for Null_Context. Minor reformatting. Pascal Obry 2004-05-24 16:45:22 +00:00
  • 4ffbfa92b8 (Insert) [Translate_Set]: New routine. Pascal Obry 2004-05-19 19:34:12 +00:00
  • ef9423110c Initial revision. Pascal Obry 2004-05-18 19:46:00 +00:00
  • 1c752ccf29 (Parse) [All versions]: Add a Context parameter. This implements the context/callback mechanism in the templates engine. This callback routine is used to get the value for a variable if not found in the translation set. (Callback): New procedure. (Is_True): Add pragma inline. (Translate): Use context if variable was not in the translation set. Pascal Obry 2004-05-18 16:52:02 +00:00
  • e7c6c54238 (Context): New type. (COntext_Access): New type. (TP_Context): New subtype alias for Context above. (Callback): New procedure. (Null_Context): New constant. (Parse) [All versions]: Add a Context parameter. This implements the context/callback mechanism in the templates engine. This callback routine is used to get the value for a variable if not found in the translation set. Pascal Obry 2004-05-18 16:51:58 +00:00
  • 13c03c9c92 Changes to use new AI302 interface. Pascal Obry 2004-05-17 20:25:34 +00:00
  • 661777e86b (Item) [Tag]: Renamed to Composite. (Composite): Renaming of Item. Sounds better and avoid some non upward compatibilities. Pascal Obry 2004-05-14 17:49:23 +00:00
  • 1553e36a31 (Vector): Renamed Composite. (Nested_Level): New routine. Update copyright notice. Pascal Obry 2004-05-13 21:12:14 +00:00
  • 479ef76026 (Replace): Properly handle the case where the value is an empty string. In that case the Data.Tree object is null. Pascal Obry 2004-05-12 14:30:32 +00:00
  • 6d8a929847 (Translate) [Translate_Set]: New version based on a Translate_Set. Continued work for Templates_Engine speed-up. Minor reformatting. Pascal Obry 2004-05-11 20:22:08 +00:00
  • 1cddfed98a (Assoc) [Tag]: Add some comments. Pascal Obry 2004-05-11 19:40:57 +00:00
  • 88ad0376c4 Change the spec of all filter routines to use a Translate_Set. (Value): This version is far more efficient, the top level loop has been removed as it now uses a Translate_Set. Pascal Obry 2004-05-11 17:42:11 +00:00
  • 09da0cf277 (Image): Move to spec. (Filter.Callback): Adjust parameter to use a Translate_Set. This change is also done for all filter routines. (Translate): Change spec to use a Translate_Set for efficiency. This version is far more efficient, the top level loop has been removed. (Check): This version is far more efficient, the top level loop has been removed as it now uses a Translate_Set. (Initialize): New routine. (Finalize): Idem. (Adjust): Idem. (Insert): New routtine. (Exists): Idem. (To_Set): Idem. (Parse) [String]: New routine with a Translate_Set. (Parse) [Unbounded_String]: New routine with a Translate_Set. Minor reformatting. Pascal Obry 2004-05-11 17:42:01 +00:00
  • 98a5eabf98 (Translate_Set): New type. (Insert): New routtine. (Exists): Idem. (To_Set): Idem. Add supports for translate set based on maps. This is far more efficient that having to read the translate table when looking for a specific tag name. (Parse) [String]: New routine with a Translate_Set. (Parse) [Unbounded_String]: New routine with a Translate_Set. (Initialize): New routine. (Finalize): Idem. (Adjust): Idem. (Image): Routine moved here from body. Pascal Obry 2004-05-11 17:41:57 +00:00
  • a35d34f8f9 (F_Sup): Add ??? about exception. (Get_Max_Line): Remove condition for Table_Stmt to support properly tag with any nested level at any table level. (Check): Complete rewrite to handle properly tag with any nested level at any table level. Pascal Obry 2004-05-10 18:36:33 +00:00
  • c9844699dd (Field): Better implementation to share code. Pascal Obry 2004-05-09 09:22:53 +00:00
  • 313f809e33 (Vector): Change code to detect what a vector structure is. Now it is checking if Nested_Level = 1. Pascal Obry 2004-05-09 08:19:38 +00:00
  • 2366998188 Lot of changes to support tags nested at any level. Vector_Tag and Matrix_Tag are now implemented using this new generic tag implementation. Pascal Obry 2004-05-09 08:19:24 +00:00
  • 9c4ba4f810 Lot of changes to support tags nested at any level. Vector_Tag and Matrix_Tag are now implemented using this new generic tag implementation. (Print_Tree): Moved to private part. This can now be accessed from Templates_Parser.Debug child package. Pascal Obry 2004-05-09 08:19:14 +00:00
  • 77e81100fe Initial revision. Pascal Obry 2004-05-09 08:18:58 +00:00
  • adefd59541 (BR_2_LF): Fix Constraint_Error if S is empty. Pascal Obry 2004-04-14 15:08:50 +00:00
  • c6ade8f6e7 (Next_Token): Properly handle filter parameters. Minor reformatting. Pascal Obry 2004-03-12 22:11:26 +00:00
  • b9133aaacd (Null_Static_Tree): New constant. (Node) [Info]: Remove Ref field. (Cached_Files.Get): Remove Load parameter. (Load): Use Null_Static_Tree. Minor reformatting. Pascal Obry 2004-03-09 22:37:56 +00:00
  • c2e216f331 (Print_Tree): Remove output of Ref field. Update copyright notice. Pascal Obry 2004-03-09 22:37:27 +00:00
  • a6b5ede3d7 (Mark_Mode): New type. (Update_Used_Counter): New routine. (Add): Properly handle include files on reload. (Get): Use Null_Static_Tree. Remove Load parameter. Call Update_Used_Counter to mark main template file and all files included. (Release): Call Update_Used_Counter to release main template file and all files included. (Up_To_Date): Properly check for all include files not only the first level. Pascal Obry 2004-03-09 22:37:13 +00:00
  • ea9ca7e39e Minor reformatting. Pascal Obry 2004-03-08 20:20:14 +00:00
  • c2454cee62 Complete rewrite to be LL(0) parser. Patch contributed by Jean-Pierre Rosen. Pascal Obry 2004-03-08 20:19:06 +00:00
  • f9f838524c (Replace_One_Or_All): New routine used to implement the REPLACE and REPLACE_ALL filters. (Replace): Filter implemented using Replace_One_Or_All. (Replace_All): Idem. Pascal Obry 2004-03-07 15:16:14 +00:00
  • c6f2158f9c (Release): Add Include parameter to control include file release. Code clean up. (Parse): Code clean up. Pascal Obry 2004-03-06 14:27:17 +00:00
  • d6f2583274 (Add): Do not release include file. Fix cache handling. This introduces a memory leak but it is better than a crash. See ???. Pascal Obry 2004-03-06 14:27:02 +00:00
  • 3a94e1672f (Load): Improve previous check-in, do not put the Open into the exception handler. Patch contributed by Jean-Pierre Rosen. Pascal Obry 2004-03-04 17:42:51 +00:00
  • 1ad0d7ef45 (Load): Ensure that the file is always closed even if the parsing failed. Patch contributed by Jean-Pierre Rosen. Pascal Obry 2004-03-03 19:13:39 +00:00
  • bda9802cb1 (Check) [Tag]: New procedure. (Check) [Data.Tree]: Use Check above (code moved from here). (Check) [Expr.Tree]: New procedure. (Get_Max_Line): Call Check for the condition on an If_Stmt. Pascal Obry 2004-02-07 09:12:05 +00:00
  • 31c99c2f2e (Parse): Remove return statement, never reached. (Parse): Buffer, Last new variable to implement a cache. This improves the performance by avoiding to many reallocation on the Unbounded_String. (Analyse.Add): New routine. Handle the cache. Pascal Obry 2004-02-06 19:02:23 +00:00
  • 96f9d76c79 (Parse): Add loop name in exit statement to be compliant with AWS style. Pascal Obry 2004-01-27 19:47:56 +00:00
  • e19c6a5a33 Fix casing error. Minor reformatting. Add some pragma Unreferenced to be compliant with AWS style. Pascal Obry 2004-01-27 19:47:53 +00:00
  • 6dd5d10564 Remove duplicate routine header box. Pascal Obry 2004-01-27 19:47:49 +00:00
  • 6210e9ec77 (Ada.IO_Exceptions): Removed as it is not used. Minor style and case fixes to be compliant with AWS style. Pascal Obry 2004-01-27 19:47:42 +00:00
  • c5deb53e93 (Add_Param): Replace value by its tag's value. Pascal Obry 2004-01-14 15:46:34 +00:00
  • 373b359564 Update copyright notice. Pascal Obry 2004-01-14 15:04:14 +00:00
  • 7027cc6065 (Replace_Param_Token): New constant. (Table): Add Replace_Param. (Del_Param): Fix implementation, properly check the name of the parameter. (Replace_Param): New routine. Pascal Obry 2004-01-14 15:02:31 +00:00
  • 233f6e12bd (Mode): Add Replace_Param. (Replace_Param): New routine. (Build): Fix handling of quote in filter parameter. Pascal Obry 2004-01-14 15:02:17 +00:00
  • 16bc782277 (Replace_All): Use Regpat.Match call compatible with GNAT 3.15p. Update copyright notice. Pascal Obry 2004-01-05 07:22:44 +00:00
  • 940d0c012a (Add_Param_Token): New constant. (Del_Param_Token): Idem. (Table): Add Add_Param and Del_Param. (Add_Param): New routine. (Del_Param): Idem. Pascal Obry 2003-12-20 17:56:40 +00:00
  • 82ac8cdad1 (Mode): Add Add_Param and Del_Param. (Add_Param): New routine. (Del_Param): Idem. Pascal Obry 2003-12-20 17:56:34 +00:00
  • 19abcbc0e3 (Translate): Add new variable NOW that represent the current date and time. Pascal Obry 2003-12-17 15:01:10 +00:00
  • 2c8302e337 (Match): Use GNAT.Regpat instead of GNAT.Regexp. This is upward compatible and now the template engine use only the GNAT.Regpat unit. (Release): Properly release memory for the regpat used by match. Pascal Obry 2003-12-15 17:36:38 +00:00
  • 48b0335f10 (Parameter_Data): Use a a Regpat instead of a Regexp. (Name_Parameter): Properly build a Regpat. Pascal Obry 2003-12-15 17:36:31 +00:00
  • 7104e99174 (Format_Date_Token): New constant. (Table): Add Format_Date. (Format_Date): New routine. Pascal Obry 2003-12-12 16:43:36 +00:00
  • 13d57ceef0 (Mode): Add Format_Date. (Format_Date): New routine. Pascal Obry 2003-12-12 16:43:29 +00:00
  • fee297d19c (Replace_All_Token): New constant. (Table): Add Replace_All entry. (Parameter): Handle Replace_All. (Replace): Handle case where replacement string is not a pattern. If no match return the original string. (Replace_All): New routine. Pascal Obry 2003-12-09 21:13:44 +00:00
  • 59e4ef0448 (Mode): Add Replace_All. (Replace_All): New routine. Pascal Obry 2003-12-09 21:13:37 +00:00
  • 02f68acf94 (Is_Number): New routine. Add Translate_Table parameter to all filters routine. (Repeat): Use translate table if argument is not a number. (Plus): Idem and handles negative numbers. (Minus): Idem. (Multiply): Idem. (Divide): Idem. (Value): New routine. Pascal Obry 2003-12-08 18:07:01 +00:00
  • 8a3fbce9c0 (Callback): Add a Translate_Table parameter. Add Translate_Table parameter to all filters routine. (Translate): Add a Translate_Table parameter. (Analyze): Pass Translations to all Translate calls. Pascal Obry 2003-12-08 18:06:54 +00:00
  • 2e757cdba7 ("&"): Add versions to prepend data into the vector. Pascal Obry 2003-12-06 14:57:22 +00:00
  • 2d651979cf (Analyse): Do not use recursivity for consecutives Text nodes. This use lot less stack space and should be faster. Pascal Obry 2003-11-30 11:08:15 +00:00
  • c1d76bc533 (Replace_Token): New variable. (Table): Add entry for Replace. (Parameter): Handles Replace filter. (Image): Idem. (Mode_Value): Fix algorithm, was sometimes looping forever looking for an unknown filter in some cases. (Is_Number): Add function header. (Replace): New implementation. (Release) [Parameter_Data]: New impementation. (Release) [Set]: New impementation. Pascal Obry 2003-11-29 18:43:48 +00:00
  • 732ecf6637 (Mode): Add Replace. (Parameter_Mode): Add Regpat. (Parameter_Data): Add variant part for Regpat. (Release) [Parameter_Data]: New routine. (Release) [Set]: New routine. (Find_Slash): New routine, look for not escaped slash. (Name_Parameter): Handles Regpat case. (Release) [Tag]: Call Release for the filter set. (Build_Include_Pathname): Fix detection of rooted filename, this time it should be ok. Pascal Obry 2003-11-29 18:43:41 +00:00
  • 7e4e7b6890 (Association_Kind): Type moved from private part and renamed (was Var_Kind). Pascal Obry 2003-11-08 17:57:35 +00:00
  • 9157f997c2 Initial revision. Pascal Obry 2003-11-08 17:57:14 +00:00
  • 1f004eb6b4 (Get): Remove use type for GNAT.OS_Lib.OS_Time as it is not needed anymore. Pascal Obry 2003-11-05 19:31:18 +00:00
  • f766d0b516 (Error_Include_Filename): Removed. (Error_Include_Message): New variable. (Fatal_Error): Handle properly nested messages. (Parse): Retrieve include filename message and set Error_Include_Message. (Load): Fix way messages from include template are reported. Pascal Obry 2003-10-28 18:09:25 +00:00
  • b5b5f68e0b (Build_Include_Pathname): Properly handle rooted pathname and subdirectories. Pascal Obry 2003-10-09 21:02:57 +00:00
  • 88c404d4c3 (Mode_Value): Use a dichotomy algorithm. (Slice): New filter. Pascal Obry 2003-09-27 18:28:36 +00:00
  • 71b27f0c1a Put all Filter tokens into Filter separate package. (Mode): Sort in alphabetical order. (Slice): New routine. (Get_Slice): New routine. (Name_Parameter): Handle slice. (Parameter_Data): Idem. (Get_Next_Line): Handle comments at end of template properly. Pascal Obry 2003-09-27 18:25:49 +00:00
  • 35d42c35bc (No_Quote): Moved to Templates_Parser package. Pascal Obry 2003-09-26 19:25:49 +00:00
  • 62123248b9 Initial revision. Pascal Obry 2003-09-26 19:25:27 +00:00
  • 40a25162e8 Minor reformatting. Pascal Obry 2003-09-26 19:25:16 +00:00
  • d50703795b Move all filter related codes to Templates_Parser.Filter separate package. (Name_Parameter): Remove quote around filter parameter. Pascal Obry 2003-09-26 19:24:56 +00:00
  • 71bdeca6d6 (Field): Now procedure, return a boolean to True if value Found. Complete rewrite to use the cached position. This is a large speed-up for iterators. (Clear): Properly initialize new fields. (Initialize): Idem. (Finalize): Properly free memory used by the new fields. (Item): Implementation based on Field. Code was duplicated. (Vector): Implementation based on Field. Code was duplicated. (Translate): Use new Field routines. Pascal Obry 2003-09-24 14:30:43 +00:00
  • 17ce67741e (Access_Vector_Tag_Node_Access): New type. (Access_Matrix_Tag_Node_Access): Idem. (Vector_Tag): Add Current, Pos fields. (Matrux_Tag): Idem. These new fields are used to cache the current position to speed up a lot iterators. Pascal Obry 2003-09-24 14:30:37 +00:00
  • cd11e6d30c (Load.Parse): Do not use recursivity to read standards text line. This lower a lot the use of the stack and make it possible to parse large files. Minor reformatting. Pascal Obry 2003-08-29 09:03:10 +00:00
  • c0a360dfaa (Load): Properly detect missing include files and release the memory associated with the incomplete tree before raising a fatal error. Pascal Obry 2003-07-31 16:35:31 +00:00
  • 62b8baac3b (Clear): Always call Finalize as this structure use a ref counter. Fix memory leak bug. Pascal Obry 2003-03-27 16:40:53 +00:00
  • d6638a51b6 (Release): Properly free include files memory. Pascal Obry 2003-03-25 20:24:36 +00:00
  • 4daf8ff491 (Replace_Include_Variables): Also inherit the attributes. Complete previous fix. Pascal Obry 2003-03-15 16:55:24 +00:00
  • 82fc9b8c82 Minor comment fix. Pascal Obry 2003-03-15 16:00:29 +00:00
  • ae1d72c0f0 (Replace_Include_Variables): Handle all cases. Expression are correctly replaced. Filters are inherited by the new variable or applied to the new static value. Pascal Obry 2003-03-15 15:52:15 +00:00
  • 9600c299af (Get_Next_Line): Skip all CR at the end of line. Pascal Obry 2003-03-11 16:14:32 +00:00
  • 0aab799688 (Open): Free allocated memory if Name_Error is raised. Pascal Obry 2003-03-05 21:04:44 +00:00
  • d2583cf049 (Get_First_Parameter): Do not return the space after the filename if present. Pascal Obry 2003-02-27 16:06:22 +00:00
  • cbd32c8b15 Update copyright notice. Pascal Obry 2003-02-25 20:53:39 +00:00
  • 25905c22d2 (Replace_Include_Variables): New procedure. (Get_All_Parameters): Change error message. (Get_Next_Line): Skip comment lines. (Parse): Call Replace_Include_Variables for include files. Minor reformatting. Pascal Obry 2003-02-25 18:34:25 +00:00
  • 942ca36e08 (Filter_LF_2_BR_Token): New constant. (Filter_BR_2_LF_Token): New constant. (Filters_Mode): Add FS_2_BR and BR_2_LF. (BR_2_LF_Filter): New routine. (LF_2_BR_Filter): New routine. (Filter_Table): Add FS_2_BR and BR_2_LF. Pascal Obry 2003-01-23 21:38:03 +00:00
  • 32023871ae (Get_Token): Uses Index instead of Index_Non_Blank which handle only spaces. Pascal Obry 2003-01-16 20:02:09 +00:00
  • 05fb22ca5f (Get_First_Parameter): Uses Index instead of Index_Non_Blank which handle only spaces. (Get_Next_Line): Idem. Pascal Obry 2003-01-16 20:01:40 +00:00