Daniel Kolesa
3790435c34
add more codegen utils
2021-04-09 03:22:34 +02:00
Daniel Kolesa
51da22be06
add ivar/fvar/svar lookup funcs in codegen
2021-04-09 03:14:34 +02:00
Daniel Kolesa
bac186a0c7
move compileblockstr/compileunescapestr logic into gen
2021-04-09 02:54:36 +02:00
Daniel Kolesa
c0fc1aa452
abstract away ugly bcode reference creation
2021-04-09 01:12:52 +02:00
Daniel Kolesa
283f23394d
add more codegen utilities
2021-04-09 00:50:13 +02:00
Daniel Kolesa
5f67b205df
initial bits for separation of codegen from parser
2021-04-09 00:41:55 +02:00
Daniel Kolesa
ccb0c09d59
rename codegen_state to parser_state and move it
...
later commits will rewrite the parser and separate the codegen
bits into their own API
2021-04-08 23:35:30 +02:00
Daniel Kolesa
2de2c9b46c
remove get_raw_type from public interface
...
users of the library never need to know this
2021-04-07 00:30:39 +02:00
Daniel Kolesa
8c8aa26c20
return refs for new_*var and new_ident (guarantee valid result)
2021-04-05 19:52:13 +02:00
Daniel Kolesa
06b1661afd
hide thread_state, remove state::thread_pointer()
2021-04-05 04:10:39 +02:00
Daniel Kolesa
e65e141741
sanitize var names, provide cached builtins for var handlers
2021-04-04 06:47:17 +02:00
Daniel Kolesa
a789659387
minor cleanups
2021-04-04 05:36:19 +02:00
Daniel Kolesa
f0bb6b1410
make more api private
2021-04-03 06:16:43 +02:00
Daniel Kolesa
b00a08ea88
remove most variable code and leave it to user-defined handlers
...
the user can now define commands '//ivar', '//fvar' and '//svar'
which take identity (which is the variable) as the first argument
followed by any number of user defined arguments with types (one
can use the N argument type to check argument count, and when no
value arguments are provided, print the variable); this allows us
to implement different styles of variable setting without the
interpreter itself knowing about it, as well as ditch all the
stuff with overridden vars and hex vars and whatnot since this is
all specific to the engine and has no place in here
there is still leftover code remaining, which will get cleaned up
afterwards...
2021-04-03 03:16:57 +02:00
Daniel Kolesa
b9c74d86b5
msvc warning fixes
2021-03-31 02:21:32 +02:00
Daniel Kolesa
13d46881e8
windows fixes and other correctness/portability stuff
2021-03-31 01:13:35 +02:00
Daniel Kolesa
3dc6ad866f
make command argcount unlimited, remove maxargs checks from codegen
...
also adjust the bytecode appropriately, now you can call commands
with an unlimited number of args and aliases with max 32 args,
extra args will be ignored
2021-03-30 02:08:25 +02:00
Daniel Kolesa
f7ba70b8b2
fix conc instruction
2021-03-28 22:49:46 +02:00
Daniel Kolesa
064a7ea99b
document the instructions and drop more now useless vm code
2021-03-28 17:07:29 +02:00
Daniel Kolesa
3f513180f1
drop prevargs in codegen
...
since we now have a single, contiguous, unlimited VM stack, this
does not make any sense anymore (it was a limitation of the static
array)
2021-03-28 01:28:31 +01:00
Daniel Kolesa
71f45b2f07
fix up usage of IDENT_FLAG_UNKNOWN
2021-03-28 00:38:41 +01:00
Daniel Kolesa
99f227bfd9
unify arg and non-arg opcodes
2021-03-28 00:19:51 +01:00
Daniel Kolesa
d1e131dbf6
don't rely on MAX_ARGUMENTS where not necessary
2021-03-27 23:43:55 +01:00
Daniel Kolesa
a24f7c9385
remove leftover dead code
2021-03-27 00:32:27 +01:00
Daniel Kolesa
bd9a6cbf7c
eliminate more future private accesses
2021-03-26 02:59:42 +01:00
Daniel Kolesa
0b2c4c7038
pass thread_state in more places
2021-03-26 02:29:54 +01:00
Daniel Kolesa
d80af7b159
hide internal_state from public state struct
2021-03-25 01:37:42 +01:00
Daniel Kolesa
d774db675a
separate cs_gen.hh, various refactors
2021-03-24 02:21:32 +01:00
Daniel Kolesa
21aec59ad3
rename namespace to cubescript
2021-03-23 23:32:25 +01:00
Daniel Kolesa
b9b344cba6
remove cs_ namespace in all API
2021-03-23 23:29:32 +01:00
Daniel Kolesa
b3b4624af1
drop cubescript.cc, move parsing stuff from cs_std to cs_parser
2021-03-23 22:17:25 +01:00
Daniel Kolesa
4b766a380f
drop the util namespace
2021-03-23 02:02:43 +01:00
Daniel Kolesa
4b6c284ea1
separate cs_parser.cc, drop cs_util.cc
2021-03-23 02:00:23 +01:00
Daniel Kolesa
2cc1b0e271
add cs_std.cc, drop cs_util.hh
2021-03-23 01:46:56 +01:00
Daniel Kolesa
702dca0809
separate ident and error impls into their own files
2021-03-22 22:33:15 +01:00
Daniel Kolesa
a591384afd
use our allocator for more buffers
2021-03-21 06:13:45 +01:00
Daniel Kolesa
f8eb07ee2b
hide implementation details of idents
2021-03-21 02:47:02 +01:00
Daniel Kolesa
3905ff0e9d
fix/clean up compileblockstr
2021-03-21 00:00:20 +01:00
Daniel Kolesa
10b2a81cec
redo (un)escape_string around output iterators
2021-03-20 06:18:31 +01:00
Daniel Kolesa
5648c1a757
use string_view everywhere that returns or takes a string
2021-03-20 04:10:27 +01:00
Daniel Kolesa
b81e419db6
get rid of cs_vector in most places
2021-03-19 22:49:52 +01:00
Daniel Kolesa
4e5e0f5de8
get rid of cs_string in codegen
2021-03-19 22:25:38 +01:00
Daniel Kolesa
9d0494a9da
replace list_parser with a simpler api
2021-03-18 23:53:16 +01:00
Daniel Kolesa
704f9217f7
unify enum style
2021-03-18 20:55:14 +01:00
Daniel Kolesa
64130a12bf
remove handling of constants from codegen, bytecode and cs_value
...
also drop move semantics on cs_value
2021-03-17 20:41:08 +01:00
q66
d12e7f67ee
gcc warning fixes
2017-11-06 01:07:53 +01:00
q66
efdc82324e
fix includes
2017-06-20 21:21:39 +02:00
q66
d01349886a
remove slice_until
2017-06-15 20:44:09 +02:00
q66
f0f6dc437f
fix build
2017-04-17 17:13:14 +02:00
q66
73d1b142d1
fixes
2017-03-31 03:34:09 +02:00