xonotic/gmqcc.git
7 years agoMerge branch 'master' into test-suite
Dale Weiler [Mon, 19 Nov 2012 02:13:46 +0000 (02:13 +0000)]
Merge branch 'master' into test-suite

Conflicts:
Makefile
ir.c

7 years agoAdded test for variadic arguments
Dale Weiler [Mon, 19 Nov 2012 02:11:24 +0000 (02:11 +0000)]
Added test for variadic arguments

7 years agoAdded command line parsing to test-suite
Dale Weiler [Mon, 19 Nov 2012 02:05:18 +0000 (02:05 +0000)]
Added command line parsing to test-suite

7 years agostdout/stderr logging functional now.
Dale Weiler [Mon, 19 Nov 2012 00:22:57 +0000 (00:22 +0000)]
stdout/stderr logging functional now.

7 years agoTest suite now logs stdout/stderr to respective files
Dale Weiler [Sun, 18 Nov 2012 22:59:23 +0000 (22:59 +0000)]
Test suite now logs stdout/stderr to respective files

7 years agoFixing some indentation
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 19:56:11 +0000 (20:56 +0100)]
Fixing some indentation

7 years agoremove a redundant ir_function member
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 19:36:02 +0000 (20:36 +0100)]
remove a redundant ir_function member

7 years agoMake the disasm a bit more verbose as to where globals are
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 19:32:22 +0000 (20:32 +0100)]
Make the disasm a bit more verbose as to where globals are

7 years agodo not set a function-defs nargs to > 8
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 19:32:06 +0000 (20:32 +0100)]
do not set a function-defs nargs to > 8

7 years agoCALL to handle extparams, renamed extparams again
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 19:17:59 +0000 (20:17 +0100)]
CALL to handle extparams, renamed extparams again

7 years agoAdd a # prefix to EXTPARM%i
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 19:11:14 +0000 (20:11 +0100)]
Add a # prefix to EXTPARM%i

7 years agoMake functions copy their extparams
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 19:06:28 +0000 (20:06 +0100)]
Make functions copy their extparams

7 years agoMake the >8 parameter message a warning
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 18:19:38 +0000 (19:19 +0100)]
Make the >8 parameter message a warning

7 years agoImporting a tiny README file
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 18:15:20 +0000 (19:15 +0100)]
Importing a tiny README file

7 years agoImporting LICENSE file
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 18:14:06 +0000 (19:14 +0100)]
Importing LICENSE file

7 years agoChecking in an INSTALL file
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 17:54:10 +0000 (18:54 +0100)]
Checking in an INSTALL file

7 years agoAdding myself to main.c's copyright notice
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 16:06:26 +0000 (17:06 +0100)]
Adding myself to main.c's copyright notice

7 years agoAdded #include
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 15:22:07 +0000 (16:22 +0100)]
Added #include

7 years agoDon't skip the \n after parsing a pragma in the lexer otherwise 2 pragmas in the...
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 15:17:19 +0000 (16:17 +0100)]
Don't skip the \n after parsing a pragma in the lexer otherwise 2 pragmas in the row wouldn't work

7 years agopragma line(lineno) - sets the linenumber for the line after the pragma
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 14:32:03 +0000 (15:32 +0100)]
pragma line(lineno) - sets the linenumber for the line after the pragma

7 years agoBetter linecounting for pragmas; support for prgama file(filename)
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 14:30:40 +0000 (15:30 +0100)]
Better linecounting for pragmas; support for prgama file(filename)

7 years agoMake pragmas pass through the preprocessor so the user can write them manually
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 14:30:24 +0000 (15:30 +0100)]
Make pragmas pass through the preprocessor so the user can write them manually

7 years agofixup line counting in #pragmas
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 14:23:00 +0000 (15:23 +0100)]
fixup line counting in #pragmas

7 years agoExperimental support for push/pop(line) pragmas
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 14:14:42 +0000 (15:14 +0100)]
Experimental support for push/pop(line) pragmas

7 years agoupdate old_string after a recursive preprocess call so we don't reset to a free'd...
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 13:39:24 +0000 (14:39 +0100)]
update old_string after a recursive preprocess call so we don't reset to a free'd vector; add recursion header/footer pragmas

7 years agoComment about why stringify is so short
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 13:29:15 +0000 (14:29 +0100)]
Comment about why stringify is so short

7 years agodon't call parser_cleanup with -E
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 13:27:47 +0000 (14:27 +0100)]
don't call parser_cleanup with -E

7 years agoAdd quotes to the known control sequences... darn. Add stringification via #
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 13:26:40 +0000 (14:26 +0100)]
Add quotes to the known control sequences... darn. Add stringification via #

7 years agoThe ftepp now always outputs into a string buffer, with -E the buffer will be dumped...
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 12:33:53 +0000 (13:33 +0100)]
The ftepp now always outputs into a string buffer, with -E the buffer will be dumped to stdout or the via -o specified file, without -E it'll be passed to the parser to be compiled

7 years agoMerge branch 'master' into ftepp
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 12:06:29 +0000 (13:06 +0100)]
Merge branch 'master' into ftepp

7 years agoCollect accessor functions in the parser so they can later be deleted, fixed that...
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 12:06:16 +0000 (13:06 +0100)]
Collect accessor functions in the parser so they can later be deleted, fixed that leak

7 years agoRemoving some code duplication
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 12:00:18 +0000 (13:00 +0100)]
Removing some code duplication

7 years agoMake -E print to stdout by default and honor -o, changed handling of source list...
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 11:51:38 +0000 (12:51 +0100)]
Make -E print to stdout by default and honor -o, changed handling of source list a bit

7 years agoSince like with parsing, the preprocessor state has to be preserved across files...
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 10:54:11 +0000 (11:54 +0100)]
Since like with parsing, the preprocessor state has to be preserved across files for macros, we do that now, and with that introduce a new warning: -Wmultifile-if in case an #if spans over several command-line-provided source files (or progs.src file provided for that matter)

7 years agoSome printf/con_out/con_err conversions, guarded some outputs with not-opts_pp_only...
Wolfgang (Blub) Bumiller [Sun, 18 Nov 2012 10:43:46 +0000 (11:43 +0100)]
Some printf/con_out/con_err conversions, guarded some outputs with not-opts_pp_only so the -E switch can print to stdout normally

7 years agoMerge branch 'master' into ftepp
Wolfgang (Blub) Bumiller [Sat, 17 Nov 2012 10:34:00 +0000 (11:34 +0100)]
Merge branch 'master' into ftepp

7 years agoMerge branch 'master' into test-suite
Dale Weiler [Sat, 17 Nov 2012 10:02:21 +0000 (10:02 +0000)]
Merge branch 'master' into test-suite

Conflicts:
Makefile

7 years agoMore makefile changes
Dale Weiler [Sat, 17 Nov 2012 10:00:55 +0000 (10:00 +0000)]
More makefile changes

7 years agoinstall targets 0.1
Wolfgang (Blub) Bumiller [Sat, 17 Nov 2012 10:00:32 +0000 (11:00 +0100)]
install targets

7 years agoMerge branch 'master' into test-suite
Dale Weiler [Sat, 17 Nov 2012 09:56:48 +0000 (09:56 +0000)]
Merge branch 'master' into test-suite

Conflicts:
Makefile

7 years agoAdded more tests, fixed existing ones, and some more test system changes.
Dale Weiler [Sat, 17 Nov 2012 09:51:55 +0000 (09:51 +0000)]
Added more tests, fixed existing ones, and some more test system changes.

7 years agoTemporary list of dependencies for objects
Wolfgang (Blub) Bumiller [Sat, 17 Nov 2012 09:43:50 +0000 (10:43 +0100)]
Temporary list of dependencies for objects

7 years agoquick and dirty fix to lexerror for when fopen fails
Wolfgang (Blub) Bumiller [Sat, 17 Nov 2012 09:36:35 +0000 (10:36 +0100)]
quick and dirty fix to lexerror for when fopen fails

7 years agoremoving mem.c from this branch in preparation for 0.1
Wolfgang (Blub) Bumiller [Sat, 17 Nov 2012 09:35:52 +0000 (10:35 +0100)]
removing mem.c from this branch in preparation for 0.1

7 years agosigh
Dale Weiler [Sat, 17 Nov 2012 08:54:24 +0000 (08:54 +0000)]
sigh

7 years agoFix test suite
Dale Weiler [Sat, 17 Nov 2012 08:50:09 +0000 (08:50 +0000)]
Fix test suite

7 years agoActually add the tests
Dale Weiler [Sat, 17 Nov 2012 08:31:23 +0000 (08:31 +0000)]
Actually add the tests

7 years agoTest system works, and added some working tests!
Dale Weiler [Sat, 17 Nov 2012 08:10:31 +0000 (08:10 +0000)]
Test system works, and added some working tests!

7 years agoActually commit the new test stuff
Dale Weiler [Sat, 17 Nov 2012 02:55:33 +0000 (02:55 +0000)]
Actually commit the new test stuff

7 years agoNew test-suite initial implementation. Just need to write some tests.
Dale Weiler [Sat, 17 Nov 2012 02:54:30 +0000 (02:54 +0000)]
New test-suite initial implementation.  Just need to write some tests.

7 years agoLexer should keep newlines in merged lines, so will the preprocessor, but therefore...
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 22:13:53 +0000 (23:13 +0100)]
Lexer should keep newlines in merged lines, so will the preprocessor, but therefore the lexer will replace comments with actual spaces so we don't get borken output... also don't error about redifining a macro when inside a non-outputting #if branch

7 years ago## concatenation, -Wpreprocessor warning about redefining macros, #undef
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 21:54:59 +0000 (22:54 +0100)]
## concatenation, -Wpreprocessor warning about redefining macros, #undef

7 years agodon't error on non-EOL EOF at the end of a macro line
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 21:41:29 +0000 (22:41 +0100)]
don't error on non-EOL EOF at the end of a macro line

7 years agoalso use recursive-expansion on macros without parameters
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 21:38:58 +0000 (22:38 +0100)]
also use recursive-expansion on macros without parameters

7 years agorecursively call the preprocessor on expanded macros
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 21:31:51 +0000 (22:31 +0100)]
recursively call the preprocessor on expanded macros

7 years agoExpand macros into a string buffer
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 21:22:31 +0000 (22:22 +0100)]
Expand macros into a string buffer

7 years agomoving ftepp_delete out of ftepp_preprocess so that it can actually be called recursively
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 21:07:53 +0000 (22:07 +0100)]
moving ftepp_delete out of ftepp_preprocess so that it can actually be called recursively

7 years agoftepp_out can now output to a string buffer
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 21:06:07 +0000 (22:06 +0100)]
ftepp_out can now output to a string buffer

7 years agoCorrectly handle nested #ifs
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 21:02:38 +0000 (22:02 +0100)]
Correctly handle nested #ifs

7 years agoRelax the preprocessor condition: # in the middle of a line also counts, but take...
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 20:37:34 +0000 (21:37 +0100)]
Relax the preprocessor condition: # in the middle of a line also counts, but take care of builtin numbers since they use # as well

7 years agoFix a bug in macro call parameter parsing
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 20:27:15 +0000 (21:27 +0100)]
Fix a bug in macro call parameter parsing

7 years agoParsing parameters for a macro call
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 20:20:31 +0000 (21:20 +0100)]
Parsing parameters for a macro call

7 years agomacro_body parse function shouldn't skip whitespace inside
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 19:50:28 +0000 (20:50 +0100)]
macro_body parse function shouldn't skip whitespace inside

7 years agomoving ftepp_out further up, using it in ftepp_macro_call, generating output of param...
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 19:49:37 +0000 (20:49 +0100)]
moving ftepp_out further up, using it in ftepp_macro_call, generating output of parameter-less macros

7 years agoftepp_macro_call/ftepp_skipallwhite
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 19:46:52 +0000 (20:46 +0100)]
ftepp_macro_call/ftepp_skipallwhite

7 years agoAlso allow empty-parameter-list macros
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 19:41:20 +0000 (20:41 +0100)]
Also allow empty-parameter-list macros

7 years agoParsing basic macro body, no special tokens yet
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 19:38:44 +0000 (20:38 +0100)]
Parsing basic macro body, no special tokens yet

7 years agoSet the mergelines flag only for preprocessor commands
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 19:32:03 +0000 (20:32 +0100)]
Set the mergelines flag only for preprocessor commands

7 years agomergelines flag for the lexer to handle a backslash-newline
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 19:29:20 +0000 (20:29 +0100)]
mergelines flag for the lexer to handle a backslash-newline

7 years agofixing up dtors, parsing parameters of macros
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 19:15:04 +0000 (20:15 +0100)]
fixing up dtors, parsing parameters of macros

7 years agoUpdate #if description comment
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 19:04:30 +0000 (20:04 +0100)]
Update #if description comment

7 years agoUnary NOT in #if
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 19:02:27 +0000 (20:02 +0100)]
Unary NOT in #if

7 years agohandling the noops flag better now
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 18:32:02 +0000 (19:32 +0100)]
handling the noops flag better now

7 years agoParsing some basic #ifs with defined()
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 18:28:20 +0000 (19:28 +0100)]
Parsing some basic #ifs with defined()

7 years agoFixing indentation
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 18:07:23 +0000 (19:07 +0100)]
Fixing indentation

7 years agoSome #if parsing
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 18:01:44 +0000 (19:01 +0100)]
Some #if parsing

7 years agousing ftepp_out which will honor conditions
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 17:29:46 +0000 (18:29 +0100)]
using ftepp_out which will honor conditions

7 years agomacro structure, parsing ifdefs and non-macro defines
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 17:27:32 +0000 (18:27 +0100)]
macro structure, parsing ifdefs and non-macro defines

7 years agoBasic structure of ftepp
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 16:46:16 +0000 (17:46 +0100)]
Basic structure of ftepp

7 years agoimporting initial ftepp.c; -E option now executes the preprocessor
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 15:57:39 +0000 (16:57 +0100)]
importing initial ftepp.c; -E option now executes the preprocessor

7 years agoRemoving old make rules for ir/ast tests in deleted test/ dir
Wolfgang (Blub) Bumiller [Fri, 16 Nov 2012 15:42:30 +0000 (16:42 +0100)]
Removing old make rules for ir/ast tests in deleted test/ dir

7 years agoFree the 3 actual vectors, not the first 3 times
Wolfgang (Blub) Bumiller [Thu, 15 Nov 2012 20:40:32 +0000 (21:40 +0100)]
Free the 3 actual vectors, not the first 3 times

7 years agoFixing util_memory_r
Wolfgang (Blub) Bumiller [Thu, 15 Nov 2012 20:36:36 +0000 (21:36 +0100)]
Fixing util_memory_r

7 years agomoving _vec_remove above the 'exposed interface' comment
Wolfgang (Blub) Bumiller [Thu, 15 Nov 2012 20:24:31 +0000 (21:24 +0100)]
moving _vec_remove above the 'exposed interface' comment

7 years agoFix a typo causing NOTRACK to fail
Wolfgang (Blub) Bumiller [Thu, 15 Nov 2012 20:18:31 +0000 (21:18 +0100)]
Fix a typo causing NOTRACK to fail

7 years agoThis bug was what caused mem.c to crash, dear lord
Dale Weiler [Thu, 15 Nov 2012 20:04:05 +0000 (20:04 +0000)]
This bug was what caused mem.c to crash, dear lord

7 years agoReplacing lexer's vectors and getting rid of the macros
Wolfgang (Blub) Bumiller [Thu, 15 Nov 2012 17:48:38 +0000 (18:48 +0100)]
Replacing lexer's vectors and getting rid of the macros

7 years agoReplaced it all...
Wolfgang (Blub) Bumiller [Thu, 15 Nov 2012 17:32:03 +0000 (18:32 +0100)]
Replaced it all...

7 years agocleaned up empty lines
Wolfgang (Blub) Bumiller [Thu, 15 Nov 2012 10:02:16 +0000 (11:02 +0100)]
cleaned up empty lines

7 years agoSome man page changes
Dale Weiler [Thu, 15 Nov 2012 03:53:31 +0000 (03:53 +0000)]
Some man page changes

7 years agoSome more changes: added redirout/redirerr command line options
Dale Weiler [Thu, 15 Nov 2012 03:38:20 +0000 (03:38 +0000)]
Some more changes: added redirout/redirerr command line options

7 years agoadded --nocolor and fixed bug
Dale Weiler [Thu, 15 Nov 2012 00:50:05 +0000 (00:50 +0000)]
added --nocolor and fixed bug

7 years agoRemove test binary file
Dale Weiler [Thu, 15 Nov 2012 00:29:05 +0000 (00:29 +0000)]
Remove test binary file

7 years agoUse new console system everywhere.
Dale Weiler [Thu, 15 Nov 2012 00:28:46 +0000 (00:28 +0000)]
Use new console system everywhere.

7 years agoFIX TEH BLOCK
Dale Weiler [Wed, 14 Nov 2012 20:41:15 +0000 (20:41 +0000)]
FIX TEH BLOCK

7 years agoMerging in new-syntax
Wolfgang (Blub) Bumiller [Wed, 14 Nov 2012 20:39:16 +0000 (21:39 +0100)]
Merging in new-syntax

7 years agoRemove the tput shit
Dale Weiler [Wed, 14 Nov 2012 20:18:52 +0000 (20:18 +0000)]
Remove the tput shit

7 years agoFix teh bugs, thanks div0
Dale Weiler [Wed, 14 Nov 2012 19:38:05 +0000 (19:38 +0000)]
Fix teh bugs, thanks div0

7 years agoClever hack to determine terminal color support for *nix. Uses zero libraries :)
Dale Weiler [Wed, 14 Nov 2012 19:30:07 +0000 (19:30 +0000)]
Clever hack to determine terminal color support for *nix.  Uses zero libraries :)

7 years agopreliminary segregated console subsystem
Dale Weiler [Wed, 14 Nov 2012 19:17:43 +0000 (19:17 +0000)]
preliminary segregated console subsystem