Skip to content

Commit 7b07ba2

Browse files
committed
wip
1 parent d5cc612 commit 7b07ba2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/basic/FStarC.Options.fst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ let specs_with_types warn_unsafe : list (char & string & opt_type & Pprint.docum
11221122
( noshort,
11231123
"lang_extensions",
11241124
Accumulated (SimpleStr "extension"),
1125-
text "Automatically enable the given language extensions based on the file extension. For example, value `pulse` allows using *.pulse and *.pulsei files.");
1125+
text "Automatically enable the given language extensions based on the file extension; the language extension's .cmxs must be on the include path or loaded with --load_cmxs");
11261126
11271127
( noshort,
11281128
"lax",

src/ml/FStarC_Parser_ParseIt.ml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ let has_extension file extensions =
8585
FStar_List.existsb (U.ends_with file) extensions
8686

8787
let take_lang_extension file =
88-
FStar_List.tryFind (fun x -> U.ends_with file ("."^x)) (extra_extensions ())
88+
FStar_List.tryFind (fun x -> U.ends_with file ("."^x)) (FStarC_Options.lang_extensions ())
8989

9090
let check_extension fn =
9191
if (not (has_extension fn (fst_extensions ()))) then
@@ -548,7 +548,11 @@ let parse_lang lang fn =
548548
let rng = FStarC_Range.mk_range s.frag_fname frag_pos frag_pos in
549549
let decls = FStarC_Parser_AST_Util.parse_extension_lang lang s.frag_text rng in
550550
let comments = FStarC_Parser_Util.flush_comments () in
551-
ASTFragment (Inr decls, comments)
551+
let frag = match fn with
552+
| Filename _ | Toplevel _ -> FStarC_Parser_AST.as_frag decls
553+
| _ -> FStar_Pervasives.Inr decls
554+
in
555+
ASTFragment (frag, comments)
552556
with
553557
| FStarC_Errors.Error(e, msg, r, _ctx) ->
554558
ParseError (e, msg, r)

0 commit comments

Comments
 (0)