Commit Graph

92 Commits (021f4643651230fccebd8b38b28c591bcab414cc)

Author SHA1 Message Date
Maikel de Vries 248f85c2eb Removed Defcore:Edible and OCF_Edible
Had no use in the engine, should therefore be defined in C4Script if deemed necessary.
2011-07-05 13:10:56 +02:00
Günther Brammer f97cde74c3 Split C4V_Any into C4V_Nil for the data type and C4V_Any for the typecheck 2011-05-09 14:37:28 +02:00
Günther Brammer af52109912 Small parser cleanups 2011-05-02 23:52:41 +02:00
Günther Brammer 9c4dabc810 Maintain a pointer to the last added bcc, instead of one after that 2011-04-13 02:16:55 +02:00
Günther Brammer e3bcd14db0 Simplify Parse_FuncHead 2011-04-18 01:50:33 +02:00
Günther Brammer baeffbc67f Let script functions have less than 10 parameters
Script functions using ... or Par() still take all 10
parameters, but those are the exceptions now. This makes
calling functions with few parameters faster.
2011-04-18 01:48:37 +02:00
Günther Brammer 63a3b546d5 Use bytecode to push variables onto the stack 2011-04-17 23:52:55 +02:00
Günther Brammer 50b6fcf47a Use AB_DUP instead of AB_PARN 2011-05-02 21:39:52 +02:00
Günther Brammer 0b8c2bba37 Use AB_DUP instead of AB_VARN 2011-05-02 21:53:58 +02:00
Günther Brammer fadacd3bb4 Move StrToI32 to lib/ 2011-05-01 18:55:02 +02:00
Günther Brammer 117cbe2b81 Script: Add warnings against wrong operator parameter types 2011-05-01 18:53:50 +02:00
Günther Brammer 7b640daedb Script: Add "\t" escape for tabulator 2011-04-13 23:51:35 +02:00
Günther Brammer 51d75e891b Move script operator parameter types from a table into the code
This makes the target type visible to the compiler.
2011-05-01 17:16:02 +02:00
Günther Brammer dbe7c37db0 Script: Only debug if the debugger was present before compilation
This saves a lot of AB_DEBUG bytecodes in the normal case.
2011-04-10 03:40:55 +02:00
Günther Brammer 435ed78cd9 Script: Remove unimplemented Par(n)=foo 2011-04-10 02:05:11 +02:00
Günther Brammer a3fab0234e Create PropLists with one bytecode instead of one per property 2011-04-09 21:35:16 +02:00
Günther Brammer 6768614feb Silence various warnings 2011-03-28 20:58:42 +02:00
Günther Brammer 24fe22faff Remove redundant check for AB_FUNC bytecode having a function
AB_FUNC always has a function.
2011-03-28 20:57:51 +02:00
Julius Michaelis 61d93c39cf Fixed some files which didn't include C4Include properly (all except C4Globals.cpp caused by 17d0ceb9ef2f) 2011-03-14 16:32:01 +01:00
Armin Burgmeier 41a1b5867d Change .c4g extension to .ocg 2011-03-13 16:16:45 +01:00
Günther Brammer 264009060c Script: Remove Method from function descs 2011-03-03 02:25:01 +01:00
Günther Brammer 7ce65373a3 Replace C4AList with some std::lists 2011-02-26 00:48:19 +01:00
Günther Brammer 5c18c7aa33 Reduce the time a C4String pointer sits in an integer variable 2011-02-22 00:07:08 +01:00
Günther Brammer 0bad4b7f59 Script: Parse negative numbers in nested constant expressions
Previously, local foo = [-1]; would complain about an unexpected '-'
operator.
2011-02-19 22:37:42 +01:00
Günther Brammer b9cf00d824 Script: obj->~foo() cannot have whitespace between -> and ~ anymore
This slightly simplifies the parser, as ->~ is now one token and ~ does not
double as binary not and call failsafety indicator.
2011-02-19 22:18:27 +01:00
Günther Brammer 16511790a9 Script: Do not disguise '.' and '=' as unrecognized tokens 2011-02-25 18:12:36 +01:00
Günther Brammer c667de49b5 Script: Crash when parsing a function call with more than ten parameters 2011-02-12 20:24:52 +01:00
Günther Brammer 7be90977bf Make C4ScriptHost have a C4ComponentHost member instead of inheriting
Previously, C4ScriptHost needlessly derived from two classes.
2011-02-06 21:37:19 +01:00
Günther Brammer cde66b249f C4Include.h: Do not include C4Gui.h
The two dialogs in headers included in C4Game.h are only used by classes in
those headers, and do not need to be defined in the headers.
2011-01-24 01:15:58 +01:00
Günther Brammer e939795a93 Script: Optionally warn about empty array expression entries 2011-02-02 22:07:46 +01:00
Günther Brammer 73d1d35800 Script: Optionally warn about empty function call parameters 2011-02-02 22:06:53 +01:00
Günther Brammer 5d3eff754b Script: Empty function parameters default to nil instead of 0 2011-02-02 21:45:46 +01:00
Günther Brammer ec7e35a25a Script: Optional warnings about deprecated functions and 0->nil conversion 2011-01-16 21:26:18 +01:00
Günther Brammer 846e707134 objects: Remove OCF_Living in favor of OCF_Alive 2011-01-02 19:40:48 +01:00
Günther Brammer be342d4a51 copyright notices update 2010
This time with more manual checking and using git blame -M -C, so that
a few cases of copied code get a copyright notice corresponding to
their initial introduction.
2010-12-23 01:01:24 +01:00
Günther Brammer 6025602038 Script: Correctly backtrace exceptions
Global functions conspire with appendto/include to make this all horribly
fragile.
2010-12-22 04:26:37 +01:00
Günther Brammer 40c24961dd Correctly map bytecode to linenumber for global/appended/included functions
The method to get the C4AulScript instance that stores the bytecode of a
function is ridiculous, but at least it's now capsuled in a function. While
at it, this also always stores the bytecode index instead of a bytecode
pointer in the function.
2010-12-22 02:10:58 +01:00
Günther Brammer b562acb32c Script: Remove EffectVar, update effect documentation 2010-12-21 21:57:40 +01:00
Nicolas Hake dbb75f98cb win64: Fix crash when a C4String gets allocated at >4GB 2010-12-16 17:26:52 +01:00
Günther Brammer 26c670b29d Improve internal C4PropList interface for predefined property names
SetProperty now also has a wrapper, and the common case of
GetPropertyVal(P_Foo) is now GetProperty(P_Foo).
2010-12-06 16:19:15 +01:00
Sven Eberhardt 7e971d7405 fix error when accessing &Code[0] on empty code during script parsing
caused by 4d1af7ffee78, when code was changed from a C style array into a std::vector
2010-12-07 19:27:59 +01:00
Günther Brammer d02c424dab Script: Split SPos out of the bytecode into an extra vector for speed
SPos is only needed to display debug messages. Not having that data in the
cache for normal execution speeds up script execution by ten percent on at
least one artificial benchmark.
2010-10-25 23:48:08 +02:00
Günther Brammer 4a256d1953 Script: Every identifier is allowed after a dot
Previously, the tokenizer would emit special tokens for a few keywords. Now
every keyword is handled by the parser. This allows one to use keywords as
identifiers everywhere it is unambiguous.
2010-10-20 00:37:31 +02:00
Armin Burgmeier 479362b87c Fix a crash bug on 64 bit 2010-09-22 02:14:16 +02:00
Günther Brammer 64f424cc51 Script: Add | operator to constants
This is the only operator that is necessary for the ActMaps. Ideally, every
operator would work, but I don't know how to achieve that without massive
code duplication. So just duplicate a little to make it work.
2010-09-09 22:41:41 +02:00
Günther Brammer b55c88d486 Script: Add initialization to local named variables (properties) 2010-09-09 22:36:00 +02:00
Günther Brammer ef76b26c4a Script: Save readonly proplists inline so that they do not need a number 2010-09-08 20:09:27 +02:00
Günther Brammer bf9137149c Script: Initial proplists are readonly at runtime
That way, recreating them from game data during savegame load won't
suddenly revert changes, because there aren't any changes.
2010-09-08 14:54:39 +02:00
Günther Brammer 984c3430ac Script: constants can contain proplists and arrays
Only supporting the literal syntax for them, with the same
constraints for the contents as for toplevel constants.
2010-09-09 02:18:19 +02:00
Günther Brammer e342dc9b35 Script: Remove last, already dead, traces of C4ID constants 2010-08-19 19:05:48 +02:00