aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/parser.cpp
AgeCommit message (Collapse)AuthorFilesLines
2014-11-10clarified conditions when <;> should yield an errorRobin Haberkorn1-2/+11
2014-11-10support new "~" conditional: useful for implying default parameters in macrosRobin Haberkorn1-6/+17
2014-11-09current_doc_must_undo(): check for undo-necessity when operating on the ↵Robin Haberkorn1-12/+25
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.
2014-11-09documented EC and EG commandsRobin Haberkorn1-0/+3
2014-11-09added EG command: pipe from buffer into Q-RegisterRobin Haberkorn1-0/+1
2014-11-09implemented EC command (execute operating system command) in spawn.cppRobin Haberkorn1-0/+2
powerful command for filtering a SciTECO buffer through an external program. It will be described in the sciteco(7) man pages. The implementation uses an asynchronous background process with pipes but is platform independant thanks to glib's g_spawn functions, GIOChannels and event loops. There are however platform differences in how the operating system command is interpreted/parsed.
2014-08-02don't abort on unexpected semicolon (break from loop)Robin Haberkorn1-1/+3
the question remains what to do then. FIXME: consult TECO standard
2014-02-18removed unreliable CHR2STR() macroRobin Haberkorn1-7/+13
* referencing temporaries is unreliable/buggy in GNU C++, at least since v4.7 * in higher optimization levels it resulted in massive memory corruptions * this is responsible for the build issues (PPA build issues) * instead, always declare a buffer on the stack which guarantees that the variable lives long enough * the g_strdup(CHR2STR(x)) idiom has been replaced with String::chrdup(x)
2014-02-15updated Copyright to year 2014Robin Haberkorn1-1/+1
2014-02-15added State::StdError class for constructing errors from std::exception objectsRobin Haberkorn1-5/+7
2014-02-15use GLib's GError information to yield errorsRobin Haberkorn1-2/+3
* results in better error messages, e.g. when opening files * the case that a file to be opened (EB) exists but is not readably is handled for the first time
2014-02-15fixed Execute::macro() and Execute::file() exceptionsRobin Haberkorn1-4/+29
* might throw other exceptions that must be associated with the parent macro level's (stack frame) * add position information to "label not found" errors * Error copy constructors
2014-02-15removed most exception specifications: allow bad_allocs to propagateRobin Haberkorn1-15/+15
* 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
2014-02-15glib allocation functions throw std::bad_alloc exceptions now; catch all ↵Robin Haberkorn1-4/+11
bad_allocs and convert them to State::Error * will allow some degree of OOM handling * currently does not work since the exception specifications prevent bad_allocs from propagating. exception specification usage must be completely revised
2014-02-15String::get_coord() calculates line and column of a string positionRobin Haberkorn1-1/+16
* use to get line and column into a stack frame
2014-02-15added support for TECO stack tracingRobin Haberkorn1-14/+57
* when an error is thrown, stack frames are collected on clean up, up to the toplevel macro * the toplevel macro decides how to display the error * now errors in interactive and batch mode are displayed differently * in batch mode, a backtrace is displayed as a sequence of messages * Execute::file() forwards errors correctly * the correct error in the file is displayed in interactive mode * necessary to build the stack trace
2013-07-05only allow command-line replacements when actually editing the replacement ↵Robin Haberkorn1-0/+7
register I felt the urge to implement that after accidentally rubbing out my entire commandline (the work of an hour) just by pressing "}"...
2013-03-19rewritten CHR2STR() using compound statementRobin Haberkorn1-2/+2
* fixes compilation on g++ 4.7 where compound literals are suddenly temporaries (from which you cannot get a pointer) * the compound statement (also GCC extension) should ensure that the string is allocated on the stack with automatic lifetime
2013-03-18explicitly instantiate MicroStateMachine: fixes compilation with gcc-4.4Robin Haberkorn1-1/+1
2013-03-18remove all unused-attributes for parametersRobin Haberkorn1-1/+1
* 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
2013-03-17^E\ string building character to format numberRobin Haberkorn1-14/+15
* new Expressions::format() * may be used format numbers as part of arrays (Q-Register names)
2013-03-16make success/failure conditional tests more consistent with the definition ↵Robin Haberkorn1-3/+9
of success/failure booleans * for the S and T conditions, nothing changes effectively (were testing for < 0 already) * the F and U conditions were testing for equality to zero which worked for condition booleans returned by commands but not for any failure condition (defined as >= 0) * may be different in classic TECOs but makes more sense IMHO
2013-03-16documented remaining commandsRobin Haberkorn1-2/+2
* 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.
2013-03-16completed documentation of all commands in parser.cppRobin Haberkorn1-1/+220
* also updated sciteco(7): add SEE ALSO and AUTHORS
2013-03-16documented commands ending in StateStartRobin Haberkorn1-0/+311
2013-02-25EM...$ command to read macro from file and execute immediately (just like "M")Robin Haberkorn1-0/+1
* useful for using macro libraries
2013-02-22use typedef for SciTECO integers and make it configurable at configure timeRobin Haberkorn1-17/+17
* 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
2013-02-16implemented command to query ASCII code of character (^^x)Robin Haberkorn1-0/+17
2013-02-14hide some implementation details in MicroStateMachinesRobin Haberkorn1-10/+7
2013-02-14use Q-Register micro state machine when parsing Q-Reg spec in ↵Robin Haberkorn1-38/+31
string-building commands * allows referring to long Q-Register names in string arguments * currently, long names specified this way use their own string building char parsing (I'm unsure whether this makes any sense)
2013-02-14rewritten string building state machine using a common MicroStateMachine ↵Robin Haberkorn1-100/+89
base class * uses label pointers instead of state-enum and switch case (both faster and shorter to write) * common interface for all micro state machines: makes them reusable
2013-02-08reverse Execute::step() change: no need to pass parameters by referenceRobin Haberkorn1-4/+2
cmdline and cmdline_pos is no longer modified by code executed by step() instead it is modified at the outermost macro level (commandline macro level)
2013-02-08use special Q-Register $ (<ESC>) to hold the replacement commandlineRobin Haberkorn1-24/+16
* allows us to switch between buffers/registers when editing the commandline
2013-02-08delegate commandline replacements ("}") to the cmdline macro levelRobin Haberkorn1-36/+18
allows commandline editing scripted by macros
2013-02-03first draft of commandline-editing commands ({ and } as in VideoTECO)Robin Haberkorn1-3/+75
* simplified traditional commandline editing. no need to extend cmdline string one character at a time when inserting multiple. instead there's a marker (cmdline_pos) specifying the macro length to execute in a "step" and also the anchor for generating undo tokens * implementation does not yet work in macro calls * while editing the commandline, other buffers/registers may not be edited (need push-down-list and auxiliary q-register)
2013-02-01fixed buffer Ring initializationRobin Haberkorn1-6/+11
* there was a dependency on interface initialization. it did not cause issues because destruction order was by chance. * introduced INIT_PRIO and PRIO_* macros to easy initialization order declaration (using a PRIO_* formula makes code self-documenting) * also used this to clean up QRegisterTable initialization (we do not need the explicit initialize() method) * also used to clean up symbols initialization
2013-01-23moved StateExpectQReg from parser.h to qregisters.hRobin Haberkorn1-28/+0
* parser.cpp|h should be reserved for generic and misc. stuff. the StateExpectQReg class is used almost exclusively by qregisters.cpp|h * resolves a circular header dependency issue
2013-01-23implemented special save last commandline command ("*" at beginning of ↵Robin Haberkorn1-0/+5
commandline macro) * only works as part of commandline macro, * at the beginning of other macros, it is treated like an arithmetic asterisk * variables defined in cmdline.cpp are now declared by new cmdline.h
2013-01-19updated copyright (2012-2013)Robin Haberkorn1-1/+1
2013-01-19allow <CTRL/C> to be typed; aborts last typed charRobin Haberkorn1-0/+3
* CTRL/C will be a command so it is important to be able to type it directly * aborting character processing is important because it allows aborting infinite loops * since the loop interruption currently relies on SIGINT handling, there is only limited support for XCurses and GTK - CTRL/C has to be typed in the terminal window. later support for input queue polling might be added
2012-12-04added copyright notice to every source fileRobin Haberkorn1-0/+17
2012-12-04first working version of autotools based build-systemRobin Haberkorn1-0/+4
2012-12-04autoconf preparation: move everything into src/ subdirRobin Haberkorn1-0/+1436