Doug Coleman
76580da5d5
Refactor the lexer/parser to expose friendlier words for scanning tokens. The preferred top-level words now throw an exception on EOF.
...
CREATE -> scan-new
CREATE-CLASS -> scan-new-class
CREATE-WORD -> scan-new-word
CREATE-GENERIC -> scan-new-generic
scan -> (scan-token)
scan-token now throws on eof
(scan-word) returns word/number/f
scan-word now throws on eof
scan-word-name expects a non-number
Fixes #183 .
Fixes #209 .
2011-09-29 11:28:28 -07:00
Doug Coleman
3826febfae
Fixes the symptom but not the problem. See bug #201 .
2011-09-26 17:32:34 -07:00
Doug Coleman
11bd334abb
Trim down a few using lists
2011-09-26 13:42:46 -07:00
John Benediktsson
4f42c72012
specialized-arrays: performed some cleanup.
...
Specifically,
• Created >c-array to be replacement for >T-array.
• Created cast-array to be generic replacement for all T-array-cast words.
• Created c-array@ to be generic replacement for T-array@ words.
• Replaced usages of <T-array> with T <c-array>
• Replaced usages of <direct-T-array> with T <c-direct-array>
• Replaced usages of >T-array with T >c-array
• Replaced usages of T-array-cast with T cast-array
• Replaced usages of malloc-T-array with T malloc-array.
• Removed malloc-T-array.
• Removed T-array-cast.
• Removed T-array@.
• Removed >T-array.
I also added (but didn't change any code to use):
• T c-array-type, returns T-array
• T c-array?, returns T-array?
• c-array{ T ... }, returns T-array{ ... }
Bootstraps just find on Mac OS X. Also `load-all test-all` works for me.
2011-09-26 11:37:51 -07:00
John Benediktsson
82e34082ec
classes.struct: add test cases for see on structs.
2011-09-25 17:25:28 -07:00
John Benediktsson
e49c3d17b5
classes.struct: Fix prettyprint for PACKED-STRUCT. Fixes #162 .
2011-09-24 17:55:13 -07:00
Slava Pestov
01eeabbcbd
Merge classes.struct.packed into classes.struct and remove duplication
2011-08-25 21:02:25 -07:00
Erik Charlebois
64252dbdbc
32 and 64 bit Linux PPC support
2011-05-23 23:36:14 -04:00
Slava Pestov
d450d12b2b
classes.struct: fields with a type that's an array of pointers (eg int*[3]) now work
2010-08-15 02:44:21 -07:00
Slava Pestov
72dfb3339f
classes.struct: make hashcode and equal? work on structs wrapping null pointers, to fix another obscure issues arising with tuple arrays
2010-08-06 00:15:22 -07:00
Slava Pestov
8a0525e5ce
Add a scan-token word which is like scan, except throws an error on EOF; document scan-object word; mention that scan-token/scan-object are preferred over scan/scan-word
2010-07-06 16:20:08 -04:00
Slava Pestov
7d64fe50a1
classes.struct: remove conflict marker from unit tests
2010-06-22 14:35:49 -04:00
Doug Coleman
ec2b8da7c7
conflicts
2010-06-16 16:23:29 -05:00
Joe Groff
6e9235b54b
classes.struct: fix some bugs in binary-zero?, add unit tests
2010-06-16 16:23:29 -05:00
Joe Groff
c8ea7ed0c7
alien.data: make binary-zero? public and move it from classes.struct.private
2010-06-10 17:05:43 -07:00
Joe Groff
e84b2e8c60
classes.struct: fix some bugs in binary-zero?, add unit tests
2010-06-10 16:49:59 -07:00
Joe Groff
b5cc5ef4a7
classes.struct: implement "group-words" method on struct-class so that struct classes can be used as a CONSULT: protocol
2010-06-08 12:52:46 -07:00
Slava Pestov
ba7cb61133
Stack allocation improvements
...
- New with-out-parameters combinator
- Inhibit tail call optimization in frames with local allocation, to ensure that passing a stack allocated value to the last word in the quotation works
- local allocations are now aligned properly
- spill slots are now aligned properly aligned in frames which have parameter and local allocation areas
2010-05-22 02:37:00 -04:00
Slava Pestov
5b48cd2a63
FFI rewrite part 5: return value boxing and callback parameter boxing now uses vregs; simplify return value unboxing
2010-05-16 03:43:23 -04:00
Slava Pestov
0cde5c8fb5
Eliminate compiler.alien
2010-05-11 23:24:47 -04:00
Slava Pestov
ee0640f176
Move flatten-c-type to death row so that it can be executed in part 5
2010-05-11 22:26:31 -04:00
Slava Pestov
eb802208d1
FFI rewrite part 4: parameter and return value unboxing redesign
2010-05-11 19:11:44 -04:00
Slava Pestov
c211c3e84e
FFI rewrite part 1: split up ##alien-invoke and friends into smaller instructions
2010-05-09 21:36:52 -04:00
Slava Pestov
627295f094
Language change: tuple slot setter words with stack effect ( value object -- ) are now named FOO<< instead of (>>FOO)
2010-05-06 17:21:02 -04:00
Slava Pestov
e763c74096
More FFI cleanups
2010-05-05 01:13:45 -04:00
Slava Pestov
de8e0ccd5c
alien.c-types: cleanup
2010-05-04 19:33:55 -04:00
Daniel Ehrenberg
879687521d
Documenting bitfields in structs
2010-04-25 18:09:58 -05:00
Daniel Ehrenberg
aa6158b366
Changing require-when usages to the new syntax for require-when
2010-04-18 14:29:24 -05:00
Slava Pestov
3c11991843
classes.struct, specialized-arrays: fix unit tests to work when forget-tests? is on
2010-04-12 18:29:47 -07:00
Daniel Ehrenberg
eb060443db
Updating code to use require-when rather than vocab [ require ] when
2010-03-18 01:13:37 -04:00
Joe Groff
f2999ce778
classes.struct: raise an error in STRUCT: if there are duplicate slot names
2010-02-25 11:52:21 -08:00
Slava Pestov
af0ddd5985
Specialized arrays, structs and other objects responding to the >c-ptr / byte-length protocol can now be written to binary streams
2010-02-24 20:18:41 +13:00
Joe Groff
4cfa1a6c77
rename current string-mangling "char*" to "c-string". char* is now just a boring old pointer to char
2010-02-23 11:42:02 -08:00
Joe Groff
b8bd5fe630
classes.struct: reader-quot was checking struct-slot-spec for array-ness, not the type! derp
2010-02-22 23:57:10 -08:00
Joe Groff
1bf37f01e5
alien.arrays/classes.struct: ensure specialized array types for struct array slots get instantiated at parse time
2010-02-22 12:21:29 -08:00
Joe Groff
c7acbda342
classes.struct: set dependency on slot types in slot accessors, so that accessors update when types change. enables pointers to make circular references between struct types
2010-02-21 22:46:52 -08:00
Joe Groff
5b726f0af9
add missing using to classes.struct tests
2010-02-21 22:04:23 -08:00
Joe Groff
5955ba06df
use a "pointer" wrapper tuple to indicate pointer types instead of the current slipshod approach
2010-02-21 16:27:36 -08:00
Joe Groff
9b0530dc97
remove string c-types from classes.struct tests
2010-02-21 13:01:29 -08:00
Joe Groff
62e97c138a
ditch string c-types
2010-02-21 10:58:21 -08:00
Slava Pestov
01824d41be
Add support for final tuple classes which cannot be subclassed: TUPLE: foo ... ; final
2010-02-18 02:19:57 +13:00
Slava Pestov
e929d906ce
classes: If a tuple class with subclasses is redefined into something that's not a tuple class, subclasses are changed to inherit from 'tuple' instead of being forgotten. Also, changing the metaclass of a union or intersection member no longer removes it from the union or intersection. Finally, make some internal words private
2010-02-01 02:48:39 +13:00
Doug Coleman
4c71d71907
random is generic now -- iota random -> random
2010-01-14 12:48:57 -06:00
Slava Pestov
df4fb4a3ee
Removing integers-as-sequences
2010-01-15 07:15:33 +13:00
Joe Groff
67cc1c01be
Merge branch 'master' into simd-cleanup
2009-11-26 16:14:46 -08:00
Slava Pestov
0612bc6177
Factor source files should not be executable
2009-11-21 17:50:43 -06:00
Slava Pestov
c0588221cf
classes.struct: compute slot offsets before alignment to fix struct size problem on PPC
2009-11-19 19:34:46 -06:00
Joe Groff
f544982fda
Merge branch 'master' of git://factorcode.org/git/factor into simd-cleanup
...
Conflicts:
basis/math/vectors/simd/functor/functor.factor
2009-11-14 21:02:39 -06:00
Slava Pestov
e9a7191050
Fix struct field alignment on PowerPC
2009-11-10 19:34:14 -06:00
Joe Groff
9184254f2c
move define-inline-method from classes.struct.private to generic.parser
2009-11-01 22:10:28 -06:00
Joe Groff
3fbe722561
Merge branch 'master' of http://factorcode.org/git/factor
...
Conflicts:
basis/locals/locals.factor
basis/peg/peg.factor
extra/infix/infix.factor
2009-10-28 16:17:24 -05:00
Joe Groff
6e1bffb1c5
update existing code to use :> ( ) when possible
2009-10-28 16:11:33 -05:00
Doug Coleman
93de179c2f
over push -> suffix!, over push-all -> append!
2009-10-28 15:29:01 -05:00
Doug Coleman
7ce4b746e5
parsed -> suffix!, add append!
2009-10-28 13:38:27 -05:00
Daniel Ehrenberg
bb93543054
Another identity in value numbering for bitfields
2009-10-08 15:20:42 -05:00
Daniel Ehrenberg
891b7c9804
Cleaning up classes.struct.bit-accessors code
2009-10-08 14:01:43 -05:00
Daniel Ehrenberg
8841969ca1
Refactoring bitfield accessors to eliminate code duplication
2009-10-08 13:45:52 -05:00
Daniel Ehrenberg
db927ff0ad
Making struct bitfield writers fast
2009-10-08 13:10:51 -05:00
Daniel Ehrenberg
3179dacb3e
Making struct bitfield readers fast
2009-10-07 23:51:18 -05:00
Daniel Ehrenberg
4e1aa8f638
Modifying the struct prettyprinter to display bits
2009-10-07 21:42:15 -05:00
Daniel Ehrenberg
1a2c137e41
Refactoring bitfields to not use number tower
2009-10-07 21:35:12 -05:00
Daniel Ehrenberg
e0408b9b10
Adding bit fields to STRUCT:
2009-10-07 01:43:32 -05:00
Keith Lazuka
405e5d015b
docs: change $subsection to $subsections
2009-10-02 12:15:48 -04:00
Slava Pestov
4abfe06b51
Fixing various test failures caused by C type parser change, and clarify C type docs some more
2009-09-28 08:48:39 -05:00
Slava Pestov
77fa16c76f
alien: improve documentation
2009-09-26 21:28:11 -05:00
Slava Pestov
de2693cb36
classes.struct: store aligned size in struct-size word-prop
2009-09-24 19:54:32 -05:00
Slava Pestov
beab46517e
tools.deploy: fix test 11
2009-09-24 13:00:26 -05:00
Joe Groff
91dc6adc2e
fix classes.struct bootstrap
2009-09-24 12:07:41 -05:00
Joe Groff
eec283354e
clean up classes.struct code. don't set a bunch of redundant word-props on struct class words
2009-09-24 11:32:25 -05:00
Joe Groff
cba071c969
don't construct a prototype for struct classes that don't need it
2009-09-23 19:41:46 -05:00
Doug Coleman
5cb34724b7
Merge branch 'master' of git://factorcode.org/git/factor
...
Conflicts:
basis/classes/struct/struct-tests.factor
basis/functors/functors-tests.factor
basis/specialized-arrays/specialized-arrays-tests.factor
2009-09-20 23:02:49 -05:00
Doug Coleman
eceed177d6
replace usages of <" with """
2009-09-20 22:42:40 -05:00
Joe Groff
076ab42dc3
move some allocation words that don't really have much to do with c types out of alien.c-types into a new alien.data vocab
2009-09-17 22:36:05 -05:00
Joe Groff
21c09ab97a
fix struct class see
2009-09-16 09:56:07 -05:00
Joe Groff
01d2ef415a
get compiler tests loading
2009-09-16 09:20:47 -05:00
Joe Groff
93b12d3ef4
update classes.struct tests to use word c-types
2009-09-15 22:43:11 -05:00
Joe Groff
3b4330fcf6
get things to a point where they bootstrap again
2009-09-15 21:43:18 -05:00
Joe Groff
3c541f736f
fix failing classes.struct tests
2009-09-15 19:10:05 -05:00
Joe Groff
cc680ae698
Revert "make struct classes print properly in the status bar"
...
This reverts commit 4ee1a4f9e8
.
2009-09-15 18:56:17 -05:00
Joe Groff
4d16c569f0
struct classes now make their own C type without help from alien.structs. remove alien.structs dependencies from everywhere outside of alien and compiler, and have the FFI handle both alien.structs and classes.struct c-types
2009-09-15 17:38:49 -05:00
Joe Groff
3c98ec95e2
make struct classes print properly in the status bar
2009-09-15 15:16:53 -05:00
Slava Pestov
d5bc1ceca2
classes.struct: fix some bugs
...
- STRUCT: foo<ENTER> in listener threw an error
- S{ did not throw an error when used with non-struct types
- attempting to subclass a struct class now fails
- forgetting a struct class now removes the corresponding C type
- 'see'ing a struct class now indents correctly
2009-09-10 15:59:27 -05:00
Slava Pestov
7f2e2b1777
Specialized array overhaul
...
- Replace hand-written specialized-arrays.* subvocabularies with new system; instead of USE:ing specialized-arrays.T, do SPECIALIZED-ARRAY: T
- Ditto for specialized-vectors; use SPECIALIZED-VECTOR:
- io.mmap.functor: removed entirely, use <mapped-array> instead
- struct-arrays and struct-vectors have been removed because specialized arrays and vectors subsume them entirely
2009-09-09 22:33:34 -05:00
Joe Groff
f2212acd46
Merge branch 'master' into strong-typing
2009-09-08 15:53:20 -05:00
Slava Pestov
a1ae209f81
compiler.tree.propagation.call-effect: stronger call( inlining; now can inline 'a [ b ] curry call(' where 'a' is literal, [ b ] doesn't infer, but [ a b ] does infer. This simplifies classes.struct:memory>struct
2009-09-07 17:45:03 -05:00
Slava Pestov
1798000335
Fix unit tests for specialized-arrays.direct change
2009-09-05 02:26:06 -05:00
Slava Pestov
a054ec3d64
specialized-arrays.direct is no more; instead, every specialized-array.<foo> vocabulary has a <direct-T-array> constructor
2009-09-04 22:01:55 -05:00
Joe Groff
366946348c
make struct-mirror an instance of assoc
2009-09-03 22:31:55 -05:00
Joe Groff
521b3ab12c
forget the old struct class when redefining a struct class so the old accessors get purged
2009-09-03 11:12:58 -05:00
Joe Groff
32cba4dad3
metadata for classes.struct
2009-09-01 15:49:21 -05:00
Joe Groff
d893f3cdb7
put a more useful mirror over structs
2009-08-31 22:26:03 -05:00
Joe Groff
4cbd4d4b5c
update classes.struct tests, and make struct prettyprinting work again
2009-08-31 20:46:33 -05:00
Joe Groff
f3768b5361
clean up the bootstrap mess by moving the struct summary and make-mirror methods to classes.struct.prettyprint
2009-08-31 20:32:00 -05:00
Joe Groff
badbfef890
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-31 20:13:19 -05:00
Joe Groff
79be927371
take advantage of pprint-prefix in c-object-pointer prettyprinters
2009-08-31 19:56:36 -05:00
Doug Coleman
fee0953cc4
make-mirror method on structs. fix typo on struct-slots stack effect. don't filter initial values in struct>assoc because structs are more low-level and you want to see the entire layout of the struct you're working with, imo.
2009-08-31 18:51:47 -05:00
Joe Groff
0a7b62177b
link S{ and S@ docs in classes.struct
2009-08-31 18:04:09 -05:00
Joe Groff
43f81d3835
hashcode* for structs
2009-08-31 10:51:45 -05:00
Joe Groff
472189452d
oops—fix STRUCT: functor
2009-08-30 22:40:18 -05:00
Joe Groff
509ed99c79
refactor struct slot parsing so that there's a <struct-slot-spec> word for easily constructing struct slots outside classes.struct
2009-08-30 22:37:37 -05:00