Skip to content

Commit c666bd8

Browse files
committed
Fixes issue #147
The flux lexer was failing on files which had an empty comment not followed by a new line as their last line.
1 parent 94eb8f6 commit c666bd8

File tree

4 files changed

+347
-234
lines changed

4 files changed

+347
-234
lines changed

src/main/antlr3/org/culturegraph/mf/flux/parser/Flux.g

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013 Deutsche Nationalbibliothek
2+
* Copyright 2013, 2014 Deutsche Nationalbibliothek
33
*
44
* Licensed under the Apache License, Version 2.0 the "License";
55
* you may not use this file except in compliance with the License.
@@ -251,10 +251,14 @@ LINE_COMMENT
251251
'\n'
252252
| '\r'
253253
)*
254-
'\r'? '\n'
255-
{
256-
$channel = HIDDEN;
257-
}
254+
(
255+
'\r'? '\n'
256+
| EOF
257+
)
258+
259+
{
260+
$channel = HIDDEN;
261+
}
258262
;
259263

260264
WS

0 commit comments

Comments
 (0)