Исправлена ошибка в грамматике
This commit is contained in:
parent
51d18f8a59
commit
e8a2eb27fd
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
|||
public const string Major = "3";
|
||||
public const string Minor = "8";
|
||||
public const string Build = "0";
|
||||
public const string Revision = "2872";
|
||||
public const string Revision = "2873";
|
||||
|
||||
public const string MainVersion = Major + "." + Minor;
|
||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%COREVERSION%=0
|
||||
%REVISION%=2872
|
||||
%MINOR%=8
|
||||
%REVISION%=2873
|
||||
%COREVERSION%=0
|
||||
%MAJOR%=3
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,9 +1,9 @@
|
|||
//
|
||||
// This CSharp output file generated by Gardens Point LEX
|
||||
// Version: 1.1.3.301
|
||||
// Machine: DESKTOP-2BJCJ7I
|
||||
// DateTime: 28.03.2021 14:11:15
|
||||
// UserName: ibond
|
||||
// Machine: DESKTOP-G8V08V4
|
||||
// DateTime: 03.04.2021 6:32:31
|
||||
// UserName: ?????????
|
||||
// GPLEX input file <ABCPascal.lex>
|
||||
// GPLEX frame file <embedded resource>
|
||||
//
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@
|
|||
%type <stn> literal_list
|
||||
%type <stn> label_decl_sect
|
||||
%type <stn> lock_stmt
|
||||
%type <stn> func_name proc_name optional_proc_name qualified_identifier
|
||||
%type <stn> func_name proc_name optional_proc_name //qualified_identifier
|
||||
%type <ex> new_expr allowable_expr_as_stmt
|
||||
%type <stn> parse_goal parts inclass_block block proc_func_external_block
|
||||
%type <td> exception_class_type_identifier simple_type_identifier //idp
|
||||
|
|
@ -2019,20 +2019,20 @@ optional_proc_name
|
|||
{ $$ = null; }
|
||||
;
|
||||
|
||||
qualified_identifier
|
||||
: identifier
|
||||
{ $$ = new method_name(null,null,$1,null,@$); }
|
||||
| visibility_specifier
|
||||
{ $$ = new method_name(null,null,$1,null,@$); }
|
||||
| qualified_identifier tkPoint identifier
|
||||
{
|
||||
$$ = NewQualifiedIdentifier($1 as method_name, $3, @$);
|
||||
}
|
||||
| qualified_identifier tkPoint visibility_specifier
|
||||
{
|
||||
$$ = NewQualifiedIdentifier($1 as method_name, $3, @$);
|
||||
}
|
||||
;
|
||||
//qualified_identifier
|
||||
// : identifier
|
||||
// { $$ = new method_name(null,null,$1,null,@$); }
|
||||
// | visibility_specifier
|
||||
// { $$ = new method_name(null,null,$1,null,@$); }
|
||||
// | qualified_identifier tkPoint identifier
|
||||
// {
|
||||
// $$ = NewQualifiedIdentifier($1 as method_name, $3, @$);
|
||||
// }
|
||||
// | qualified_identifier tkPoint visibility_specifier
|
||||
// {
|
||||
// $$ = NewQualifiedIdentifier($1 as method_name, $3, @$);
|
||||
// }
|
||||
// ;
|
||||
|
||||
property_definition
|
||||
: attribute_declarations simple_property_definition
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -210,7 +210,6 @@
|
|||
<name value="type_decl_identifier" />
|
||||
<name value="template_identifier_with_equal" />
|
||||
<name value="simple_type_identifier" />
|
||||
<name value="qualified_identifier" />
|
||||
<name value="proc_name" />
|
||||
<name value="func_name" />
|
||||
<name value="func_class_name_ident" />
|
||||
|
|
@ -301,7 +300,6 @@
|
|||
</tag>
|
||||
<tag value="FuncName">
|
||||
<name value="func_name" />
|
||||
<name value="qualified_identifier" />
|
||||
<name value="simple_type_identifier" />
|
||||
<name value="simple_or_template_type_reference" />
|
||||
</tag>
|
||||
|
|
|
|||
|
|
@ -327,5 +327,6 @@ script=
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
3.8.0.2872
|
||||
3.8.0.2873
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
!define VERSION '3.8.0.2872'
|
||||
!define VERSION '3.8.0.2873'
|
||||
|
|
|
|||
|
|
@ -71,6 +71,10 @@ function Divisors(n: integer): List<integer>;
|
|||
///--
|
||||
function Divizors(n: integer): List<integer>;
|
||||
|
||||
/// Возвращает список всех k делителей натурального числа n.
|
||||
/// Если делителей не ровно k, возвращает пустой список
|
||||
function Divisors(n, k: integer): List<integer>;
|
||||
|
||||
/// Возвращает Sin угла, заданного в градусах
|
||||
function SinDegrees(x: real): real;
|
||||
|
||||
|
|
@ -582,6 +586,58 @@ function Divisors(Self: integer): List<integer>; extensionmethod :=
|
|||
///--
|
||||
function Divizors(Self: integer): List<integer>; extensionmethod :=
|
||||
Divisors(Self);
|
||||
|
||||
/// Возвращает список всех k делителей натурального числа n.
|
||||
/// Если делителей не ровно k, возвращает пустой список
|
||||
function Divisors(n, k: integer): List<integer>;
|
||||
begin
|
||||
n := Abs(n); // foolproof
|
||||
var L := new List<integer>;
|
||||
case n of
|
||||
0, 1: if k = 1 then L.Add(n);
|
||||
2: if k = 2 then L.AddRange(|1, n|);
|
||||
else
|
||||
begin
|
||||
var t := Trunc(Sqrt(n));
|
||||
if (t * t <> n) and k.IsOdd or (t * t = n) and k.IsEven then
|
||||
begin
|
||||
Result := new List<integer>;
|
||||
exit
|
||||
end;
|
||||
L.AddRange(|1, n|);
|
||||
var (p, m) := (2, 2);
|
||||
while m <= t do
|
||||
begin
|
||||
if n mod m = 0 then
|
||||
begin
|
||||
var r := n div m;
|
||||
L.Add(m);
|
||||
Inc(p);
|
||||
if m < r then
|
||||
begin
|
||||
L.Add(r);
|
||||
Inc(p)
|
||||
end
|
||||
else break
|
||||
end;
|
||||
if p > k then
|
||||
begin
|
||||
Result := new List<integer>;
|
||||
exit
|
||||
end;
|
||||
Inc(m)
|
||||
end;
|
||||
if k = p then L.Sort
|
||||
else L.Clear
|
||||
end
|
||||
end;
|
||||
Result := L
|
||||
end;
|
||||
|
||||
/// Возвращает список всех k делителей натурального числа n.
|
||||
/// Если делителей не ровно k, возвращает пустой список
|
||||
function Divisors(Self, k: integer): List<integer>; extensionmethod :=
|
||||
Divisors(Self, k);
|
||||
|
||||
{$endregion}
|
||||
|
||||
|
|
@ -727,7 +783,7 @@ begin
|
|||
Write(if a[i, j] then ' 1' else ' 0');
|
||||
Writeln
|
||||
end
|
||||
end;
|
||||
end;
|
||||
|
||||
{$endregion}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue