Skip to content

Commit 93d8615

Browse files
authored
Enable the local keywords even when the local extension is off (#18)
1 parent 81dd85e commit 93d8615

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

parsing/lexer.mll

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ let keyword_table =
103103

104104
let lookup_keyword name =
105105
match Hashtbl.find keyword_table name with
106-
| LOCAL | NONLOCAL | GLOBAL
107-
when not (Clflags.Extension.is_enabled Local) ->
108-
LIDENT name
109106
| kw -> kw
110107
| exception Not_found ->
111108
LIDENT name

testsuite/tests/typing-local/nosyntax.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ type lfn' = local_ string -> int
77
[%%expect{|
88
type fn = string -> int
99
type lfn = (string [@ocaml.local]) -> int
10-
Line 3, characters 12-25:
10+
Line 3, characters 19-25:
1111
3 | type lfn' = local_ string -> int
12-
^^^^^^^^^^^^^
13-
Error: The type constructor string expects 0 argument(s),
14-
but is here applied to 1 argument(s)
12+
^^^^^^
13+
Error: The local extension is disabled
14+
To enable it, pass the '-extension local' flag
1515
|}]
1616

1717
let cast (x : fn) = (x : lfn)

0 commit comments

Comments
 (0)