| Anonymous | Login | Signup for a new account | 2013-05-25 07:01 CEST | ![]() |
| All Projects | FPC | Lazarus: Packages, Patches | Lazarus CCR | Mantis | fpGUI | fpcprojects: fpprofiler |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||
| 0022006 | FPC | Packages | public | 2012-05-11 02:02 | 2012-07-13 20:28 | ||||
| Reporter | Michalis Kamburelis | ||||||||
| Assigned To | Michael Van Canneyt | ||||||||
| Priority | normal | Severity | minor | Reproducibility | always | ||||
| Status | resolved | Resolution | fixed | ||||||
| Platform | i386 | OS | Debian GNU/Linux | OS Version | (testing) | ||||
| Product Version | Product Build | ||||||||
| Target Version | 2.6.1 | Fixed in Version | 2.7.1 | ||||||
| Summary | 0022006: fcl-passrc cannot parse program file with "program xxx;" declaration missing | ||||||||
| Description | The initial declaration "program xxx;" at the beginning of a program file is optional. But fcl-passrc fails to parse such program: $ fpc program_simple.pas # compiles Ok $ fpc test_parser.lpr $ ./test_parser program_simple.pas An unhandled exception occurred at $0809673E: EParserError: Expected "unit" at token "var" in file program_simple.pas at line 2 column 3 Attaching a patch that makes fcl-passrc assume it's a program (with missing "program xxx;" declaration) if it doesn't start with "program" or "unit" keyword. The output is then correct: $ ./test_parser program_simple.pas No interface section --- this is not a unit, this is a TPasProgram Implementation item 0: Foo Implementation item 1: Bar The test_parser.lpr example code is also on http://wiki.freepascal.org/fcl-passrc [^] . | ||||||||
| Tags | patch | ||||||||
| FPCOldBugId | |||||||||
| Fixed in Revision | 21910 | ||||||||
| Attached Files | |||||||||
Notes |
|
|
(0061020) Michael Van Canneyt (administrator) 2012-07-13 20:28 |
I solved the problem, but not with your patch. I made the parser also much stricter. It now also accepts program(input,output); and no longer accepts things like program something; finalization end. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-05-11 02:02 | Michalis Kamburelis | New Issue | |
| 2012-05-11 02:02 | Michalis Kamburelis | File Added: fcl-passrc_program_optional.patch | |
| 2012-05-11 02:03 | Michalis Kamburelis | Tag Attached: patch | |
| 2012-05-11 02:03 | Michalis Kamburelis | File Added: program_simple.pas | |
| 2012-05-11 02:03 | Michalis Kamburelis | File Added: test_parser.lpr | |
| 2012-07-13 20:26 | Michael Van Canneyt | Status | new => assigned |
| 2012-07-13 20:26 | Michael Van Canneyt | Assigned To | => Michael Van Canneyt |
| 2012-07-13 20:28 | Michael Van Canneyt | Fixed in Revision | => 21910 |
| 2012-07-13 20:28 | Michael Van Canneyt | Status | assigned => resolved |
| 2012-07-13 20:28 | Michael Van Canneyt | Fixed in Version | => 2.7.1 |
| 2012-07-13 20:28 | Michael Van Canneyt | Resolution | open => fixed |
| 2012-07-13 20:28 | Michael Van Canneyt | Note Added: 0061020 | |
| 2012-07-13 20:28 | Michael Van Canneyt | Target Version | => 2.6.1 |
| Main | My View | View Issues | Change Log | Roadmap |



