rui314 / 8cc

A Small C Compiler
MIT License
6.13k stars 740 forks source link

Fix the range of non-universal character names. #13

Closed tetsuok closed 10 years ago

tetsuok commented 10 years ago

If I correctly understand the paragraph 2 of 6.4.3 Universal character names of N1570, A character c is not a universal character name if c in [0xD800, 0xDFFF]

rui314 commented 10 years ago

Nice catch. Thanks.

andrewchambers commented 10 years ago

Small enough to not want a test?

rui314 commented 10 years ago

We already have tests for ucn in test/literal.c. We don't have a test to verify that the lexer prints out an error for an invalid input, but that's not limited to ucn -- we generally don't have that kind of tests. ucn is not important; I'd say it's a C committee's mistake to have made it a part of the standard. So it's probably enough.

andrewchambers commented 10 years ago

Ok, I agree negative tests are alot more annoying to write and are less relibale for things like this anyway, and this is obscure stuff.