]> gitweb.factorcode.org Git - factor.git/blob - misc/fuel/strange-syntax.factor
FUEL: makes accessors and tuple slots with backslashes highlight correctly
[factor.git] / misc / fuel / strange-syntax.factor
1 USING: accessors ;
2 IN: strange
3
4 TUPLE: oh\no { and/again initial: "meh" } ;
5
6 ! FUEL Syntax Demo
7 !
8 ! The purpose of this file is to test that corner cases are
9 ! highlighted correctly by FUEL. So if you change something in the
10 ! syntax highlighting and it breaks, things will be badly hightlighted
11 ! here.
12 USING: alien.syntax kernel math ;
13 IN: strange-syntax
14
15 TUPLE: a-tuple slot1 slot2 { slot3 integer } ;
16   TUPLE: second-one ;
17
18     USING: tools.test ;
19
20
21 ! ! Strings
22 "containing \"escapes" drop
23
24 ! ! Symbol names
25
26 TUPLE: tup
27     ko
28     get\it
29     { eh\ integer }
30     { oh'ho } ;
31
32 ! All slashes are symbol constituents.
33 : hack/slash ( t -- x ) ko>> ;
34
35 : um ( x y -- ) get\it<< ;
36
37 : slash\hack ( m -- y )
38     get\it>> dup >>get\it ;
39
40 TUPLE: oh\no { and/again initial: "meh" } ;
41
42 ! As are quotes
43 : don't-do-that ( x -- y ) ;
44
45 ! Double quotes aren't right yet.
46 ! : do-"that" ( x -- y ) ;
47
48 ! ! C-TYPE
49 C-TYPE: cairo_snurface_t
50
51 ! ! CHAR
52 : stuff-with-chars ( -- K \n )
53     CHAR: K
54     CHAR: \n ;
55
56 ! ! MAIN
57 : majn ( -- ) ;
58
59 MAIN: majn
60
61 ! ! SLOT
62  SLOT: komba
63
64 ! ! SYNTAX
65 <<
66 SYNTAX: ID-SYNTAX ;
67 >>
68
69 ID-SYNTAX ID-SYNTAX
70
71 ! ! Numbers
72 { -55 -0x10 100,00 1,000,000 0x2000,0000 0b01 } drop
73
74 ! ! Containers
75 V{ 1 2 3 } drop
76 HS{ 9 8 3 } drop