Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 83 lines (70 sloc) 2.625 kB
fccc685 Initial open-source release
MLstate authored
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18 read default.trx global (spacing)
19
20 spacing <- (Default.space $ / Default.mlcomment)* $
21
22 KEYWORDS <-
23 / 'assert'
24 / '~' / '}' / '||' / '|]' / '|' / '{<' / '{'
25 / 'with' / 'while' / 'when' / 'virtual' / 'val' / 'type' / 'try'
26 / 'true' / 'to' / 'then' / 'struct' / 'sig' / 'rec'
27 / 'private' / 'or' / 'open' / 'of' / 'object' / 'new'
28 / 'mutable' / 'module' / 'mod' / 'method' / 'match' / 'lxor' / 'lsr'
29 / 'lsl' / 'lor' / 'let' / 'lazy' / 'land' / 'initializer' / 'inherit'
30 / 'include' / 'in' / 'if' / 'functor' / 'function' / 'fun' / 'for'
31 / 'false' / 'external' / 'exception' / 'end' / 'else' / 'downto' / 'done'
32 / 'do' / 'constraint' / 'class' / 'begin' / 'asr' / 'as' / 'and'
33 / '`' / '_' / ']' / '[|' / '[>' / '[<' / '['
34 / '??' / '?' / '>}' / '>]' / '>' / '=' / '<-'
35 / '<' / ';;' / ';' / ':>' / ':=' / '::' / ':'
36 / '..' / '.' / '->' / '-.' / '-' / ',' / '+'
37 / '*' / ')' / '(' / "'" / '&&' / '&' / '#'
38
39 SPECIALS <- 'mod' / 'lxor' / 'lsr' / 'lsl' / 'lor' / 'land'
40
41 FUN <- 'fun' spacing $
42 LET <- 'let' spacing $
43 VAL <- 'val' spacing $
44 IN <- 'in' spacing $
45 REC <- 'rec' spacing $
46 MATCH <- 'match' spacing $
47 WITH <- 'with' spacing $
48 TYPE <- 'type' spacing $
49 AND <- "and" spacing $
50 OF <- 'of' spacing $
51 AS <- 'as' spacing $
52 FUNCTION <- 'function' spacing $
53 #FUNS <- (FUN / FUNCTION) $
54 MODULE <- 'module' spacing $
55 STRUCT <- 'struct' spacing $
56 END <- 'end' spacing $
57 SIG <- 'sig' spacing $
58 BEGIN <- 'begin' spacing $
59 OPEN <- 'open' spacing $
60 REF <- 'ref' spacing $
61 EXCEPTION <- 'exception' spacing $
62 TRY <- 'try' spacing $
63 RAISE <- 'raise' spacing $
64 MUTABLE <- 'mutable' spacing $
65 ASSERT <- 'assert' spacing $
66
67 # Sucre ==============================
68 CONSTRUCTOR_aux <- [a-zA-Z_0-9]
69 CONSTRUCTOR <- ([A-Z] CONSTRUCTOR_aux* $_) spacing {{ __1 }}
70
71 IF <- 'if' spacing $
72 THEN <- 'then' spacing $
73 ELSE <- 'else' spacing $
74 TRUE <- 'true' spacing $
75 FALSE <- 'false' spacing $
76 ANDL <- '&&' spacing $
77 ORL <- '||' spacing $
78 GETREF <- ':=' spacing $
79 CONS <- '::' spacing $
80 WHEN <- 'when' spacing $
81
82
Something went wrong with that request. Please try again.