Commit graph

197 commits

Author SHA1 Message Date
Wolfgang (Blub) Bumiller
cd8043fc18 a failing 'parse-statement' call should not print 'parse error' at all since at that point more descriptive error message has to have been printed already 2012-10-28 15:53:30 +01:00
Wolfgang (Blub) Bumiller
634a544dca The proper way to deal with error messages which did not cause the parser to bail out early is this, not a 'parse error'-error... 2012-10-28 15:48:51 +01:00
Wolfgang (Blub) Bumiller
478a9249a0 add error for function parameters of invalid types 2012-10-28 15:44:27 +01:00
Wolfgang (Blub) Bumiller
201bfb9803 When erroring while parsing a function and the function had been added to the parser's function list, remove it, otherwise it'll get freed again in the parser's cleanup function 2012-10-28 15:28:39 +01:00
Wolfgang (Blub) Bumiller
5dd8e23dfd Cleaner crc implementation 2012-10-02 17:51:03 +02:00
Wolfgang (Blub) Bumiller
354dd94b95 Generating checksums 2012-10-02 17:09:49 +02:00
Wolfgang (Blub) Bumiller
9d70c3a56e Print a warning if end_sys_fields was declared as a field rather than a global 2012-10-02 15:59:37 +02:00
Wolfgang (Blub) Bumiller
4742ee9123 don't warn about unused end_sys_{globals,fields} 2012-10-02 15:35:43 +02:00
Wolfgang (Blub) Bumiller
ab91dea4e0 the lexer now doesn't _allocate_ the token structure, also: the vector holding the token doesn't shrink so we have much fewer reallocations 2012-08-24 17:37:55 +02:00
Wolfgang (Blub) Bumiller
20b8a191b1 parse_variable refactored, moved out the parsing of function bodies, easier memory handling 2012-08-24 17:23:47 +02:00
Wolfgang (Blub) Bumiller
e1155eebc2 renaming some parser functions, mainly shortining things: parse_type just looks much better than parser_parse_type... 2012-08-24 15:34:48 +02:00
Wolfgang (Blub) Bumiller
50e76a56c5 Adding static keyword to some more parser functions 2012-08-24 15:27:41 +02:00
Wolfgang (Blub) Bumiller
02512f21f2 create_vector_members sanitized 2012-08-24 15:09:51 +02:00
Wolfgang (Blub) Bumiller
41d1ef37d2 use the expression's linenumber for the 'statement has no effect' warning rather than the current one because that one's usually the line below... 2012-08-23 20:56:05 +02:00
Wolfgang (Blub) Bumiller
cb604603ca -Weffectless-statement now also triggers on effectless incrementors in for-loops, if an incrementor was specified 2012-08-23 20:54:24 +02:00
Wolfgang (Blub) Bumiller
45388202c4 -Weffectless-statement, on by default, creates 'statement has no effect' warning 2012-08-23 20:52:09 +02:00
Wolfgang (Blub) Bumiller
dff6328c9e add 'X has been declared here:' too the too-few/many-parameters warning/error 2012-08-23 20:48:51 +02:00
Wolfgang (Blub) Bumiller
8adbf07555 Warn about unused globals too, not about functions or constants though 2012-08-23 20:32:33 +02:00
Wolfgang (Blub) Bumiller
c84830bdee Warna bout unused variables - -Wunused-variable, on by default 2012-08-23 20:25:54 +02:00
Wolfgang (Blub) Bumiller
5022f716dc fix: check if parsing a variable initializer failed 2012-08-23 13:30:30 +02:00
Wolfgang (Blub) Bumiller
412446f42e -std=qcc now warns about variadic functions via -Wextensions 2012-08-23 11:33:50 +02:00
Wolfgang (Blub) Bumiller
f22112bcb8 Variadic functions: works for builtins, warns for implemenetd functions, -Wvariadic-function, on by default 2012-08-23 11:29:48 +02:00
Wolfgang (Blub) Bumiller
d4077f6884 Have the parser generate immediates AFTER generating the globals for correct def layout 2012-08-22 14:20:28 +02:00
Wolfgang (Blub) Bumiller
330a801ae9 Pop off all the locals after a function 2012-08-22 12:59:52 +02:00
Wolfgang (Blub) Bumiller
19b66800ae TYPE_FUNCTION values which are not constant are now allowed to be generated, they are function pointers. 2012-08-21 16:01:28 +02:00
Wolfgang (Blub) Bumiller
22896e5ef6 at last, the annoying missing ast_delete(typevar) 2012-08-21 11:21:05 +02:00
Wolfgang (Blub) Bumiller
d7f43dfa4d some more error situations where typevar wouldn't get freed 2012-08-21 11:18:40 +02:00
Wolfgang (Blub) Bumiller
8fcc528ffa new warning: -Wlocal-constants 2012-08-21 10:18:55 +02:00
Wolfgang (Blub) Bumiller
92e8f08df3 don't _move_ values out of immediates, it causes NULL strings to be code-generated 2012-08-21 10:08:17 +02:00
Wolfgang (Blub) Bumiller
02cc86db25 Since function prototypes now don't cause the function to become a constant, we cannot check for a constant in [frame,think] notations anymore 2012-08-20 18:27:27 +02:00
Wolfgang (Blub) Bumiller
0d64e555e2 Better handling of EOF - encountering EOF in parser_next will not return false yet, this is a more elegant way... 2012-08-20 18:15:31 +02:00
Wolfgang (Blub) Bumiller
5a0995c767 better handlign of a too early error condition 2012-08-20 18:14:02 +02:00
Wolfgang (Blub) Bumiller
198e35a823 Fix correction of parsiong of multiple variables: parse past the comma 2012-08-20 18:10:06 +02:00
Wolfgang (Blub) Bumiller
99bab76006 Creating the ast_function for a function only when encountering its body, so if no body is specified it works like a function pointer - just like QC wants it 2012-08-20 18:09:41 +02:00
Wolfgang (Blub) Bumiller
20448b93dc Corrected parsing of declarations of multiple variables 2012-08-20 17:59:19 +02:00
Wolfgang (Blub) Bumiller
f0f9680774 add the backticks for a warning 2012-08-19 20:41:31 +02:00
Wolfgang (Blub) Bumiller
af3d9e0bdf ir_value_set_string needs to use a strdup which doesn't return NULL for an emptystring 2012-08-19 20:35:51 +02:00
Wolfgang (Blub) Bumiller
c12e60a510 take 'warnreturn' into account, don't ignore the parsewarnin's Werror status 2012-08-19 20:32:07 +02:00
Wolfgang (Blub) Bumiller
7ef248aadb set -Wmissing-return-values to on by default, new warning: control reaches end of non-void... 2012-08-19 20:26:54 +02:00
Wolfgang (Blub) Bumiller
66ec592f94 parse_block gets a warn-return bool flag 2012-08-19 20:20:39 +02:00
Wolfgang (Blub) Bumiller
adda894976 have function declarations of functions with prototypes take over the actual declaration's body's context data 2012-08-19 19:39:58 +02:00
Wolfgang (Blub) Bumiller
481baeeedc relax parse_close_paren to allow values in parenthesis with no operators... duh 2012-08-19 19:35:45 +02:00
Wolfgang (Blub) Bumiller
a93ed6ae80 fix: use thinkfunc not nextthink, nextthink is set later 2012-08-19 19:25:37 +02:00
Wolfgang (Blub) Bumiller
bd64d7d7b4 Automatic prototyping of frame-functions 2012-08-19 19:24:43 +02:00
Wolfgang (Blub) Bumiller
dae13e87de First draft of handling the [frame,think] notation 2012-08-19 16:13:29 +02:00
Wolfgang (Blub) Bumiller
92d40e0925 Factoring out duplicate code into a function: create_vector_members; creating vector members for vector function parameters 2012-08-19 14:34:23 +02:00
Wolfgang (Blub) Bumiller
78d04a8352 implement correct behaviour for shadows locals 2012-08-18 21:56:42 +02:00
Wolfgang (Blub) Bumiller
ee3aaa58b3 -Wlocal-shadows - note that -std=gmqcc is very different from the rest 2012-08-18 21:54:19 +02:00
Wolfgang (Blub) Bumiller
deccf4e708 splitting parser_find_local up into find_local and find_param - find_local also takes a bool-ptr to tell the caller if it was a local or a global 2012-08-18 21:42:52 +02:00
Wolfgang (Blub) Bumiller
28891c5a37 quotes around the variable name in some messages 2012-08-18 21:35:47 +02:00