/vqdr/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/vqdr/trunk

« back to all changes in this revision

Viewing changes to src/libvqdr/parser.vala

  • Committer: Gustav Hartvigsson
  • Date: 2022-06-01 18:16:29 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20220601181629-meq45diu7dh8iied
Made sure that no text rows exeed 80 columns.

Show diffs side-by-side

added added

removed removed

Lines of Context:
196
196
      if (context != null) {
197
197
        try {
198
198
          foreach (var key in variable_keys) {
199
 
            variable_cache.insert (key, Variable.copy (context.get_variable (key)));
 
199
            variable_cache.insert (key, Variable.copy
 
200
                                   (context.get_variable (key)));
200
201
          }
201
202
        } catch (Error e) {
202
203
          err_print_ln ("Something went wrong: (%: %)", e.domain, e.message);
251
252
     * @param operand_stack stack
252
253
     * @param operator operator.
253
254
     */
254
 
    protected void add_node (Stack<Token> operand_stack, Token operator) throws Error {
 
255
    protected void add_node (Stack<Token> operand_stack,
 
256
                             Token operator) throws Error {
255
257
      if (operator is FunctionToken) {
256
258
        FunctionToken funk = (FunctionToken) operator;
257
259
        int32 param_num = funk.next_child_num;
261
263
 
262
264
          operand_stack.push (funk);
263
265
        }
264
 
      } else if (operator is UnaryOperator && ((UnaryOperator) operator).is_unary) {
 
266
      } else if (operator is UnaryOperator &&
 
267
                 ((UnaryOperator) operator).is_unary) {
265
268
        if (operand_stack.elements < 1) {
266
 
          throw new OperandError.MISSING_OPERAND (@"Missing operand. Position: $(operator.position)");
 
269
          throw new OperandError.MISSING_OPERAND
 
270
                    (@"Missing operand. Position: $(operator.position)");
267
271
        }
268
272
      } else {
269
273
        if (operand_stack.elements < 2) {
270
 
          throw new OperandError.MISSING_OPERAND (@"Missing operand. Position: $(operator.position)");
 
274
          throw new OperandError.MISSING_OPERAND
 
275
                    (@"Missing operand. Position: $(operator.position)");
271
276
        }
272
277
        operator.set_right_child (operand_stack.pop ());
273
278
        operator.set_left_child (operand_stack.pop ());