Helmut Eller [Tue, 27 Dec 2016 08:42:45 +0000 (09:42 +0100)]
Implement SAVE-INPUT and RESTORE-INPUT
There used to be primitive tokens ID_SAVE_INPUT and ID_RESTORE_INPUT
but those weren't used. Saving/restoring positions in files is
somewhat involved so I decided to it in Forth. To support this, I
re-purposed the codes of ID_SAVE_INPUT and ID_RESTORE_INPUT to
save/store the current line number (ID_SOURCE_LINE_NUMBER_FETCH, and
ID_SOURCE_LINE_NUMBER_STORE). Those can also be used for something
like C's __LINE__ macro.
* fth/save-input.fth: New file.
* fth/loadp4th.fth: Load it.
* fth/system.fth (D=): New. Needed to compare file positions.
* fth/t_corex.fth: Add simple tests.
* csrc/pf_guts.h (ID_SOURCE_LINE_NUMBER_FETCH,
ID_SOURCE_LINE_NUMBER_STORE): Renamed from ID_SAVE_INPUT and
ID_RESTORE_INPUT.
* csrc/pf_inner.c (ID_SOURCE_LINE_NUMBER_FETCH,
ID_SOURCE_LINE_NUMBER_STORE): Implement.
(ID_SAVE_INPUT): Deleted. It's now in Forth.
* csrc/pfcompil.c (pfBuildDictionary): Define SOURCE-LINE-NUMBER@ and
SOURCE-LINE-NUMBER!.
Phil Burk [Tue, 27 Dec 2016 02:00:51 +0000 (18:00 -0800)]
Merge pull request #24 from ellerh/implement-environment-query
Implement environment-query
Helmut Eller [Mon, 26 Dec 2016 17:18:25 +0000 (18:18 +0100)]
List missing query strings in comment
Helmut Eller [Sun, 25 Dec 2016 23:33:10 +0000 (00:33 +0100)]
Implement ENVIRONMENT?
* fth/misc2.fth (ENVIRONMENT?): New.
(env=, 2env=, max-u, max-n): New helpers.
* fth/t_corex.fth: Add basic tests for ENVIRONMENT?.
Phil Burk [Sat, 24 Dec 2016 02:08:00 +0000 (18:08 -0800)]
Merge pull request #22 from ellerh/implement-included
Implement standard word INCLUDED
Phil Burk [Fri, 23 Dec 2016 19:26:36 +0000 (11:26 -0800)]
Merge pull request #23 from ellerh/forth2012-number-syntax
Recognize Forth 2012 number syntax
Helmut Eller [Wed, 21 Dec 2016 19:45:50 +0000 (20:45 +0100)]
Use C version of LWORD in INTERPRET
* csrc/pf_words.c (ffLWord): New.
(Word): Factored out from ffWord.
(ffWord): Call Word.
* csrc/pfcompil.c (ffInterpret): Use ffLWord instead of ffWord to
preserve case for NUMBER?. Can't use ffWord because that would
convert a character written as "'a'" to "'A'".
* csrc/pfcompil.h (ffLWord): Define prototype.
* fth/numberio.fth: Fix typso.
Helmut Eller [Wed, 21 Dec 2016 19:26:42 +0000 (20:26 +0100)]
Revert last commit.
Helmut Eller [Wed, 21 Dec 2016 10:14:31 +0000 (11:14 +0100)]
Define backward compatible version of WORD
* fth/system.fth (TOUPPER, UPCASE): New helpers.
(WORD, WORD-SAVE-AREA): New.
Helmut Eller [Mon, 19 Dec 2016 20:45:50 +0000 (21:45 +0100)]
Recognize Forth 2012 number syntax
Forth 2012 adds more convenient syntax for numbers and characters.
* csrc/pf_words.c (ffWord): Don't upcase input. Without this
change we can't support the '<char>' syntax.
(ffNumberQ): Recgonize new syntax.
* fth/numerio.fth (>number-with-base): New helper.
(((NUMBER?))): Recognize new syntax.
* fth/t_corex.fth: Add test for number prefixes, from Gerry Jackson's
Forth2012 test suite.
Phil Burk [Mon, 19 Dec 2016 16:20:08 +0000 (08:20 -0800)]
Merge pull request #21 from ellerh/fix-+loop
Fix +loop on 64-bit machines
Helmut Eller [Sun, 18 Dec 2016 10:57:03 +0000 (11:57 +0100)]
Implememnt standard word INCLUDED
* fth/system.fth (INCLUDED): Rewrite existing $INCLUDE to use addr+len strings.
($INCLUDE): Call INCLUDED.
(INCLUDE.MARK.START): Also take addr+len string as argument.
Helmut Eller [Sun, 18 Dec 2016 09:45:06 +0000 (10:45 +0100)]
Fix +loop on 64-bit machines
* csrc/pf_inner.c: Use idea from Gforth with signed arithmetic and
clever bit manipulation to avoid word size specific code.
* fth/t_corex.fth: +loop tests adopted from Gerry Jackson's Forth2012
test suite.
Phil Burk [Sat, 17 Dec 2016 23:18:33 +0000 (15:18 -0800)]
Merge pull request #18 from ellerh/travis-script
Add Travis configuration file
Helmut Eller [Fri, 16 Dec 2016 21:10:25 +0000 (22:10 +0100)]
Add Travis configuration file
Phil Burk [Fri, 16 Dec 2016 03:15:19 +0000 (19:15 -0800)]
Merge pull request #17 from ellerh/linux-crossbuild-amiga
Linux crossbuild Amiga
Helmut Eller [Mon, 12 Dec 2016 15:59:25 +0000 (16:59 +0100)]
Add Makefile to cross-compile from Linux to Amiga
This Makefile can be used to cross-compile pForth on a Linux host to
an Amiga target. GCC is used as host-compiler and VBCC as
cross-compiler.
* build/linux-crossbuild-amiga/Makefile: New file.
* csrc/pf_io.c, csrc/pf_inner.c: Add some quirks to satisfy VBCC. In
particular fseek and ftell needed some help.
Helmut Eller [Mon, 12 Dec 2016 15:39:17 +0000 (16:39 +0100)]
Instead of hardcoding PF_SEEK_* constants use SEEK_* values from stdio.h.
Helmut Eller [Mon, 12 Dec 2016 15:36:59 +0000 (16:36 +0100)]
Use static in definition too, not just in prototype declaration
* csrc/pfcompil.c (ffUnSmudge, FindAndCompile): VBCC refuses to
compile this unless function with static prototypes also have use
static definitions.
Phil Burk [Mon, 30 May 2016 00:13:40 +0000 (17:13 -0700)]
Merge pull request #16 from philburk/winattributes
gitattributes: add EOL attributes for various file types
Phil Burk [Mon, 30 May 2016 00:10:45 +0000 (17:10 -0700)]
gitattributes: add EOL attributes for various file types
Phil Burk [Wed, 27 Apr 2016 16:16:17 +0000 (09:16 -0700)]
Merge pull request #15 from philburk/round2
Implement FROUND
Phil Burk [Wed, 27 Apr 2016 16:14:49 +0000 (09:14 -0700)]
Implement FROUND
Phil Burk [Wed, 27 Apr 2016 15:56:48 +0000 (08:56 -0700)]
Merge pull request #14 from philburk/fixwhite
Fix white spaces.
Phil Burk [Wed, 27 Apr 2016 15:51:38 +0000 (08:51 -0700)]
Fix white spaces.
Convert tabs to spaces.
Remove trailing whitespaces.
Convert EOL to LF.
No real code changes.
Phil Burk [Sun, 27 Dec 2015 07:33:39 +0000 (23:33 -0800)]
Merge pull request #13 from philburk/fixrom
Fix $ROM
Phil Burk [Sun, 27 Dec 2015 07:31:41 +0000 (23:31 -0800)]
Fix $ROM
Was using DO instead of ?DO
so it failed on index 0.
Phil Burk [Sat, 25 Jul 2015 01:02:21 +0000 (18:02 -0700)]
Merge pull request #10 from philburk/fix-history
Fix auto.term in history
Phil Burk [Sat, 25 Jul 2015 00:50:12 +0000 (17:50 -0700)]
Fix auto.term in history
It was calling auto.init by mistake.
Signed-off-by: Phil Burk <philburk@mobileer.com>
Phil Burk [Sat, 25 Jul 2015 00:58:19 +0000 (17:58 -0700)]
Merge pull request #9 from philburk/fix-makefile
Fix Makefile for Mac clang
Phil Burk [Sat, 25 Jul 2015 00:51:31 +0000 (17:51 -0700)]
Fix Makefile for Mac clang
Signed-off-by: Phil Burk <philburk@mobileer.com>
Phil Burk [Wed, 15 Jul 2015 15:11:51 +0000 (08:11 -0700)]
Merge pull request #7 from letoh/fix-linux-build
Better Linux support
letoh [Wed, 15 Jul 2015 05:07:17 +0000 (13:07 +0800)]
use _GNU_SOURCE instead of _DEFAULT_SOURCE for older glibc
Phil Burk [Sat, 21 Feb 2015 02:48:59 +0000 (18:48 -0800)]
Merge pull request #4 from vuokko/master
Build fix and crossbuild example
Hannu Vuolasaho [Sat, 21 Feb 2015 01:44:05 +0000 (03:44 +0200)]
Sample crossbuild makefile
Crossbuild Makefile for building win32 without floating point support
Hannu Vuolasaho [Sat, 21 Feb 2015 00:37:25 +0000 (02:37 +0200)]
Makefile fix for Linux compilation
Simple fix to compile with GCC 4.9.2 on Arch Linux
Phil Burk [Sat, 31 Jan 2015 02:47:19 +0000 (18:47 -0800)]
Merge pull request #3 from avysk/fix-sign
allow Read32FromFile to return signed value
Alexey Vyskubov [Fri, 30 Jan 2015 22:33:09 +0000 (00:33 +0200)]
allow Read32FromFile to return signed value
Phil Burk [Wed, 24 Dec 2014 02:21:27 +0000 (18:21 -0800)]
Merge pull request #1 from philburk/fix-readme
Fix readme
Phil Burk [Wed, 24 Dec 2014 02:08:15 +0000 (18:08 -0800)]
[readme] Updated readme.txt to reflect new home on GitHub
Signed-off-by: Phil Burk <philburk@mobileer.com>
Phil Burk [Wed, 24 Dec 2014 02:08:15 +0000 (18:08 -0800)]
[readme] Updated readme.txt to reflect new home on GitHub
Signed-off-by: Phil Burk <philburk@mobileer.com>
burkphil [Tue, 13 Aug 2013 15:41:07 +0000 (15:41 +0000)]
Fix floating point conversion and printing.
D>F and F>D were broken for 64-bit versions of Forth.
A fix was proposed by Denis Bernard. Thanks Denis.
burkphil [Sat, 23 Mar 2013 05:53:29 +0000 (05:53 +0000)]
Remove trailing white space.
Fix link in readme.txt
burkphil [Fri, 8 Jun 2012 17:50:20 +0000 (17:50 +0000)]
Suppress CR in quiet mode, patch by Derek Fawcus.
Delete extra trace.fth file.
Fix some comments in t_floats.fth.
burkphil [Tue, 6 Dec 2011 18:57:15 +0000 (18:57 +0000)]
Change throw code for abort quote from -1 to -2.
burkphil [Tue, 30 Nov 2010 03:14:21 +0000 (03:14 +0000)]
From Aleksej,
Separate building of binary dictionary image
and C source (inlined) dictionary image.
Make CPPFLAGS, CFLAGS, LDFLAGS semantics more traditional.
XCPPFLAGS, XCFLAGS, XLDFLAGS contain "extension" flags now,
resetting them to empty values effects in building of bare pForth
without FPN support, optimisations and other features.
Declare phony (non-material) targets as suggested by standards.
Use parameters where names were hardcoded.
burkphil [Tue, 23 Nov 2010 19:26:21 +0000 (19:26 +0000)]
Add MINGW suport.
Change 32 to BL.
burkphil [Sun, 21 Nov 2010 22:21:54 +0000 (22:21 +0000)]
remove scribbled text from unit test
burkphil [Sun, 21 Nov 2010 19:11:30 +0000 (19:11 +0000)]
Add support for WATCOMC
Add size checks for C to Forth string conversion
phil@softsynth.com [Fri, 27 Aug 2010 17:50:07 +0000 (17:50 +0000)]
Improve Makefile to make it more standard and so that
everything is built in current directory (where make tool is invoked),
it relies only on one feature not guaranteed by POSIX/SUS, VPATH
(present in BSD and GNU Make), and it provides conventional variables to
provide compiler (CC), compiler flags (CFLAGS), preprocessor flags (CPPFLAGS),
linker flags (LDFLAGS), and additional libraries and objects to link to (LDADD).
Thanks to Aleksej for this mod.
phil@softsynth.com [Thu, 26 Aug 2010 22:02:31 +0000 (22:02 +0000)]
Fix inconsistent line endings. Thanks Aleksej.
phil@softsynth.com [Thu, 26 Aug 2010 02:07:37 +0000 (02:07 +0000)]
Fixed lots of warning and made code compatible with C89 and ANSI with -pedantic.
Use fseek and ftell on WIN32 instead of fseeko and ftello.
phil@softsynth.com [Mon, 23 Aug 2010 21:32:46 +0000 (21:32 +0000)]
Fix REPOSITION-FILE, HISTORY, locked file handle and other problems.
phil@softsynth.com [Sun, 1 Aug 2010 21:41:34 +0000 (21:41 +0000)]
Fix FILE-POSITION REPOSITION-FILE and FILE-SIZE. Now use double precision offsets.
phil@softsynth.com [Sun, 1 Aug 2010 20:38:49 +0000 (20:38 +0000)]
Add support for DELETE-FILE from Aleksej.
phil@softsynth.com [Mon, 5 Jul 2010 22:52:35 +0000 (22:52 +0000)]
Add patch from Aleksej for 64 bit cells on 32 bit system.
phil@softsynth.com [Thu, 20 May 2010 18:33:14 +0000 (18:33 +0000)]
fixes for M* and UM* from Aleksej
phil@softsynth.com [Thu, 20 May 2010 00:15:20 +0000 (00:15 +0000)]
V25 with 64-bit support
phil@softsynth.com [Thu, 8 Oct 2009 20:36:22 +0000 (20:36 +0000)]
Add -m32 and -x c to Makefile for 64-bit Snow Leopard.
phil@softsynth.com [Tue, 17 Mar 2009 22:40:47 +0000 (22:40 +0000)]
Fix build of posix io on sun.
phil@softsynth.com [Mon, 16 Mar 2009 01:42:33 +0000 (01:42 +0000)]
Fix Saushev spelling, allow space after -d, restore tty mode after dic loading error.
phil@softsynth.com [Fri, 20 Feb 2009 18:38:25 +0000 (18:38 +0000)]
Fixed POSIX IO, (ACCEPT) now emits SPACE at end of line.
phil@softsynth.com [Wed, 18 Feb 2009 17:59:02 +0000 (17:59 +0000)]
Fix cell increment error in RESIZE
phil@softsynth.com [Mon, 4 Aug 2008 17:41:23 +0000 (17:41 +0000)]
Documented change to Makefile.
phil@softsynth.com [Mon, 4 Aug 2008 17:36:41 +0000 (17:36 +0000)]
Removed -v from second mkdir.
phil@softsynth.com [Mon, 4 Aug 2008 17:35:25 +0000 (17:35 +0000)]
Remove -v option from mkdir for compatibility with FreeBSD.
phil@softsynth.com [Mon, 21 Jul 2008 22:26:04 +0000 (22:26 +0000)]
Remove debug statement.
phil@softsynth.com [Mon, 21 Jul 2008 21:04:50 +0000 (21:04 +0000)]
Remove stale pfdicdat.h
phil@softsynth.com [Mon, 21 Jul 2008 20:56:40 +0000 (20:56 +0000)]
Updated Makefile for Mac OS X
phil@softsynth.com [Mon, 21 Jul 2008 20:50:31 +0000 (20:50 +0000)]
Fix create-file for Mac OS X so that SDAD will work. The r/w fam now maps to "w+" mode.
phil@softsynth.com [Mon, 21 Jul 2008 02:58:11 +0000 (02:58 +0000)]
Initial import.