Skip to content

Commit

Permalink
#274 A decimal separator is not required for scaled decimal numbers n…
Browse files Browse the repository at this point in the history
…or numbers specifying an exponent.
  • Loading branch information
Rydier authored and nyamatongwe committed Sep 11, 2024
1 parent 01b4ce6 commit fd18639
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 4 deletions.
6 changes: 6 additions & 0 deletions doc/LexillaHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,8 @@ <h2>Contributors</h2>
<td>Tsuyoshi Miyake</td>
<td>Martin Schäfer</td>
<td>RainRat</td>
</tr><tr>
<td>Henrik S. Johansen</td>
</tr>
</table>
<h2>Releases</h2>
Expand All @@ -608,6 +610,10 @@ <h3>
Caused by not capping retrieval range at document end causing no text to be retrieved.
<a href="https://github.com/ScintillaOrg/lexilla/issues/269">Issue #269</a>.
</li>
<li>
Smalltalk: Fix scaled decimal numbers without decimal separator.
<a href="https://github.com/ScintillaOrg/lexilla/pull/274">Pull request #274</a>.
</li>
</ul>
<h3>
<a href="https://www.scintilla.org/lexilla540.zip">Release 5.4.0</a>
Expand Down
11 changes: 7 additions & 4 deletions lexers/LexSmalltalk.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,13 @@ static void handleNumeric(StyleContext& sc)
}
else
radix = 10;
if (sc.chNext != '.' || !isDigitOfRadix(sc.GetRelative(2), radix))
return;
sc.Forward();
skipInt(sc, radix);
if (sc.chNext == '.') {
if (!isDigitOfRadix(sc.GetRelative(2), radix))
return;
sc.Forward();
skipInt(sc, radix);
}

if (sc.chNext == 's') {
// ScaledDecimal
sc.Forward();
Expand Down
6 changes: 6 additions & 0 deletions test/examples/smalltalk/ClassificationTable.st
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ classificationBlock
"
foo
^ Array with: 1 with: 2 with: false with: self with: super with: nil.

" Issue 274: A decimal separator is not required for scaled decimal numbers"
32.0s2
4.0e3
32s2
4e3
6 changes: 6 additions & 0 deletions test/examples/smalltalk/ClassificationTable.st.folded
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,10 @@
0 400 0 "
0 400 0 foo
0 400 0 ^ Array with: 1 with: 2 with: false with: self with: super with: nil.
0 400 0
0 400 0 " Issue 274: A decimal separator is not required for scaled decimal numbers"
0 400 0 32.0s2
0 400 0 4.0e3
0 400 0 32s2
0 400 0 4e3
0 400 0
6 changes: 6 additions & 0 deletions test/examples/smalltalk/ClassificationTable.st.styled
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ classificationBlock
"{0}
foo
{11}^{0} {10}Array{0} {13}with:{0} {2}1{0} {13}with:{0} {2}2{0} {13}with:{0} {6}false{0} {13}with:{0} {7}self{0} {13}with:{0} {8}super{0} {13}with:{0} {9}nil{12}.{0}

{3}" Issue 274: A decimal separator is not required for scaled decimal numbers"{0}
{2}32.0s2{0}
{2}4.0e3{0}
{2}32s2{0}
{2}4e3{0}

0 comments on commit fd18639

Please sign in to comment.