~paul-lucas/zorba/bug-907070

« back to all changes in this revision

Viewing changes to src/context/dynamic_context.h

  • Committer: Tarmac
  • Author(s): Markos Zaharioudakis
  • Date: 2012-01-18 12:50:24 UTC
  • mfrom: (10584.1.24 markos-scratch)
  • Revision ID: tarmac-20120118125024-g13kjalplchcfnwu
Fixed bug 917923 (bug in copying outer var values into the eval dynamic context) Approved: Markos Zaharioudakis

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
{
52
52
  friend class DebugIterator;
53
53
 
54
 
protected:
55
 
 
56
 
  struct dctx_value_t
57
 
  {
58
 
    typedef enum
59
 
    {
60
 
      no_val,
61
 
      ext_func_param, // params that can be used by ext. functions
62
 
      ext_func_param_typed 
63
 
    } val_type_t;
64
 
 
65
 
    val_type_t  type;
66
 
    void*       func_param;
67
 
  };
68
 
 
69
 
 
 
54
public:
70
55
  struct VarValue
71
56
  {
72
57
    typedef enum
81
66
    {
82
67
      store::Item*     item;
83
68
      store::TempSeq*  temp_seq;
84
 
    }          theValue;
 
69
    }           theValue;
85
70
 
86
71
    ValueState  theState;
87
72
 
92
77
 
93
78
    VarValue(const VarValue& other);
94
79
 
95
 
    ~VarValue(); 
 
80
    ~VarValue();
 
81
 
 
82
    bool isSet() const { return (theState == item || theState == temp_seq); }
 
83
 
 
84
    bool hasItemValue() const { return (theState == item); }
 
85
 
 
86
    bool hasSeqValue() const { return (theState == temp_seq); }
 
87
  };
 
88
 
 
89
protected:
 
90
 
 
91
  struct dctx_value_t
 
92
  {
 
93
    typedef enum
 
94
    {
 
95
      no_val,
 
96
      ext_func_param, // params that can be used by ext. functions
 
97
      ext_func_param_typed 
 
98
    } val_type_t;
 
99
 
 
100
    val_type_t  type;
 
101
    void*       func_param;
96
102
  };
97
103
 
98
104
  typedef HashMapZString<dctx_value_t> ValueMap;
140
146
 
141
147
  long get_implicit_timezone() const;
142
148
 
 
149
  const std::vector<VarValue>& get_variables() const { return theVarValues; }
 
150
 
143
151
  void add_variable(ulong varid, store::Item_t& value);
144
152
 
145
153
  void add_variable(ulong varid, store::Iterator_t& value);