Closed Bug 924397 Opened 6 years ago Closed 6 years ago

WebIDL parser doesn't specify file when encountering syntax error at end of file

Categories

(Core :: DOM: Core & HTML, defect)

24 Branch
x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: jdm, Assigned: tareqakhandaker)

Details

(Whiteboard: [mentor=jdm][lang=py])

Attachments

(1 file)

[jdm@rosencrantz mozilla-central]$ ./mach build dom/bindings/
 0:00.12 /usr/bin/gmake -C dom/bindings -j8 -s
 0:00.22 Generating global WebIDL files
 0:00.96 Traceback (most recent call last):
 0:00.96   File "/run/media/jdm/ssd/mozilla-central/config/pythonpath.py", line 56, in <module>
 0:00.96     main(sys.argv[1:])
 0:00.96   File "/run/media/jdm/ssd/mozilla-central/config/pythonpath.py", line 48, in main
 0:00.96     execfile(script, frozenglobals)
 0:00.96   File "/run/media/jdm/ssd/mozilla-central/dom/bindings/GlobalGen.py", line 81, in <module>
 0:00.96     main()
 0:00.96   File "/run/media/jdm/ssd/mozilla-central/dom/bindings/GlobalGen.py", line 55, in main
 0:00.96     parser.parse(''.join(lines), fullPath)
 0:00.96   File "/run/media/jdm/ssd/mozilla-central/dom/bindings/parser/WebIDL.py", line 4830, in parse
 0:00.96     self._productions.extend(self.parser.parse(lexer=self.lexer,tracking=True))
 0:00.96   File "/run/media/jdm/ssd/mozilla-central/other-licenses/ply/ply/yacc.py", line 263, in parse
 0:00.96     return self.parseopt(input,lexer,debug,tracking,tokenfunc)
 0:00.96   File "/run/media/jdm/ssd/mozilla-central/other-licenses/ply/ply/yacc.py", line 792, in parseopt
 0:00.96     tok = self.errorfunc(errtoken)
 0:00.96   File "/run/media/jdm/ssd/mozilla-central/dom/bindings/parser/WebIDL.py", line 4778, in p_error
 0:00.96     raise WebIDLError("Syntax Error at end of file. Possibly due to missing semicolon(;), braces(}) or both", [])
 0:00.96 WebIDL.WebIDLError: error: Syntax Error at end of file. Possibly due to missing semicolon(;), braces(}) or both
 0:00.98 gmake[1]: *** [ParserResults.pkl] Error 1
 0:00.98 gmake: *** [default] Error 2
The way to reproduce this is to remove a ; after an interface definition in any file in dom/webidl and rebuild.
Whiteboard: [mentor=jdm][lang=py]
Here is the error message that gets printed:

 0:28.12 WebIDL.WebIDLError: error: Syntax Error at end of file. Possibly due to missing semicolon(;), braces(}) or both, WorkerNavigator.webidl
Assignee: nobody → tareqakhandaker
Attachment #816436 - Flags: review?(josh)
Comment on attachment 816436 [details] [diff] [review]
Print_file_when_WebIDL_raises_syntax_error_at_EOF.patch

Thanks Tareq! According to hg log, Kyle is a better choice of reviewer here.
Attachment #816436 - Flags: review?(josh) → review?(khuey)
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/48d6dad2df16
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.