Closed Bug 762758 Opened 13 years ago Closed 13 years ago

Cannot define nsIDOMKeyEvent.char even if I defined it as "_char"

Categories

(Core :: XPCOM, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16

People

(Reporter: masayuki, Assigned: emk)

References

Details

Attachments

(1 file)

Separated from bug 680830. (In reply to Olli Pettay [:smaug] from comment #9) > (In reply to Masayuki Nakano (:masayuki) (Mozilla Japan) from comment #7) > > Ugh... I got this error: > > > > error: name 'char' is a builtin and cannot be redeclared, > > m:/mc-q/src/dom/interfaces/events/nsIDOMKeyEvent.idl line 245:11 > > readonly attribute DOMString char; > > > > How do I define char property? > > Uh, that is painful. Do we need something new in xpidl.py, something similar > to 'binaryname'? > Kyle might know. (In reply to Olli Pettay [:smaug] from comment #10) > Or do we support the _ (underscore-prefix) hack webidl has. (In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #11) > _ works, iirc. (In reply to Masayuki Nakano (:masayuki) (Mozilla Japan) from comment #12) > Hmm, _char still failed... > > > > nsIDOMKeyEvent.idl > > error: unrecognized input, m:/mc-q/src/dom/interfaces/events/nsIDOMKeyEvent.idl line 245:31 > > readonly attribute DOMString _char; > > ^ > > Traceback (most recent call last): > > File "m:\mc-q\src\build\pymake\pymake\process.py", line 213, in run > > m.__dict__[self.method](self.argv) > > File "m:/mc-q/src/config\pythonpath.py", line 44, in main > > execfile(script, frozenglobals) > > File "m:/mc-q/firefox-debug-build/dist/sdk/bin/header.py", line 529, in <module> > > idl = p.parse(open(file).read(), filename=file) > > File "m:\mc-q\firefox-debug-build\dist\sdk\bin\xpidl.py", line 1596, in parse > > idl = self.parser.parse(lexer=self) > > File "m:\mc-q\firefox-debug-build\dist\sdk\bin\ply\yacc.py", line 265, in parse > > return self.parseopt_notrack(input,lexer,debug,tracking,tokenfunc) > > File "m:\mc-q\firefox-debug-build\dist\sdk\bin\ply\yacc.py", line 921, in parseopt_notrack > > lookahead = get_token() # Get the next token > > File "m:\mc-q\firefox-debug-build\dist\sdk\bin\xpidl.py", line 1585, in token > > t = self.lexer.token() > > File "m:\mc-q\firefox-debug-build\dist\sdk\bin\ply\lex.py", line 384, in token > > newtok = self.lexerrorf(tok) > > File "m:\mc-q\firefox-debug-build\dist\sdk\bin\xpidl.py", line 1195, in t_ANY_error > > lexpos=self.lexer.lexpos)) > > IDLError: error: unrecognized input, m:/mc-q/src/dom/interfaces/events/nsIDOMKeyEvent.idl line 245:31 > > readonly attribute DOMString _char; This blocks bug 680830. Kyle, would you fix this, or if you don't have much time, would you tell me how to fix this? I tried to read the parser, but I've never developed with python. So, it's too tough for me...
Does this patch help?
Attachment #631519 - Flags: feedback?(masayuki)
Comment on attachment 631519 [details] [diff] [review] Implement underscore-escape in xpidl parser Excellent!
Attachment #631519 - Flags: feedback?(masayuki) → feedback+
Attachment #631519 - Flags: review?(khuey)
Keywords: checkin-needed
Assignee: khuey → VYV03354
Status: NEW → ASSIGNED
Keywords: checkin-needed
Target Milestone: --- → mozilla16
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: