Age | Commit message (Collapse) | Author | Files | Lines |
|
expression stack
this was probably a regression from d94b18819ad4ee3237c46ad43a962d0121f0c3fe
and should not be in v0.5.
The return value of Expressions::find_op() must always be checked since
it might not find the operator, returning 0 (it used to be 0).
A zero index pointed to uninitialized memory - in the worst case it
pointed to invalid memory resulting in segfaults.
Too large indices were also not handled.
This was probably responsible for recent PPA build issues.
Valgrind/memcheck reports this error but I misread it as a bogus warning.
I took the opportunity to clean up the ValueStack implementation and
made it more robust by adding a few assertions.
ValueStacks now grow from large to small addresses (like stack data
structures usually do).
This means, there is no need to work with negative indices into the
stack pointer.
To reduce the potential for invalid stack accesses, stack indices are
now unsigned and have origin 0. Previously, all indices < 1 were
faulty but weren't checked.
Also, I added some minor optimizations.
|
|
warnings
* Clang++ does not see that the PC will never go beyong g_assert(false),
and so reports about possible unitialized variables
|
|
string-utils.cpp and string-utils.h
* also improved performance of String::append() by using g_realloc()
* added String::append() variant for non-null-terminated strings
|
|
|
|
|
|
this eases handling of the "*" register
|
|
Template Pattern.
* without the one-view-per-buffer designs, many Scintilla send message (SSM)
calls could be inlined
* with the new design, this was no longer possible using the abstract
base classes. the CRT pattern allows inlining again but introduces
a strange level of code obscurity.
* tests suggest that at high optimization levels, the one-view-per-buffer
design and the CRT pattern reduces typical macro runtimes by 30%
(e.g. for symbols-extract.tes).
* only updated the NCurses UI for the time being
|
|
The user interface provides a Scintilla view abstraction and
every buffer is based on a view. All Q-Register strings use
a single dedicated view to save memory and initialization time
when using many string registers.
* this means we can finally implement a working lexer configuration
and it only has to be done once when the buffer is first added
to the ring. It is unnecessary to magically restore the lexer
styles upon rubout of EB (very hard to implement anyway). It
is also not necessary to rerun the lexer configuration macro
upon rubout which would be hard to reconcile with SciTECO's
basic design since every side-effect should be attached to a
character.
* this means that opening buffers is slightly slower now
because of the view initialization
* on the other hand, macros with many string q-reg operations
are faster now, since the document must no longer be changed
on the buffer's view and restored later on.
* also now we can make a difference between editing a document
in a view and changing the current view, which reduces UI calls
* the Document class has been retained as an abstraction about
Scintilla documents, used by QRegister Strings.
It had to be made virtual, so the view on which the document
is created can be specified by a virtual function.
There is no additional space overhead for Documents.
|
|
* the GError expection has been renamed to GlibError, to avoid
nameclashes when working from the SciTECO namespace
|
|
normally, since SciTECO is not a library, this is not strictly
necessary since every library should use proper name prefixes
or namespaces for all global declarations to avoid name clashes.
However
* you cannot always rely on that
* Scintilla does violate the practice of using prefixes or namespaces.
The public APIs are OK, but it does define global functions/methods,
e.g. for "Document" that clashed with SciTECO's "TECODocument" class at
link-time.
Scintilla can put its definitions in a namespace, but this feature
cannot be easily enabled without patching Scintilla.
* a "SciTECO" namespace will be necessary if "SciTECO" is ever to be
turned into a library. Even if this library will have only a C-linkage
API, it must ensure it doesn't clutter the global namespace.
So the old "TECODocument" class was renamed back to "Document"
(SciTECO::Document).
|
|
current document
if the current document is a local q-register from a macro call,
we must not generate undo tokens, since the local documents
are discarded on macro termination.
|
|
* used `delete` instead of `delete[]`
* don't know why this didn't cause problems (not even in valgrind)
|
|
|
|
* specifications resulted in runtime errors (unexpected exception) when bad_alloc ocurred
* specs should be used scarcely: only when the errors that may be thrown are all known
and for documentary purposes
|
|
* compiler does not warn by default: this actually makes sense
* so we don't need any unused-attributes
* less GCC-extension based
* on older GCCs I think -Wunused-parameters was enabled by -Wall
we should add -Wno-unused-parameters if that's the case
|
|
since including glib.h on LLVM-Clang (32-bit) results in NULL being
redefined to 0 and compiler warnings being emitted when NULL is used
as sentinels
|
|
specifications
* allows full Q-Reg syntax
|
|
* flow control and other structures have not been documented this ways.
I have not yet decided whether they should be documented in separate
sections or use the documentation tool.
|
|
* storage size should always be 64 (gint64) to aid macro portability
* however, for performance reasons users compiling from source might
explicitly compile with 32 bit integers
|
|
|
|
rubout would undo something different and screw up editor state
|
|
* updated TODO
|
|
|
|
|
|
|
|
|