Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromTokTok/apidsl

Commitdc2ff9c

Browse files
committed
Catch lexer error and print a nicer error message.
1 parent4a6b4b2 commitdc2ff9c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

‎Makefile‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
apigen.native:$(wildcard*.ml* src/*.ml*)
2-
dune clean
32
dune build --profile release
43
cp _build/default/apigen.exe$@
54

65
test/%/dune: test/dune-template Makefile
76
sed -e's/%NAME%/$*/g'$<>$@
87

98
check:$(patsubst%,%dune,$(dir$(wildcard test/*/*.api.h)))
10-
dune clean
119
BISECT_ENABLE=yes dune runtest
1210

1311
coverage: check

‎apigen.ml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@ let () =
2727
| [|_;"-ast" ; input|] -> main inputAst
2828
| [|_;"-api" ; input|] -> main inputApi
2929
|_ -> print_endline"Usage: apigen <file>"
30-
withFailure (msg) ->
31-
print_endline ("Failure:"^ msg)
30+
with
31+
|Failuremsg -> print_endline ("Failure:"^ msg)
32+
|ApiLexer.Lexing_error (start_p,token) ->
33+
let error=ApiPasses.format_lex_error start_p tokenin
34+
print_endline ("Lexing_error:"^ error)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp