Commit graph

8 commits

Author SHA1 Message Date
Bill Currie
92b476bf04 [qfcc] Make type attribute functions usable in expressions
Unfortunately, this require using different syntax for the two cases:
type.attr works in cases where types are expected, but not in
expressions (lots of shift/reduce and reduce/reduce conflicts). However,
treating type like an Objective-C class works nicely, though
`[type attrib(params)]` looks a little odd. However, this allows using
generic types to provide function calls (eg, converting texture
coordinates).
2025-01-15 18:31:37 +09:00
Bill Currie
186a781121 [qfcc] Allow single-constant attribute values
I don't remember why I though requiring a parameter list was a good
idea, but it makes working with attributes harder than it needs to be.
2024-09-20 12:28:02 +09:00
Bill Currie
c58748d640 [qfcc] Implement many glsl qualifiers as attributes
Attributes seem appropriate as GLSL's qualifiers affect variables rather
than types (since there's no typedef).

Not much is done with the attributes yet other than some basic error
checking (duplicates of non-layout attributes) and debug output, but
most (if not all) declarations get to the declaration code with
attributes intact.
2024-09-09 20:01:06 +09:00
Bill Currie
210a925be4 [qfcc] Make expressions const-correct
Or at least mostly so (there are a few casts). This doesn't fix the
motor bug, but I've wanted to do this for over twenty years and at least
I know what's not causing the bug. However, disabling fold_constants in
expr_algebra.c does "fix" things, so it's still a good place to look.
2023-09-29 10:15:59 +09:00
Bill Currie
81b544c362 [qfcc] Use non-invasive lists for most expressions
This covers attribute params, vector, state, and comma expressions. Just
function args to go, I think.
2023-09-25 16:57:15 +09:00
Bill Currie
d2e134cc22 [qfcc] Support multiple parameters for attributes
I have no idea why I threw away all but the *last* parameter (especially
considering nothing used parameters until now).
2023-08-25 22:13:54 +09:00
Bill Currie
795021e229 [util] Record allocated blocs for ALLOC
Recording the blocks makes it possible to free them later. As a
convenience, ALLOC_STATE declares the freelist and blocks vars needed by
ALLOC.
2023-03-05 18:31:30 +09:00
Bill Currie
b668759b7d [qfcc] Add a very basic attribute system
Ruamoko passes va_list (@args) through the ... parameter (as such), but
IMP uses ... to defeat parameter type and count checking and doesn't
want va_list. While possibly not the best solution, adding a no_va_list
flag to function types and skipping ex_args entirely does take care of
the problem without hard-coding anything specific to IMP.

The system currently just sets some bits in the type specifier (the
attribute list should probably be carried around with the specifier),
but it gets the job done for now, and at least gets things started.
2022-02-02 23:51:37 +09:00