uwol / proleap-cobol-parser

ProLeap ANTLR4-based parser for COBOL
MIT License
136 stars 74 forks source link

Terminating DOT for a COPY-Statement must be in same line (at least not in a single line) #28

Closed Reinhard-Prehofer closed 6 years ago

Reinhard-Prehofer commented 7 years ago

The required DOT for a copy-statement must not be on a single line ;) else a parsing error is thrown.

You may write Copy mycopy . (DOT) but not

copy mycopy
. (dot)

AA1.cbl.txt mycopy.CPY.txt

Same difference in erroneous behaviour whether the copybook is for the working-storage or the procedure division ...

java.lang.RuntimeException: syntax error in line 12:7 no viable alternative at input '\n       .'
    at io.proleap.cobol.preprocessor.sub.document.impl.ThrowingErrorListener.syntaxError(ThrowingErrorListener.java:20)
    at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
    at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544)
    at org.antlr.v4.runtime.DefaultErrorStrategy.reportNoViableAlternative(DefaultErrorStrategy.java:282)
    at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:121)
    at io.proleap.cobol.Cobol85PreprocessorParser.copyStatement(Cobol85PreprocessorParser.java:582)
    at io.proleap.cobol.Cobol85PreprocessorParser.startRule(Cobol85PreprocessorParser.java:186)
    at io.proleap.cobol.preprocessor.sub.document.impl.CobolDocumentParserImpl.processWithParser(CobolDocumentParserImpl.java:85)
    at io.proleap.cobol.preprocessor.sub.document.impl.CobolDocumentParserImpl.processLines(CobolDocumentParserImpl.java:61)
    at io.proleap.cobol.preprocessor.impl.CobolPreprocessorImpl.parseDocument(CobolPreprocessorImpl.java:58)
    at io.proleap.cobol.preprocessor.impl.CobolPreprocessorImpl.process(CobolPreprocessorImpl.java:101)
    at io.proleap.cobol.preprocessor.impl.CobolPreprocessorImpl.process(CobolPreprocessorImpl.java:86)
    at io.proleap.cobol.preprocessor.impl.CobolPreprocessorImpl.process(CobolPreprocessorImpl.java:65)
uwol commented 6 years ago

Another bug, fixed in e8ac3f3b2fcc34bd54e199232f54b7f14f268c70.