<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>29323</bug_id>
          
          <creation_ts>2015-12-06 19:16:54 +0000</creation_ts>
          <short_desc>Consume a name, unclear?</short_desc>
          <delta_ts>2015-12-09 17:41:45 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>CSS</product>
          <component>Syntax</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>hhp400</reporter>
          <assigned_to name="Tab Atkins Jr.">jackalmage</assigned_to>
          
          
          <qa_contact>public-css-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>124369</commentid>
    <comment_count>0</comment_count>
    <who name="">hhp400</who>
    <bug_when>2015-12-06 19:16:54 +0000</bug_when>
    <thetext>I&apos;ve sent an e-mail to the Working Group, but it never delivered. So I repost it here:

To: www-style@w3.org
Subject: [css-syntax] 4.3.11. Consume a name?

The specification reads:

``Repeatedly consume the next input code point from the stream:&apos;&apos;

And whenever the code point does not match the two clauses mentioned below,

``anything else
    Return result.&apos;&apos;

I believe that this description wrong. The current code point should be reconsumed, before returning the result, thereby preventing that a non-matching symbol from the input stream is eaten by the algorithm. A counter-example:

#ident{
}

would then first consume the &quot;#&quot;, which triggers the `Consume a name&apos;-algorithm. It then continues with the `name code point&apos;-path, all the way up to &quot;{&quot;. Here it returns result, while &quot;{&quot; is still consumed.

If I may suggest a better wording, it would be:

``anything else
    Reconsume the current input code point and return result.&apos;&apos;

See:
http://www.w3.org/TR/css-syntax-3/#reconsume-the-current-input-code-point
http://www.w3.org/TR/css-syntax-3/#consume-a-name


Background:
While implementing Java tokenizer/parser for CSS, my relevant piece of code is:

		String consumeName() {
			StringBuilder result = new StringBuilder();
			int code, next;
			while (true) {
				code = preprocess();
				if (isName(code)) {
					result.appendCodePoint(code);
					continue;
				}
				next = preprocess();
				if (isValidEscape(code, next)) {
					result.appendCodePoint(consumeEscape(next));
					continue;
				}
				break;
			}
			pushback(next); // note these pushbacks!
			pushback(code); // they are not specified
			return result.toString();
		}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124402</commentid>
    <comment_count>1</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2015-12-09 17:41:45 +0000</bug_when>
    <thetext>Nah, it delivered. I just haven&apos;t gotten to it yet - I&apos;ll do so in a few minutes.  (I took November off and am very slowly working my way through my email backlog.)

I&apos;ll close this bug in the meantime.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>