Re: [Qemu-devel] [PATCH v2 2/4] qjson: do not save/restore contexts

2015-11-25 Thread Markus Armbruster
Paolo Bonzini writes: > JSON is LL(1) and our parser indeed needs only 1 token lookahead. > Saving the parser context is mostly unnecessary; "Mit Kanonen auf Spatzen" (shooting cannons at sparrows). > we can replace it > with peeking at the next

Re: [Qemu-devel] [PATCH v2 2/4] qjson: do not save/restore contexts

2015-11-24 Thread Markus Armbruster
Paolo Bonzini writes: > On 24/11/2015 13:44, Fam Zheng wrote: >> All in all, in my opinion, only something like >> >> Signed-off-by: 巩俐 >> >> , from which you can't easily infer the pronunciation, is apparently >> inconsiderate in an English context. Otherwise I think we should tolerate t

Re: [Qemu-devel] [PATCH v2 2/4] qjson: do not save/restore contexts

2015-11-24 Thread Paolo Bonzini
On 24/11/2015 13:44, Fam Zheng wrote: > All in all, in my opinion, only something like > > Signed-off-by: 巩俐 > > , from which you can't easily infer the pronunciation, is apparently > inconsiderate in an English context. Otherwise I think we should tolerate the > usage of non-latin charac

Re: [Qemu-devel] [PATCH v2 2/4] qjson: do not save/restore contexts

2015-11-24 Thread Fam Zheng
On Tue, 11/24 12:18, Paolo Bonzini wrote: > > > On 24/11/2015 11:50, Laszlo Ersek wrote: > > You > > (the generic you) can't expect me (the generic me) to read Kanji, > > Sanskrit, Thai script, Cyrillic script, and so on, even if your name is > > written in that language natively. You come up wit

Re: [Qemu-devel] [PATCH v2 2/4] qjson: do not save/restore contexts

2015-11-24 Thread Laszlo Ersek
On 11/24/15 11:50, Laszlo Ersek wrote: > My name is László Érsek. OMG, my native name is actually "Érsek László". 95% of my written communication is in English, and this very discussion is occurring in English. So in this context I forgot that in Hungarian the family name goes first. (Just goes

Re: [Qemu-devel] [PATCH v2 2/4] qjson: do not save/restore contexts

2015-11-24 Thread Gerd Hoffmann
Hi, > The same point applies *much more* to writing systems / alphabets. You > (the generic you) can't expect me (the generic me) to read Kanji, > Sanskrit, Thai script, Cyrillic script, and so on, even if your name is > written in that language natively. You come up with an approximation in > L

Re: [Qemu-devel] [PATCH v2 2/4] qjson: do not save/restore contexts

2015-11-24 Thread Paolo Bonzini
On 24/11/2015 11:50, Laszlo Ersek wrote: > You > (the generic you) can't expect me (the generic me) to read Kanji, > Sanskrit, Thai script, Cyrillic script, and so on, even if your name is > written in that language natively. You come up with an approximation in > Latin script, and use that. > >

Re: [Qemu-devel] [PATCH v2 2/4] qjson: do not save/restore contexts

2015-11-24 Thread Laszlo Ersek
On 11/24/15 09:03, Gerd Hoffmann wrote: > Hi, > >> Is it accepted practice to put UTF-8 in commit messages? (Or, actually, >> anywhere in patches, except maybe the notes section?) > > Sure. We don't want limit people names (in signed-off etc) to us-ascii. > > See "eb8934b vnc: fix memory corr

Re: [Qemu-devel] [PATCH v2 2/4] qjson: do not save/restore contexts

2015-11-24 Thread Gerd Hoffmann
Hi, > Is it accepted practice to put UTF-8 in commit messages? (Or, actually, > anywhere in patches, except maybe the notes section?) Sure. We don't want limit people names (in signed-off etc) to us-ascii. See "eb8934b vnc: fix memory corruption (CVE-2015-5225)" for a name written in kanji.

Re: [Qemu-devel] [PATCH v2 2/4] qjson: do not save/restore contexts

2015-11-23 Thread Laszlo Ersek
On 11/23/15 21:05, Eric Blake wrote: > On 11/23/2015 10:59 AM, Laszlo Ersek wrote: >> On 11/23/15 18:44, Paolo Bonzini wrote: >>> JSON is LL(1) and our parser indeed needs only 1 token lookahead. >>> Saving the parser context is mostly unnecessary; we can replace it >>> with peeking at the next tok

Re: [Qemu-devel] [PATCH v2 2/4] qjson: do not save/restore contexts

2015-11-23 Thread Eric Blake
On 11/23/2015 10:59 AM, Laszlo Ersek wrote: > On 11/23/15 18:44, Paolo Bonzini wrote: >> JSON is LL(1) and our parser indeed needs only 1 token lookahead. >> Saving the parser context is mostly unnecessary; we can replace it >> with peeking at the next token, or remove it altogether when the >> res

Re: [Qemu-devel] [PATCH v2 2/4] qjson: do not save/restore contexts

2015-11-23 Thread Laszlo Ersek
On 11/23/15 19:09, Paolo Bonzini wrote: > > > On 23/11/2015 18:59, Laszlo Ersek wrote: The only interesting thing is that parse_keyword always eats a TOKEN_KEYWORD, even if it is invalid, so it must come last in parse_value (otherwise, NULL is returned, parse_literal is invoked >>>

Re: [Qemu-devel] [PATCH v2 2/4] qjson: do not save/restore contexts

2015-11-23 Thread Paolo Bonzini
On 23/11/2015 18:59, Laszlo Ersek wrote: >> > The only interesting thing is that parse_keyword always eats >> > a TOKEN_KEYWORD, even if it is invalid, so it must come last in >> > parse_value (otherwise, NULL is returned, parse_literal is invoked >> > and it tries to peek beyond end of input).

Re: [Qemu-devel] [PATCH v2 2/4] qjson: do not save/restore contexts

2015-11-23 Thread Laszlo Ersek
On 11/23/15 18:44, Paolo Bonzini wrote: > JSON is LL(1) and our parser indeed needs only 1 token lookahead. > Saving the parser context is mostly unnecessary; we can replace it > with peeking at the next token, or remove it altogether when the > restore only happens on errors. The token list is de

[Qemu-devel] [PATCH v2 2/4] qjson: do not save/restore contexts

2015-11-23 Thread Paolo Bonzini
JSON is LL(1) and our parser indeed needs only 1 token lookahead. Saving the parser context is mostly unnecessary; we can replace it with peeking at the next token, or remove it altogether when the restore only happens on errors. The token list is destroyed anyway on errors. The only interesting