137:73d057b030d0 | 138:a426c1039655 |
---|---|
111 fprintf (stderr, "error: %s\n", e.what()); | 111 fprintf (stderr, "error: %s\n", e.what()); |
112 return 1; | 112 return 1; |
113 } | 113 } |
114 } | 114 } |
115 | 115 |
116 // ============================================================================ | 116 // _________________________________________________________________________________________________ |
117 // | 117 // |
118 // Mutates given filename to an object filename | 118 // Mutates given filename to an object filename |
119 // | 119 // |
120 String makeObjectFileName (String s) | 120 String makeObjectFileName (String s) |
121 { | 121 { |
127 | 127 |
128 s += ".o"; | 128 s += ".o"; |
129 return s; | 129 return s; |
130 } | 130 } |
131 | 131 |
132 // ============================================================================ | 132 // _________________________________________________________________________________________________ |
133 // | 133 // |
134 DataType getTypeByName (String token) | 134 DataType getTypeByName (String token) |
135 { | 135 { |
136 token = token.toLowercase(); | 136 token = token.toLowercase(); |
137 return (token == "int") ? TYPE_Int | 137 return (token == "int") ? TYPE_Int |
140 : (token == "bool") ? TYPE_Bool | 140 : (token == "bool") ? TYPE_Bool |
141 : TYPE_Unknown; | 141 : TYPE_Unknown; |
142 } | 142 } |
143 | 143 |
144 | 144 |
145 // ============================================================================ | 145 // _________________________________________________________________________________________________ |
146 // | 146 // |
147 // Inverse operation - type name by value | 147 // Inverse operation - type name by value |
148 // | 148 // |
149 String dataTypeName (DataType type) | 149 String dataTypeName (DataType type) |
150 { | 150 { |
158 } | 158 } |
159 | 159 |
160 return ""; | 160 return ""; |
161 } | 161 } |
162 | 162 |
163 // ============================================================================= | 163 // _________________________________________________________________________________________________ |
164 // | 164 // |
165 String makeVersionString (int major, int minor, int patch) | 165 String makeVersionString (int major, int minor, int patch) |
166 { | 166 { |
167 String ver = String::fromNumber (major); | 167 String ver = String::fromNumber (major); |
168 ver += "." + String::fromNumber (minor); | 168 ver += "." + String::fromNumber (minor); |
171 ver += "." + patch; | 171 ver += "." + patch; |
172 | 172 |
173 return ver; | 173 return ver; |
174 } | 174 } |
175 | 175 |
176 // ============================================================================= | 176 // _________________________________________________________________________________________________ |
177 // | 177 // |
178 String versionString (bool longform) | 178 String versionString (bool longform) |
179 { | 179 { |
180 String result = makeVersionString (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); | 180 String result = makeVersionString (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); |
181 | 181 |