Commit Graph

86 Commits (master)

Author SHA1 Message Date
Daniel Kolesa b5127c52bf simplify exec_alias more 2021-05-14 23:31:27 +02:00
Daniel Kolesa 203e0bd5e4 exec_alias cleanups 2021-05-14 22:42:19 +02:00
Daniel Kolesa 6ffdc7fa91 various vm cleanups 2021-05-14 19:18:11 +02:00
Daniel Kolesa 036362683c kill call_with_args template 2021-05-14 02:54:29 +02:00
Daniel Kolesa 8b04bd1488 refactor vm scope guard 2021-05-14 02:36:16 +02:00
Daniel Kolesa 36fb06425b do not use lambdas with captures in vm 2021-05-13 04:48:55 +02:00
Daniel Kolesa 4dd1518f6c s/run/call/ 2021-04-30 02:55:20 +02:00
Daniel Kolesa d358dd83e7 halve the size of any_value by removing state pointer from it
this brings more advantages too like actually being default
constructible, so it can be used more easily in data structures etc
2021-04-11 03:32:33 +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 04441f206d remove the 255 run-depth limitation
also add optional per-thread API that sets the maximum run depth
(0 means no limit, default) if you want it; since we no longer
store stuff on the stack it should not be necessary though
2021-04-04 19:31:29 +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 881ba4bce9 prepare codebase for per-thread alias stack 2021-04-02 05:47:49 +02:00
Daniel Kolesa eddbf64c87 get rid of call_with_cleanup 2021-03-30 23:49:50 +02:00
Daniel Kolesa 4154944726 remove fixed-size argument stacks and reliance on argument ids 2021-03-30 00:28:06 +02:00
Daniel Kolesa 47f24d6e2e fix typo 2021-03-29 00:46:13 +02:00
Daniel Kolesa 8385ab01e7 use bitset to store usedargs and increase argcount to 32 2021-03-28 23:46:08 +02:00
Daniel Kolesa a37eb25d1c move public state methods where they belong 2021-03-27 00:26:59 +01:00
Daniel Kolesa d80af7b159 hide internal_state from public state struct 2021-03-25 01:37:42 +01:00
Daniel Kolesa 00b8312ad5 move most thread state into an internal structure 2021-03-24 20:33:20 +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 2cc1b0e271 add cs_std.cc, drop cs_util.hh 2021-03-23 01:46:56 +01:00
Daniel Kolesa 4588ae2373 separate cs_state, cs_std 2021-03-23 01:11:21 +01:00
Daniel Kolesa 702dca0809 separate ident and error impls into their own files 2021-03-22 22:33:15 +01:00
Daniel Kolesa 3d2f115de5 separate bytecode bits into its own file 2021-03-22 21:26:05 +01:00
Daniel Kolesa 3f866baccb strict reference counting for bytecode references 2021-03-21 18:45:59 +01:00
Daniel Kolesa a5b0ce5d72 drop cs_cmd_internal 2021-03-21 03:07:11 +01:00
Daniel Kolesa 436098cc38 drop the whole cs_alias_internal nonsense 2021-03-21 02:59:37 +01:00
Daniel Kolesa f8eb07ee2b hide implementation details of idents 2021-03-21 02:47:02 +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 08212df80f move shared state into cs_util 2021-03-19 02:27:36 +01:00
Daniel Kolesa 126d6ab2b6 use a stolen buffer for strupper/lower 2021-03-19 01:31:34 +01:00
Daniel Kolesa 64d9c0e749 make intstr/floatstr internal to cs_value 2021-03-19 00:12:47 +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 6ed9ae1235 get rid of standard i/o inside vm 2021-03-18 00:03:30 +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
Daniel Kolesa c004db42c6 refactor cs_value and related structures to contain state
this will allow us to intern strings inside cs_value
2021-03-17 01:26:30 +01:00
Daniel Kolesa dcae5b30b2 initial implementation of unique/interned string manager 2021-03-16 00:45:09 +01:00
Daniel Kolesa 8805594bc2 style fixes 2018-04-27 23:53:55 +02:00
Daniel Kolesa 8d62c09f88 fix build 2017-04-23 15:34:45 +02:00
Daniel Kolesa d744c6b1c6 remove dependency on types.hh 2017-04-04 00:28:56 +02:00
Daniel Kolesa 8343979e03 fix build after style update 2017-02-16 19:07:22 +01:00
Daniel Kolesa 3c093ce8ad compile fix 2017-02-14 18:33:45 +01:00
Daniel Kolesa 41eb8b211f begin naming scheme rework 2017-02-13 18:11:19 +01:00
Daniel Kolesa 58bf658409 update according to ostd 2017-01-30 19:38:11 +01:00