/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/function/function_token.vala

  • Committer: Gustav Hartvigsson
  • Date: 2024-12-22 00:42:11 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20241222004211-eg5i6yqp677vmc2n
[libvee/fast_number.vala] Removed debug code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
using Gee;
2
2
 
3
3
using VQDR.Expression;
4
 
using Utils;
 
4
using Vee;
5
5
 
6
6
namespace VQDR.Expression {
7
7
  public abstract class FunctionToken : Token {
18
18
    // We only store the type, as that is what is important.
19
19
    private static Gee.HashMap<string, Type?> _allowed_functions;
20
20
    
21
 
    protected const long UNDEFINED = long.MIN + 1; //+1 so that I can still use Long.MIN_VALUE.
 
21
    // +1 so that I can still use int64.MIN_VALUE.
 
22
    protected const int64 UNDEFINED = int64.MIN + 1; 
22
23
    /** Right arrow */
23
24
    protected const string CH_RARR = "\u2192";
24
25
    /** Left arrow */
72
73
    /** Truncated output: equal */
73
74
    protected const string SYM_TRUNK_PART_EQUAL = CH_EQUAL; //"="
74
75
    /** Truncated output: begin */
75
 
    protected const string SYM_TRUNK_BEGIN = SYM_BEGIN + SYM_TRUNK_PART_ELLIPSIS + SYM_TRUNK_PART_EQUAL; //"[...="
 
76
    protected const string SYM_TRUNK_BEGIN = SYM_BEGIN
 
77
                                           + SYM_TRUNK_PART_ELLIPSIS
 
78
                                           + SYM_TRUNK_PART_EQUAL; //"[...="
76
79
    /** Truncated output: end */
77
80
    protected const string SYM_TRUNK_END = SYM_END; //"]"
78
81
    
82
85
    
83
86
    
84
87
    /**
85
 
     * Ititialise the right functon token by it's name.
 
88
     * Initialise the right function token by it's name.
86
89
     * 
87
90
     * @param token Token of the Function.
88
91
     * @param position Token position.
89
92
     * @return An instance representing the function, or @c null if not found.
90
93
     */
91
 
    public static FunctionToken? init_token (string token, int position) {
 
94
    public static FunctionToken? init_token (string token, int32 position) {
92
95
      
93
96
      if (_allowed_functions == null) {
94
 
        // Intialise the HashMap if it is not created.
 
97
        // Initialise the HashMap if it is not created.
95
98
        _allowed_functions = new Gee.HashMap<string, Type?> ();
96
99
        
97
100
        Entry[] entries = {
144
147
    }
145
148
    
146
149
    protected FastNumber get_optional_child_raw_result (Context instance,
147
 
                                                  int index,
148
 
                                                  long default_result)
 
150
                                                  int32 index,
 
151
                                                  int64 default_result)
149
152
                                                  throws GLib.Error {
150
153
     Token? tmp_roll = get_child (index);
151
154