/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/value/value_token.vala

  • Committer: Gustav Hartvigsson
  • Date: 2021-09-11 15:17:37 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20210911151737-dd3g47oi04s029co
* Fixed valadoc stuff.
* moved ValueToken factory stuff into the ValueToken class.
* added an almost generic way of using the ValueToken factory stuff.
* Fixed some spelling errors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
    protected ValueToken (int position) {
5
5
      base (position);
6
6
    }
7
 
  }
8
 
  
9
 
  public static ValueToken? init_constant_token (long val, int position) {
10
 
    return new ConstantValueToken (val, position);
11
 
  }
12
 
  
13
 
  public static ValueToken? init_variable_token (string name, int position) {
14
 
    return new VariableValueToken (name, position);
15
 
  }
16
 
  
17
 
  
 
7
    
 
8
    public static ValueToken? init_constant_token (long val, int position) {
 
9
      return new ConstantValueToken (val, position);
 
10
    }
 
11
    
 
12
    public static ValueToken? init_variable_token (string name, int position) {
 
13
      return new VariableValueToken (name, position);
 
14
    }
 
15
    
 
16
    public static ValueToken? init_value_token (Value p1, int position) {
 
17
      switch (p1.type ()){
 
18
        case (Type.STRING):
 
19
          return init_variable_token (p1.get_string (), position);
 
20
        case (Type.LONG):
 
21
          return new ConstantValueToken (p1.get_long (), position);
 
22
      }
 
23
      return null;
 
24
    }
 
25
  }
18
26
  
19
27
}