aboutsummaryrefslogtreecommitdiffstats
path: root/src/bc_lex.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix the problem where keywords can be redefined for builtin libsGavin Howard2021-07-221-4/+5
| | | | Signed-off-by: Gavin Howard <gavin@yzena.com>
* Change the keyword redefinition infrastructureGavin Howard2021-07-201-3/+2
| | | | | | | | | | | | | | | | | | | This changes it to use a command-line option. This is best because if a user encounters a problem; they *know* they are using my bc and can add the command-line option. This is also better because it allows the keyword to be used as variable and array names as well as function names, without editing the script. This has the double advantage that I can undo the change to the parser, though I need to keep the one line change to the lexer. The option is `-r` and `--redefine`, and they take an argument, which is the keyword to redefine. All docs and tests have been updated. Signed-off-by: Gavin Howard <gavin@yzena.com>
* Add the ability for users to redefine keywordsGavin Howard2021-07-201-0/+7
| | | | | | | | | | | | | | | | | | This was an idea from Stefan Esser of FreeBSD. At first, I did not like it because it seemed like it would require a deep change to the parser, to check everywhere a name could be used. Fortunately, I came up with the idea of using an array of booleans in BcVm to allow the parser to mark when a keyword has been redefined, which can only happen in one place: defining functions. This made the change to the parser simple at the expense of another simple change to the bc lexer (literally only one line). Because of the use of this feature in allowing users to make my bc parse GNU bc-compatible scripts, as well as interoperate with scripts from other bc's, I am putting this change in. Signed-off-by: Gavin Howard <gavin@yzena.com>
* Do a lot of doc work and refactor along the wayGavin Howard2021-07-161-1/+4
| | | | | | Yay! I finished commenting the code! Signed-off-by: Gavin Howard <gavin@yzena.com>
* Do a lot of documentation workGavin Howard2021-07-141-4/+0
| | | | Signed-off-by: Gavin Howard <gavin@yzena.com>
* Fix dc bugGavin Howard2021-06-271-6/+20
| | | | | | | | | This bug fix also made things much simpler. What it does is allow the lexers to ask for more data from stdin when needed, like when a string or comment is not ended properly. The dc bug was that it just didn't work well with register commands. Signed-off-by: Gavin Howard <gavin@yzena.com>
* Do even more documentation workGavin Howard2021-06-251-2/+52
| | | | Signed-off-by: Gavin Howard <gavin@yzena.com>
* Update copyright to 2021Gavin Howard2021-01-261-1/+1
|
* Move all headers back to include and rename the library headerGavin Howard2020-11-211-2/+2
|
* Start changing errors to accomodate the libraryGavin Howard2020-11-211-8/+8
|
* Move the status header backGavin Howard2020-11-211-1/+0
| | | | I am going to make a special header just for the library.
* Move more stuff around and fix all compiler errors and warningsGavin Howard2020-11-211-0/+410