Commit Graph

148 Commits

Author SHA1 Message Date
Tomasz Sowa 41ac172b91 remove some old values from Type enum 2022-04-12 19:10:10 +02:00
Tomasz Sowa b9f1fa913e fixed: set find_helper.found=true in CallSpaceWrapper() and CallSpace() 2021-12-09 13:30:09 +01:00
Tomasz Sowa 973f05cc08 some work on iterating through tables 2021-11-24 13:19:27 +01:00
Tomasz Sowa 86d0b7d886 changed the semantic of [for ...] loops, we have 'val' keyword now for referencing child objects
sample:
[for mylist]
  [mylist.val]
[end]
before we use 'this' but only for POD simple types, now we use 'val' for all types
2021-11-23 19:40:52 +01:00
Tomasz Sowa 943026a3ac I forget to add modified files to previous commit
(added support for Space tables, removed Models class)
2021-11-22 15:44:37 +01:00
Tomasz Sowa c2c12d55d0 added support for Space tables
removed Models class
2021-11-22 15:43:08 +01:00
Tomasz Sowa a7656d5ccd added space values 2021-11-21 21:08:06 +01:00
Tomasz Sowa 46bc5c35a1 added "add" methods with vector/list of models to Vars 2021-11-20 22:02:18 +01:00
Tomasz Sowa 7caddeedbf set *find_helper.result if a child object was found 2021-11-09 00:23:43 +01:00
Tomasz Sowa ac66a6649d some work on iterating through collection of models - not working yet 2021-11-08 00:41:36 +01:00
Tomasz Sowa 2f140686d7 let filters make use of Var<> objects 2021-11-06 19:20:11 +01:00
Tomasz Sowa e2a8729a2f Env<>::in is Var<> now and we pass last result as in into next field 2021-11-06 19:07:39 +01:00
Tomasz Sowa bb0cc59eca if a ezc function returns another function we should evaluate it 2021-11-05 22:23:22 +01:00
Tomasz Sowa b8a9217429 use new FindHelper struct in places where fields, field_index, parameters variables were used 2021-11-05 09:34:05 +01:00
Tomasz Sowa 6d79cdb2fc instead of morm::Wrapper let the Var<> has a child's map 2021-10-27 14:23:48 +02:00
Tomasz Sowa a61fd2dcd0 mark a new function FindVariable() 2021-10-25 21:33:21 +02:00
Tomasz Sowa 03a76d35ad - Var is a template now: Var<StreamType>
- removed using cache for a while
- Generator: instead of blocks, functions, objects we have now only variables
  (work in progress)
2021-10-20 08:23:45 +02:00
Tomasz Sowa dfb8e5da78 Merge commit 'd8692f6ed56a8bb1bcdd1117aef7df69ec1c39aa' into types
"index" and "index-one" options for space tables
2021-09-23 14:09:23 +02:00
Tomasz Sowa d8692f6ed5 added options: "index" and "index-one" for space tables e.g. [table_name "index-one"] 2021-09-23 14:03:26 +02:00
Tomasz Sowa 3c969ac5c6 added: "this" virtual field for a table (only if the next field is not an object)
cherry picked from b047a10e8d
2021-09-23 04:11:20 +02:00
Tomasz Sowa b047a10e8d added: "this" virtual field for a table - only if the next field is not an object
e.g.:
       [for space_object]
       	    [space_object.this] instead of [space_object "current"]
       [end]
       "this" can be nested, e.g. if we have two nested tables:
       [for space_object]
          [for space_object.this]
             [space_object.this.this]
          [end]
       [end]

removed: "current" parameter for tables
2021-09-23 04:02:34 +02:00
Tomasz Sowa d9804f05aa added Vars<> container 2021-09-14 00:31:50 +02:00
Tomasz Sowa 09beafeab7 template FunInfo<> renamed to Env<> 2021-08-29 20:55:15 +02:00
Tomasz Sowa e826ba34ae start working on types for Ezc
- now Var struct has some basic types (string, bool, stream, model, etc.)
- Generator doesn't directly put output to out_stream but to Var& result
2021-08-29 20:35:15 +02:00
Tomasz Sowa a983698e3d Generator: some methods take std::vector<Var> parameters not through a reference 2021-08-17 17:33:51 +02:00
Tomasz Sowa 6a8cb019f5 added parameters "only_date" and "only_time" when printing a pt::Date 2021-08-14 19:40:05 +02:00
Tomasz Sowa b0afdf7f0f check block arguments e.g. [1] at the beginning - before all other lookups 2021-08-14 17:44:11 +02:00
Tomasz Sowa b956f1c401 fixed: fields table was not copied in Item::Function::operator=(...) 2021-08-14 17:40:40 +02:00
Tomasz Sowa 5e47313af8 fixed: when incrementing space tables iterators in [for] statements we should invalidate indices for nested tables 2021-08-13 21:44:07 +02:00
Tomasz Sowa 44407c2a4b changed: added two new parameters to Generator class: template<class StreamType, bool is_pikotools_stream = false, bool is_autoescape_stream = false> class Generator
changed: added one new parameter to Outstreams class: template<class StreamType, bool is_pikotools_stream = false> class OutStreams
removed macros: EZC_GENERATOR_HAS_PT_STREAM, EZC_GENERATOR_HAS_WINIX_STREAM
2021-07-12 23:00:11 +02:00
Tomasz Sowa ae6a5c52a1 fixed in Generator: ezc_frames_stack_index was not initialized 2021-07-06 23:56:29 +02:00
Tomasz Sowa 9f416d31de Merge branch 'api2021' 2021-07-06 22:46:36 +02:00
Tomasz Sowa b9b9a881e0 added "roman" and "no_sec" parameters when serializing a date 2021-07-06 21:47:42 +02:00
Tomasz Sowa 995cccdace add two new ezc statements: [if-def ...] and [if-not-def ...]
[if-def my_function] returns true if my_function is defined somewhere (either a model, model container, space, date, block, function or variable)
add support for "noescape" or "raw" parameters to Space fields
fixed: CallWrapper() didn't return a status if a model/space/date/container was found
2021-07-02 20:23:20 +02:00
Tomasz Sowa 849b3e9ecc changed the way how we iterate through Models, instead of ModelWrapper now we have Wrapper which has pointers to: model, model container, space or date 2021-07-01 23:21:20 +02:00
Tomasz Sowa acb42f453c added support for two new ezc statements for clearing/trimming text nodes
[ezc clear_all_white_nodes "yes"]...[end] - will clear a text node if the text consists of only white characters
[ezc trim_text_nodes "yes"]...[end] - will trim text nodes (removes white characters at the beginning and at the end)

"yes" is assumed by default if not present, also "no" can be specified to change the behavior
2021-06-29 23:38:38 +02:00
Tomasz Sowa c2283f70d4 Generator when printing Model/Space is recognizing now such parameters:
- "dump" or "dump_to_space" parameters to make a dump in Space format
- "dump_to_json" parameter to make json dump
- "pretty" parameter to make the dump pretty (with new lines and indents)
2021-06-27 22:42:00 +02:00
Tomasz Sowa 3926793a17 fixed in Generator::CallSpace() when a middle field was a table: last_res should be set only for last field
refactoring in Generator::CallSpace()
2021-06-25 16:16:30 +02:00
Tomasz Sowa 5bd8eef3f2 make depend 2021-06-24 20:53:26 +02:00
Tomasz Sowa 16bce07c75 fixed: in Space::CallSpace() we should not increment field index when a new table item is prepared 2021-06-23 21:56:04 +02:00
Tomasz Sowa 87ee461dd1 make depend 2021-06-23 17:02:19 +02:00
Tomasz Sowa 526d57b72e added possibility to take a Space struct in Models: Models::Add(const std::wstring & name, pt::Space & space); 2021-06-23 06:53:43 +02:00
Tomasz Sowa eda276356f added possibility to iterate through Space object in Models objects 2021-06-22 18:01:47 +02:00
Tomasz Sowa e442ee4720 make depend 2021-06-20 16:55:39 +02:00
Tomasz Sowa 615bad7372 renamed macro: EZC_HAS_SPECIAL_STREAM -> EZC_GENERATOR_HAS_PT_STREAM
added macro EZC_GENERATOR_HAS_WINIX_STREAM which is used by Generator::CopyStream(pt::WTextStream & src_stream, StreamType & dst_stream, bool should_escape)
if this macro is defined then Generator is able to escape output stream
2021-06-20 16:54:55 +02:00
Tomasz Sowa 9c4fe51790 Generator uses now pt::Log as a logger
- added method SetLogger(pt::Log & logger)
- removed SetCommentary(...) methods
- added logs when a model is not found

PatternParser uses only pt::Log
- removed SetCommentary(...) methods
2021-06-19 20:18:30 +02:00
Tomasz Sowa d76bb9349b added typename keyword to Generator::CallModelHelper Generator::FindLastModelWrapper(...) 2021-06-18 18:55:39 +02:00
Tomasz Sowa 4a64336864 added support for morm containers with pointers to models 2021-06-17 21:33:28 +02:00
Tomasz Sowa abb60def6e added .editorconfig file 2021-06-16 14:21:08 +02:00
Tomasz Sowa 9022d4a5fc changed how models from morm library are used
now we are using morm::ModelWrapper... classes as wrappers on models and list/vector of models
and Models class is using these wrappers
this allows us to iterate through list/vectors in [for...] statements
2021-06-16 14:16:49 +02:00