Skip to content

Commit

Permalink
enh(perl) add support for the new class system (#3856)
Browse files Browse the repository at this point in the history
* Enhance support for floating point numbers

Floating points numbers (eg. `2.34`, `0.54` and `.54`) were not being
matched correctly. This patch splits the number class regex in different
variants to make things clearer and also adds variants to better match
floating points, including the `_` character, and also the special case of
version numbers (eg. v5.38). Markup test for the new number class was also
added.

* Add support for Perl new classes system

Perl got a new builtin class support which brought new keywords like
`class`, `method` and `field`, being that some support versioning and
attributes. This commit adds the new keywords with the additional features
they support (eg. attributes and version), alongside their markup test.

* Fix missing scope for Perl variables

The VAR mode had no `scope` set, thus Perl variables were not being matched
and highlighted at all. This commit adds the `variable` scope and update all
tests to consider the new `<span class="variable"></span>`, including those
that use Perl as sub-language (eg. Mojolicious).

* Fix Perl and Mojolicious conflict on variables

Mojolicious uses `%=` as one of the ways to inform the templating engine
Perl code will be embedded after it, however, it was being matched against
Perl's variable scope, `<span class="variable">%=</span>`, even though it's
not a valid Perl variable. This commit updates one of the Perl's variable
variants in other to allow only `$=` as valid variable for it, which has
special meaning, while `@=` and `%=` are not valid, thus solving the
conflict with the tag used by Mojolicious.
  • Loading branch information
bmeneg authored Oct 27, 2023
1 parent 1adee3a commit 99f70f2
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 47 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ Core Grammars:

- fix(css) fix overly greedy pseudo class matching [Bradley Mackey][]
- enh(arcade) updated to ArcGIS Arcade version 1.24 [Kristian Ekenes][]
- enh(perl) add support for the new class system [Bruno Meneguele][]

[Bradley Mackey]: https://github.com/bradleymackey
[Kristian Ekenes]: https://github.com/ekenes
[Bruno Meneguele]: https://github.com/bmeneg


## Version 11.9.0
Expand Down
73 changes: 53 additions & 20 deletions src/languages/perl.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default function(hljs) {
'chown',
'chr',
'chroot',
'class',
'close',
'closedir',
'connect',
Expand Down Expand Up @@ -55,6 +56,7 @@ export default function(hljs) {
'exit',
'exp',
'fcntl',
'field',
'fileno',
'flock',
'for',
Expand Down Expand Up @@ -114,6 +116,7 @@ export default function(hljs) {
'lt',
'ma',
'map',
'method',
'mkdir',
'msgctl',
'msgget',
Expand Down Expand Up @@ -258,19 +261,45 @@ export default function(hljs) {
end: /\}/
// contains defined later
};
const VAR = { variants: [
{ begin: /\$\d/ },
{ begin: regex.concat(
/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,
// negative look-ahead tries to avoid matching patterns that are not
// Perl at all like $ident$, @ident@, etc.
`(?![A-Za-z])(?![@$%])`
) },
{
begin: /[$%@][^\s\w{]/,
relevance: 0
}
] };
const ATTR = {
scope: 'attr',
match: /\s+:\s*\w+(\s*\(.*?\))?/,
};
const VAR = {
scope: 'variable',
variants: [
{ begin: /\$\d/ },
{ begin: regex.concat(
/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,
// negative look-ahead tries to avoid matching patterns that are not
// Perl at all like $ident$, @ident@, etc.
`(?![A-Za-z])(?![@$%])`
)
},
{
// Only $= is a special Perl variable and one can't declare @= or %=.
begin: /[$%@][^\s\w{=]|\$=/,
relevance: 0
}
],
contains: [ ATTR ],
};
const NUMBER = {
className: 'number',
variants: [
// decimal numbers:
// include the case where a number starts with a dot (eg. .9), and
// the leading 0? avoids mixing the first and second match on 0.x cases
{ match: /0?\.[0-9][0-9_]+\b/ },
// include the special versioned number (eg. v5.38)
{ match: /\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/ },
// non-decimal numbers:
{ match: /\b0[0-7][0-7_]*\b/ },
{ match: /\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/ },
{ match: /\b0b[0-1][0-1_]*\b/ },
],
relevance: 0
}
const STRING_CONTAINS = [
hljs.BACKSLASH_ESCAPE,
SUBST,
Expand Down Expand Up @@ -385,11 +414,7 @@ export default function(hljs) {
}
]
},
{
className: 'number',
begin: '(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b',
relevance: 0
},
NUMBER,
{ // regexp container
begin: '(\\/\\/|' + hljs.RE_STARTERS_RE + '|\\b(split|return|print|reverse|grep)\\b)\\s*',
keywords: 'split return print reverse grep',
Expand Down Expand Up @@ -431,11 +456,19 @@ export default function(hljs) {
},
{
className: 'function',
beginKeywords: 'sub',
beginKeywords: 'sub method',
end: '(\\s*\\(.*?\\))?[;{]',
excludeEnd: true,
relevance: 5,
contains: [ hljs.TITLE_MODE ]
contains: [ hljs.TITLE_MODE, ATTR ]
},
{
className: 'class',
beginKeywords: 'class',
end: '[;{]',
excludeEnd: true,
relevance: 5,
contains: [ hljs.TITLE_MODE, ATTR, NUMBER ]
},
{
begin: '-\\w\\b',
Expand Down
16 changes: 8 additions & 8 deletions test/markup/mojolicious/default.expect.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<span class="language-perl">%layout <span class="hljs-string">&#x27;bootstrap&#x27;</span>;</span><span class="language-xml">
<span class="language-perl">% layout <span class="hljs-string">&#x27;bootstrap&#x27;</span>;</span><span class="language-xml">
</span><span class="language-perl">% title <span class="hljs-string">&quot;Import your subs&quot;</span>;</span><span class="language-xml">
</span><span class="language-perl">%= form_for <span class="hljs-string">&#x27;/settings/import&#x27;</span> =&gt; (<span class="hljs-string">method =&gt;</span> <span class="hljs-string">&#x27;post&#x27;</span>, <span class="hljs-string">enctype =&gt;</span> <span class="hljs-string">&#x27;multipart/form-data&#x27;</span>) =&gt; begin</span><span class="language-xml">
</span><span class="language-perl"> %= file_field <span class="hljs-string">&#x27;opmlfile&#x27;</span> =&gt; <span class="hljs-string">multiple =&gt;</span> <span class="hljs-string">&#x27;true&#x27;</span></span><span class="language-xml">
</span><span class="language-perl"> %= submit_button <span class="hljs-string">&#x27;Import&#x27;</span>, <span class="hljs-string">&#x27;class&#x27;</span> =&gt; <span class="hljs-string">&#x27;btn&#x27;</span></span><span class="language-xml">
</span><span class="language-perl">% end</span><span class="language-xml">
<span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
</span><span class="language-perl">% <span class="hljs-keyword">if</span> ($subs) {</span><span class="language-xml">
</span><span class="language-perl">% <span class="hljs-keyword">if</span> (<span class="hljs-variable">$subs</span>) {</span><span class="language-xml">
<span class="hljs-tag">&lt;<span class="hljs-name">dl</span>&gt;</span>
</span><span class="language-perl">% <span class="hljs-keyword">for</span> <span class="hljs-keyword">my</span> $item (@$subs) {</span><span class="language-xml">
</span><span class="language-perl">% <span class="hljs-keyword">my</span> ($dir, $align) = ($item-&gt;{rtl}) ? (<span class="hljs-string">&#x27;rtl&#x27;</span>, <span class="hljs-string">&#x27;right&#x27;</span>) : (<span class="hljs-string">&#x27;ltr&#x27;</span>, <span class="hljs-string">&#x27;left&#x27;</span>);</span><span class="language-xml">
<span class="hljs-tag">&lt;<span class="hljs-name">dt</span> <span class="hljs-attr">align</span>=<span class="hljs-string">&quot;&lt;%=</span></span></span><span class="language-perl"> $align </span><span class="language-xml"><span class="hljs-tag"><span class="hljs-string">%&gt;&quot;</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">&quot;&lt;%=</span></span></span><span class="language-perl"> $item-&gt;{<span class="hljs-string">&#x27;xmlUrl&#x27;</span>} </span><span class="language-xml"><span class="hljs-tag"><span class="hljs-string">%&gt;&quot;</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;icon-rss&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span> rss<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">dir</span>=<span class="hljs-string">&quot;&lt;%=</span></span></span><span class="language-perl"> $dir </span><span class="language-xml"><span class="hljs-tag"><span class="hljs-string">%&gt;&quot;</span> <span class="hljs-attr">href</span>=<span class="hljs-string">&quot;&lt;%=</span></span></span><span class="language-perl"> $item-&gt;{htmlUrl} </span><span class="language-xml"><span class="hljs-tag"><span class="hljs-string">%&gt;&quot;</span>&gt;</span>&lt;%==</span><span class="language-perl"> $item-&gt;{title} </span><span class="language-xml">%&gt;<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
</span><span class="language-perl">% <span class="hljs-keyword">for</span> <span class="hljs-keyword">my</span> <span class="hljs-variable">$item</span> (<span class="hljs-variable">@$</span>subs) {</span><span class="language-xml">
</span><span class="language-perl">% <span class="hljs-keyword">my</span> (<span class="hljs-variable">$dir</span>, <span class="hljs-variable">$align</span>) = (<span class="hljs-variable">$item</span>-&gt;{rtl}) ? (<span class="hljs-string">&#x27;rtl&#x27;</span>, <span class="hljs-string">&#x27;right&#x27;</span>) : (<span class="hljs-string">&#x27;ltr&#x27;</span>, <span class="hljs-string">&#x27;left&#x27;</span>);</span><span class="language-xml">
<span class="hljs-tag">&lt;<span class="hljs-name">dt</span> <span class="hljs-attr">align</span>=<span class="hljs-string">&quot;&lt;%=</span></span></span><span class="language-perl"> <span class="hljs-variable">$align</span> </span><span class="language-xml"><span class="hljs-tag"><span class="hljs-string">%&gt;&quot;</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">&quot;&lt;%=</span></span></span><span class="language-perl"> <span class="hljs-variable">$item</span>-&gt;{<span class="hljs-string">&#x27;xmlUrl&#x27;</span>} </span><span class="language-xml"><span class="hljs-tag"><span class="hljs-string">%&gt;&quot;</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;icon-rss&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span> rss<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">dir</span>=<span class="hljs-string">&quot;&lt;%=</span></span></span><span class="language-perl"> <span class="hljs-variable">$dir</span> </span><span class="language-xml"><span class="hljs-tag"><span class="hljs-string">%&gt;&quot;</span> <span class="hljs-attr">href</span>=<span class="hljs-string">&quot;&lt;%=</span></span></span><span class="language-perl"> <span class="hljs-variable">$item</span>-&gt;{htmlUrl} </span><span class="language-xml"><span class="hljs-tag"><span class="hljs-string">%&gt;&quot;</span>&gt;</span>&lt;%==</span><span class="language-perl"> <span class="hljs-variable">$item</span>-&gt;{title} </span><span class="language-xml">%&gt;<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">dt</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">dd</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">b</span>&gt;</span>Categories<span class="hljs-tag">&lt;/<span class="hljs-name">b</span>&gt;</span>
</span><span class="language-perl">%= <span class="hljs-keyword">join</span> <span class="hljs-string">q{, }</span>, <span class="hljs-keyword">sort</span> @{ $item-&gt;{categories} || [] };</span><span class="language-xml">
</span><span class="language-perl">%= <span class="hljs-keyword">join</span> <span class="hljs-string">q{, }</span>, <span class="hljs-keyword">sort</span> @{ <span class="hljs-variable">$item</span>-&gt;{categories} || [] };</span><span class="language-xml">
<span class="hljs-tag">&lt;/<span class="hljs-name">dd</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">dl</span>&gt;</span>
</span><span class="language-perl">% }</span><span class="language-xml">
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</span>
</span>
2 changes: 1 addition & 1 deletion test/markup/mojolicious/default.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%layout 'bootstrap';
% layout 'bootstrap';
% title "Import your subs";
%= form_for '/settings/import' => (method => 'post', enctype => 'multipart/form-data') => begin
%= file_field 'opmlfile' => multiple => 'true'
Expand Down
10 changes: 10 additions & 0 deletions test/markup/perl/class.expect.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<span class="hljs-keyword">use</span> <span class="hljs-number">v5.38</span>;

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Example</span>::<span class="hljs-title">Subclass</span><span class="hljs-attr"> :isa(Example::Base 2.345)</span> </span>{
<span class="hljs-keyword">field</span> <span class="hljs-variable">$_config<span class="hljs-attr"> :param</span><span class="hljs-attr"> :param</span><span class="hljs-attr"> :param</span></span>;
<span class="hljs-keyword">field</span> <span class="hljs-variable">$_name<span class="hljs-attr"> : param</span></span> = <span class="hljs-string">&#x27;Test&#x27;</span>;

<span class="hljs-function"><span class="hljs-keyword">method</span> <span class="hljs-title">test</span>() </span>{
<span class="hljs-variable">$_name</span> == <span class="hljs-string">&#x27;Test&#x27;</span> ? <span class="hljs-string">&#x27;y&#x27;</span> : <span class="hljs-string">&#x27;n&#x27;</span>;
}
}
10 changes: 10 additions & 0 deletions test/markup/perl/class.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use v5.38;

class Example::Subclass :isa(Example::Base 2.345) {
field $_config :param :param :param;
field $_name : param = 'Test';

method test() {
$_name == 'Test' ? 'y' : 'n';
}
}
36 changes: 18 additions & 18 deletions test/markup/perl/default.expect.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<span class="hljs-comment"># loads object</span>
<span class="hljs-function"><span class="hljs-keyword">sub</span> <span class="hljs-title">load</span>
</span>{
<span class="hljs-keyword">my</span> $flds = $c-&gt;db_load($id,@_) || <span class="hljs-keyword">do</span> {
Carp::carp <span class="hljs-string">&quot;Can`t load (class: $c, id: $id): &#x27;$!&#x27;&quot;</span>; <span class="hljs-keyword">return</span> <span class="hljs-keyword">undef</span>
<span class="hljs-keyword">my</span> <span class="hljs-variable">$flds</span> = <span class="hljs-variable">$c</span>-&gt;db_load(<span class="hljs-variable">$id</span>,<span class="hljs-variable">@_</span>) || <span class="hljs-keyword">do</span> {
Carp::carp <span class="hljs-string">&quot;Can`t load (class: <span class="hljs-variable">$c</span>, id: <span class="hljs-variable">$id</span>): &#x27;<span class="hljs-variable">$!</span>&#x27;&quot;</span>; <span class="hljs-keyword">return</span> <span class="hljs-keyword">undef</span>
};
<span class="hljs-keyword">my</span> $o = $c-&gt;_perl_new();
$id12 = $id / <span class="hljs-number">24</span> / <span class="hljs-number">3600</span>;
$o-&gt;{<span class="hljs-string">&#x27;ID&#x27;</span>} = $id12 + <span class="hljs-number">123</span>;
<span class="hljs-keyword">my</span> <span class="hljs-variable">$o</span> = <span class="hljs-variable">$c</span>-&gt;_perl_new();
<span class="hljs-variable">$id12</span> = <span class="hljs-variable">$id</span> / <span class="hljs-number">24</span> / <span class="hljs-number">3600</span>;
<span class="hljs-variable">$o</span>-&gt;{<span class="hljs-string">&#x27;ID&#x27;</span>} = <span class="hljs-variable">$id12</span> + <span class="hljs-number">123</span>;
<span class="hljs-comment">#$o-&gt;{&#x27;SHCUT&#x27;} = $flds-&gt;{&#x27;SHCUT&#x27;};</span>
<span class="hljs-keyword">my</span> $p = $o-&gt;props;
<span class="hljs-keyword">my</span> $vt;
$string =~ <span class="hljs-regexp">m/^sought_text$/</span>;
$items = <span class="hljs-keyword">split</span> <span class="hljs-regexp">//</span>, <span class="hljs-string">&#x27;abc&#x27;</span>;
$string //= <span class="hljs-string">&quot;bar&quot;</span>;
<span class="hljs-keyword">for</span> <span class="hljs-keyword">my</span> $key (<span class="hljs-keyword">keys</span> %$p)
<span class="hljs-keyword">my</span> <span class="hljs-variable">$p</span> = <span class="hljs-variable">$o</span>-&gt;props;
<span class="hljs-keyword">my</span> <span class="hljs-variable">$vt</span>;
<span class="hljs-variable">$string</span> =~ <span class="hljs-regexp">m/^sought_text$/</span>;
<span class="hljs-variable">$items</span> = <span class="hljs-keyword">split</span> <span class="hljs-regexp">//</span>, <span class="hljs-string">&#x27;abc&#x27;</span>;
<span class="hljs-variable">$string</span> //= <span class="hljs-string">&quot;bar&quot;</span>;
<span class="hljs-keyword">for</span> <span class="hljs-keyword">my</span> <span class="hljs-variable">$key</span> (<span class="hljs-keyword">keys</span> <span class="hljs-variable">%$</span>p)
{
<span class="hljs-keyword">if</span>(${$vt.<span class="hljs-string">&#x27;::property&#x27;</span>}) {
$o-&gt;{$key . <span class="hljs-string">&#x27;_real&#x27;</span>} = $flds-&gt;{$key};
<span class="hljs-keyword">tie</span> $o-&gt;{$key}, <span class="hljs-string">&#x27;CMSBuilder::Property&#x27;</span>, $o, $key;
<span class="hljs-keyword">if</span>(${<span class="hljs-variable">$vt</span>.<span class="hljs-string">&#x27;::property&#x27;</span>}) {
<span class="hljs-variable">$o</span>-&gt;{<span class="hljs-variable">$key</span> . <span class="hljs-string">&#x27;_real&#x27;</span>} = <span class="hljs-variable">$flds</span>-&gt;{<span class="hljs-variable">$key</span>};
<span class="hljs-keyword">tie</span> <span class="hljs-variable">$o</span>-&gt;{<span class="hljs-variable">$key</span>}, <span class="hljs-string">&#x27;CMSBuilder::Property&#x27;</span>, <span class="hljs-variable">$o</span>, <span class="hljs-variable">$key</span>;
}
}
$o-&gt;save <span class="hljs-keyword">if</span> <span class="hljs-keyword">delete</span> $o-&gt;{<span class="hljs-string">&#x27;_save_after_load&#x27;</span>};
<span class="hljs-variable">$o</span>-&gt;save <span class="hljs-keyword">if</span> <span class="hljs-keyword">delete</span> <span class="hljs-variable">$o</span>-&gt;{<span class="hljs-string">&#x27;_save_after_load&#x27;</span>};

<span class="hljs-comment"># GH-117</span>
<span class="hljs-keyword">my</span> $g = <span class="hljs-keyword">glob</span>(<span class="hljs-string">&quot;/usr/bin/*&quot;</span>);
<span class="hljs-keyword">my</span> <span class="hljs-variable">$g</span> = <span class="hljs-keyword">glob</span>(<span class="hljs-string">&quot;/usr/bin/*&quot;</span>);

<span class="hljs-keyword">return</span> $o;
<span class="hljs-keyword">return</span> <span class="hljs-variable">$o</span>;
}

<span class="language-mojolicious"><span class="hljs-meta">__DATA__</span><span class="language-xml">
Expand All @@ -39,4 +39,4 @@

<span class="hljs-comment">=head1 NAME
POD till the end of file
</span>
</span>
21 changes: 21 additions & 0 deletions test/markup/perl/number.expect.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<span class="hljs-keyword">use</span> <span class="hljs-number">v5.38</span>;
<span class="hljs-keyword">use</span> <span class="hljs-number">5.0020</span>;

<span class="hljs-keyword">my</span> <span class="hljs-variable">$number</span> = <span class="hljs-number">9</span>;
<span class="hljs-variable">$number</span> = <span class="hljs-number">0</span>;
<span class="hljs-variable">$number</span> = 0_;
<span class="hljs-variable">$number</span> = <span class="hljs-number">00</span>;
<span class="hljs-variable">$number</span> = <span class="hljs-number">0.99</span>;
<span class="hljs-variable">$number</span> = <span class="hljs-number">99</span>;
<span class="hljs-variable">$number</span> = <span class="hljs-number">99.9</span>;
<span class="hljs-variable">$number</span> = <span class="hljs-number">99.99</span>;
<span class="hljs-variable">$number</span> = ._99;
<span class="hljs-variable">$number</span> = <span class="hljs-number">0x99FF</span>;
<span class="hljs-variable">$number</span> = <span class="hljs-number">0x99_EE_FF</span>;
<span class="hljs-variable">$number</span> = 0x_99_FF;
<span class="hljs-variable">$number</span> = <span class="hljs-number">0b00101011</span>;
<span class="hljs-variable">$number</span> = <span class="hljs-number">0b0010_1011</span>;
<span class="hljs-variable">$number</span> = 0b_0010_1011;
<span class="hljs-variable">$number</span> = <span class="hljs-number">0777</span>;
<span class="hljs-variable">$number</span> = <span class="hljs-number">07_7_7</span>;
<span class="hljs-variable">$number</span> = 0_777;
21 changes: 21 additions & 0 deletions test/markup/perl/number.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use v5.38;
use 5.0020;

my $number = 9;
$number = 0;
$number = 0_;
$number = 00;
$number = 0.99;
$number = 99;
$number = 99.9;
$number = 99.99;
$number = ._99;
$number = 0x99FF;
$number = 0x99_EE_FF;
$number = 0x_99_FF;
$number = 0b00101011;
$number = 0b0010_1011;
$number = 0b_0010_1011;
$number = 0777;
$number = 07_7_7;
$number = 0_777;

0 comments on commit 99f70f2

Please sign in to comment.