Doug Coleman
9c7c8cd9dd
core: working on fry/locals
2020-03-12 17:13:36 -05:00
Doug Coleman
f5c75922ec
core: fryable work.
2020-03-12 17:11:51 -05:00
Doug Coleman
05b48364c6
factor: Working on making locals-everywhere, array literals constructed
...
by ``output>array``, and fry with arrays.
We need to expand macros before doing the locals transform ``rewrite-closures`` and fry needs to happen in the locals pass because the locals pass touches the retainstack as part of the transform and we only want to do this once. We defer fry by making a <fryable> which rewrite-closures transforms.
Fixes things like the following that used to break because the locals
transform happened before fry.
::: bar ( a b -- a ) '[ |[ a | a _ + ] call ] call ;
Also we can use fry in case/cond now since macro-expansion happens
first.
Things like this work:
::: foo ( a b c -- a ) :> ( a b c ) c q{{ a b c a b + c _ }} ;
1 2 4 foo ...
{ 1 2 4 3 4 4 }
Triple colon will become colon soon.
Finally, there is a potential issue with macros changing the order of
fry underscore expansion since fry happens later. We need to rewrite fry
internally as 0_ 1_ 2_ so order is preserved everywhere in the expanded
macro.
2020-03-12 17:06:15 -05:00
Doug Coleman
b6e518e4bb
Merge remote-tracking branch 'origin/master' into modern-harvey3
2020-03-04 19:19:01 -06:00
John Benediktsson
38bfcd4bf1
help: add more bold table headings.
2020-02-13 15:18:43 -08:00
Doug Coleman
7d9bda3c26
Merge remote-tracking branch 'origin/master' into modern-harvey3
2020-01-17 20:26:07 -06:00
John Benediktsson
77cd3aaede
classes: use check-instance in a few places, to remove duplication.
2020-01-15 10:34:47 -08:00
Doug Coleman
25a8cedcb8
modern: more syntax fixes
2019-10-20 17:59:49 -05:00
Doug Coleman
8a46a16530
core: better syntax for comment.
...
[[ foo ]] is a string
``#[[foo]]`` is a turned-off string
2019-10-20 15:41:34 -05:00
Doug Coleman
c4cd8991be
modern: Fix all the syntax errors.
...
Support ``{abc}foo{`` as a token name
Bug to fix:
! should error
[[M: error-class see-class*
<colon \ ERROR: pprint-word
{
[ pprint-word ]
[ superclass. ]
[ <block "slots" word-prop [ name>> pprint-slot-name ] each block> pprint-semi ]
[ tuple-declarations. ]
} cleave
block> ;]] string>literals >strings
2019-10-20 14:17:09 -05:00
Doug Coleman
d635604026
modern: Removing ch'a syntax.
...
It's cool but I don't like it right now.
2019-09-28 10:59:07 -05:00
Doug Coleman
bcb0bf8a53
Merge remote-tracking branch 'origin/master' into modern-harvey3
2019-02-11 17:46:47 -06:00
Alexander Iljin
97a91d66fc
syntax-docs: add a couple of missing CHAR: syntax examples
2019-01-03 15:36:03 -08:00
Doug Coleman
cbfdf2cfa8
factor: Add more parser guts.
2018-08-10 18:01:19 -05:00
Doug Coleman
8c3df2ede4
core: Remove some foo'bar words and a lot of postpone:
2018-08-09 21:59:15 -04:00
Doug Coleman
f05c7e8cd8
factor: char: a -> ch'a.
...
Also all contractions are not allowed in word names anymore. Even Data cannot use contractions...
2018-08-09 18:02:38 -04:00
Doug Coleman
59f406b64e
parser: Add ``tag'payload`` and ``tag: payload``
2018-08-09 15:59:12 -04:00
Doug Coleman
00fb574a8d
factor: SYMBOL: foo foo [ bar ] initialize -> INITIALIZED-SYMBOL: foo [ bar ]
2018-08-04 21:53:05 -04:00
Doug Coleman
e6715f41a5
core: Add factor[[ ]] and <factor> to hold Factor strings.
2018-08-04 09:48:42 -04:00
Doug Coleman
24929aadf1
core: <WINDOWS <MACOS <UNIX <LINUX in core.
2018-08-04 09:32:09 -04:00
Doug Coleman
0ae3ac3e8a
core: Add private word.
2018-08-04 09:04:51 -04:00
Doug Coleman
3944515af3
factor: Fix some syntax errors.
2018-08-03 22:36:21 -04:00
Doug Coleman
0a77f6c679
factor: fixing [[ ]] and some unit tests
2018-08-02 18:29:04 -04:00
Doug Coleman
343674189c
factor: Let url"" and sbuf"" work without spaces.
...
Also url[[]] if you define a url[[ word.
2018-08-02 10:37:02 -04:00
Doug Coleman
924b434336
Revert "factor: vocab:word -> vocab::word"
...
This reverts commit 354f1cbd34 .
2018-08-02 08:21:52 -04:00
Doug Coleman
4c164b1ae6
factor: change some spacing with ; on its own line
2018-03-19 00:03:27 -05:00
Doug Coleman
81d713f6e6
syntax: Add INITIALIZED-SYMBOL:, STARTUP-HOOK:, and SHUTDOWN-HOOK:
2018-01-28 01:34:51 -06:00
Doug Coleman
5d8b912216
Merge remote-tracking branch 'origin/master' into modern-harvey2
2018-01-27 09:43:21 -06:00
Alexander Iljin
34e9412e29
syntax-docs: improve descriptions for GENERIC: and GENERIC#:
2018-01-22 07:58:17 -08:00
Doug Coleman
daa7be5b7f
core: fix bootstrap.
2018-01-02 22:31:08 -08:00
Doug Coleman
825891c7ef
syntax: add ': for fried words
2017-12-29 11:09:53 -08:00
Doug Coleman
354f1cbd34
factor: vocab:word -> vocab::word
2017-12-29 00:43:25 -08:00
Doug Coleman
7616f6e95d
factor: add inlined quotations in stack effects
2017-12-02 16:38:11 -06:00
Doug Coleman
f8c54fd2bf
core: Move new functors to core.
...
Also move enough to implement them in an ok style. I would prefer to use formatting in core, but it depends on calendar, etc.
2017-11-24 20:06:44 -06:00
Doug Coleman
bc285f7072
core: Move multiline and interpolate to core.
...
caveats: peg.ebnf needs to find :> and let[ in "syntax" not locals anymore.
- You have to define a word ``IN: syntax`` before Factor picks up syntax changes
- You have to add a syntax word to core/bootstrap/syntax.factor
2017-11-24 19:12:04 -06:00
Doug Coleman
43628c8340
core: Move more things to core.
...
Tricky things:
f props>> == @ _ are not defined in syntax
2017-11-24 18:42:30 -06:00
Doug Coleman
085dbe716f
core: Move hashtables.identity and hashtables.wrapped into core.
2017-11-24 16:46:47 -06:00
Doug Coleman
815591e10c
factor: m: { a b } -> M\\ a b
2017-10-12 21:22:41 -05:00
Doug Coleman
4b35f2e0d9
factor: fix bootstrap.
2017-10-04 22:39:20 -05:00
Doug Coleman
cada003d7f
factor: Rename ``M\ array generic`` to ``m: { array generic }``.
...
The problem with M\ is that it has an arity of 1 where we need it to have arity 2. Also, for multimethods, the \ disables parsing of the array that follows, e.g. ``M\ { string string } multimethod-name`` parses as ``M\ {`` and leaves the rest unparsed. This is obviously wrong.
An alternative syntax that should be implement and looks ok is ``m{ array generic }``
2017-10-01 09:51:31 -05:00
Doug Coleman
29708329ab
core: Fix how \words are parsed.
2017-08-31 21:21:15 -05:00
Doug Coleman
baa6af4831
factor: All RENAME: and FROM: and EXCLUDE: to have \foo as word names.
...
Grab bag of other cleanups. tests and docs parse!
2017-08-31 21:21:14 -05:00
Doug Coleman
3aa096e2e5
docs: Update docs.
2017-08-31 21:21:14 -05:00
Doug Coleman
22e59d7838
docs: Escaping a lot.
2017-08-31 21:21:14 -05:00
Doug Coleman
88e772ef17
docs: postpone: \foo
2017-08-31 21:21:13 -05:00
Doug Coleman
5a119fa9f7
syntax: Allow postpone: \foo
2017-08-31 21:21:13 -05:00
Doug Coleman
a2eb7b854d
core: SYNTAX: should allow \FOO words.
2017-08-31 21:21:13 -05:00
Doug Coleman
c436f6dbad
factor: char: postpone: color: hexcolor: flexhexcolor: decimal:
2017-08-31 21:21:13 -05:00
Björn Lindqvist
483325d0f0
core/: bunch of more docs
2017-06-24 16:42:59 +02:00
Alexander Iljin
581489b64f
sytax-docs: mention that numbers may contain commas
2017-06-21 12:36:39 +03:00