Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra committed Jul 7, 2021
1 parent 5942b3d commit 3e767d7
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -4460,7 +4460,7 @@ <h2>Syntax</h2>

<emu-clause id="sec-runtime-semantics-stringnumericvalue" type="sdo" aoid="StringNumericValue" oldids="sec-runtime-semantics-mv-s">
<h1>Runtime Semantics: StringNumericValue</h1>
<p>The conversion of a String to a Number value is similar overall to the determination of the Number value for a numeric literal (see <emu-xref href="#sec-literals-numeric-literals"></emu-xref>), but some of the details are different, so the process for converting a String numeric literal to a value of Number type is given here.</p>
<p>The conversion of a String to a Number value is similar overall to the determination of the Number value for a numeric literal (see <emu-xref href="#sec-literals-numeric-literals"></emu-xref>), but some of the details are different, so the process for converting a String numeric literal to a value of the Number type is given here.</p>
<emu-grammar>StringNumericLiteral ::: StrWhiteSpace?</emu-grammar>
<emu-alg>
1. Return *+0*<sub>𝔽</sub>.
Expand All @@ -4486,17 +4486,21 @@ <h1>Runtime Semantics: StringNumericValue</h1>
<emu-grammar>StrUnsignedDecimalLiteral ::: DecimalDigits `.` DecimalDigits? ExponentPart?</emu-grammar>
<emu-alg>
1. Let _a_ be MV of the first |DecimalDigits|.
1. If the second |DecimalDigits| is present, let _b_ be MV of the second |DecimalDigits|. Otherwise, let _b_ be 0.
1. If the second |DecimalDigits| is present, then
1. Let _b_ be MV of the second |DecimalDigits|.
1. Let _n_ be the number of code points in the second |DecimalDigits|.
1. Else,
1. Let _b_ be 0.
1. Let _n_ be 0.
1. If |ExponentPart| is present, let _e_ be MV of |ExponentPart|. Otherwise, let _e_ be 0.
1. Let _n_ be the number of code points in the second |DecimalDigits|.
1. Return RoundMVResult((_a_ + (_b_ &times; 10<sup>-_n_</sup>)) &times; 10<sup>_e_</sup>).
</emu-alg>
<emu-grammar>StrUnsignedDecimalLiteral ::: `.` DecimalDigits ExponentPart?</emu-grammar>
<emu-alg>
1. Let _a_ be MV of |DecimalDigits|.
1. Let _b_ be MV of |DecimalDigits|.
1. If |ExponentPart| is present, let _e_ be MV of |ExponentPart|. Otherwise, let _e_ be 0.
1. Let _n_ be the number of code points in |DecimalDigits|.
1. Return RoundMVResult(_a_ &times; 10<sup>_e_ - _n_</sup>).
1. Return RoundMVResult(_b_ &times; 10<sup>_e_ - _n_</sup>).
</emu-alg>
<emu-grammar>StrUnsignedDecimalLiteral ::: DecimalDigits ExponentPart?</emu-grammar>
<emu-alg>
Expand Down Expand Up @@ -14298,7 +14302,7 @@ <h2>Syntax</h2>

<emu-clause id="sec-static-semantics-sv" oldids="sec-string-literals-static-semantics-stringvalue" type="sdo" aoid="SV">
<h1>Static Semantics: SV</h1>
<p>A string literal stands for a value of the String type. The SV of the literal is described in terms of String values contributed by the various parts of the string literal. As part of this process, some Unicode code points within the string literal are interpreted as having a mathematical value, as described below or in <emu-xref href="#sec-literals-numeric-literals"></emu-xref>.</p>
<p>A string literal stands for a value of the String type. SV produces String values for string literals through recursive application on the various parts of the string literal. As part of this process, some Unicode code points within the string literal are interpreted as having a mathematical value, as described below or in <emu-xref href="#sec-literals-numeric-literals"></emu-xref>.</p>
<ul>
<li>
The SV of <emu-grammar>StringLiteral :: `"` `"`</emu-grammar> is the empty String.
Expand Down Expand Up @@ -14660,7 +14664,7 @@ <h2>Syntax</h2>

<emu-clause id="sec-static-semantics-tv-and-trv">
<h1>Static Semantics: TV and TRV</h1>
<p>A template literal component is interpreted as a sequence of Unicode code points. The TV of a literal component is described in terms of String values (with the help of SV) contributed by the various parts of the template literal component. In determining a TV, escape sequences are replaced by the UTF-16 code unit(s) of the Unicode code point represented by the escape sequence. TRV is similar to TV with the difference that in TRV, escape sequences are interpreted literally.</p>
<p>A template literal component is interpreted by TV and TRV as a value of the String type. In TV, escape sequences are replaced by the UTF-16 code unit(s) of the Unicode code point represented by the escape sequence. TRV is similar to TV with the difference being that in TRV, escape sequences are interpreted as they appear in the literal.</p>
<ul>
<li>
The TV and TRV of <emu-grammar>NoSubstitutionTemplate :: ``` ```</emu-grammar> is the empty String.
Expand Down Expand Up @@ -24692,7 +24696,9 @@ <h1>parseFloat ( _string_ )</h1>
1. Let _trimmedString_ be ! TrimString(_inputString_, ~start~).
1. If neither _trimmedString_ nor any prefix of _trimmedString_ satisfies the syntax of a |StrDecimalLiteral| (see <emu-xref href="#sec-tonumber-applied-to-the-string-type"></emu-xref>), return *NaN*.
1. Let _numberString_ be the longest prefix of _trimmedString_, which might be _trimmedString_ itself, that satisfies the syntax of a |StrDecimalLiteral|.
1. Return StringNumericValue of _numberString_.
1. Let _parsedNumber_ be ParseText(! StringToCodePoints(_numberString_), |StrDecimalLiteral|).
1. Assert: _parsedNumber_ is a Parse Node.
1. Return StringNumericValue of _parsedNumber_.
</emu-alg>
<emu-note>
<p>`parseFloat` may interpret only a leading portion of _string_ as a Number value; it ignores any code units that cannot be interpreted as part of the notation of a decimal literal, and no indication is given that any such code units were ignored.</p>
Expand Down

0 comments on commit 3e767d7

Please sign in to comment.