Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/pascalabcnet/pascalabcnet
Browse files Browse the repository at this point in the history
…into test
  • Loading branch information
BH_build_bot authored and BH_build_bot committed Dec 15, 2024
2 parents 88fec11 + 080fb48 commit 6bb62ac
Show file tree
Hide file tree
Showing 14 changed files with 6,479 additions and 3,573 deletions.
2 changes: 1 addition & 1 deletion Configuration/GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "10";
public const string Build = "2";
public const string Revision = "3589";
public const string Revision = "3593";

public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Version.defs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%MINOR%=10
%REVISION%=3589
%REVISION%=3593
%COREVERSION%=2
%MAJOR%=3
14 changes: 14 additions & 0 deletions InstallerSamples/WhatsNew/3_10_2/SquareBrForArr.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
begin
var a := [1,2,3]; // по умолчанию - массив
Println(a,TypeName(a));
var s := [2..4]; // если есть диапазон, то множество
Println(s,TypeName(s));
var s1: set of byte := [3,4,5]; // множество инициализируется значениями в []
Println(s1,TypeName(s1));
// Если один из операндов - множество, то результат - множество
Println(s + [1,2,3], s * [1,2,3], [1,2,3] - s, s - [1,2,3]);
// Это - операции с массивами
Println(a + [7,8,9], a * 3);
// Операция in для массива и для множества. Внешний вид одинаков
Println(5 in [3,5,7], 5 in [3..5,7]);
end.
10 changes: 5 additions & 5 deletions Parsers/PascalABCParserNewSaushkin/ABCPascal.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//
// This CSharp output file generated by Gardens Point LEX
// Version: 1.1.3.301
// Machine: DESKTOP-G8V08V4
// DateTime: 19.07.2024 12:42:46
// UserName: ?????????
// Machine: LAPTOP-TE3HP881
// DateTime: 14.12.2024 15:20:04
// UserName: miks
// GPLEX input file <ABCPascal.lex>
// GPLEX frame file <embedded resource>
//
Expand Down Expand Up @@ -2193,7 +2193,7 @@ int Scan()
parserTools.ParseDirective(yytext, CurrentLexLocation, out var directiveName, out var directiveParams);
var orgDirectiveName = directiveName;

if (directiveName == "") // сл�?�?ай п�?с�?ой ди�?ек�?ив�?
if (directiveName == "") // слÑ?Ñ?ай пÑ?сÑ?ой диÑ?екÑ?ивÑ?
break;

directiveName = directiveName.ToUpper();
Expand Down Expand Up @@ -2290,7 +2290,7 @@ int Scan()
parserTools.ParseDirective(yytext, CurrentLexLocation, out directiveName, out directiveParams);
orgDirectiveName = directiveName;

if (directiveName == "") // сл�?�?ай п�?с�?ой ди�?ек�?ив�?
if (directiveName == "") // слÑ?Ñ?ай пÑ?сÑ?ой диÑ?екÑ?ивÑ?
break;

directiveName = directiveName.ToUpper();
Expand Down
44 changes: 29 additions & 15 deletions Parsers/PascalABCParserNewSaushkin/ABCPascal.y
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
%type <stn> program_header
%type <stn> parameter_decl
%type <stn> parameter_decl_list property_parameter_list
%type <ex> const_set
%type <ex> const_set pascal_set_const
%type <ex> question_expr question_constexpr new_question_expr
%type <ex> record_const const_field_list_1 const_field_list
%type <stn> const_field
Expand Down Expand Up @@ -987,9 +987,9 @@ const_factor
// $$ = new roof_dereference($2 as addressed_value, @$);
// }
;

const_set
: tkSquareOpen elem_list tkSquareClose
pascal_set_const
: tkSquareOpen elem_list tkSquareClose
{
// Если elem_list пуст или содержит диапазон, то это множество, иначе массив. С PascalABC.NET 3.10
/*var is_set = false;
Expand All @@ -1002,6 +1002,13 @@ const_set
$$ = new pascal_set_constant($2 as expression_list, @$);
//else $$ = new array_const_new($2 as expression_list, @$);
}
;

const_set
: pascal_set_const
{
$$ = $1;
}
| tkVertParen elem_list tkVertParen
{
$$ = new array_const_new($2 as expression_list, @$);
Expand Down Expand Up @@ -2915,6 +2922,11 @@ proc_call
{
$$ = new procedure_call($1 as addressed_value, $1 is ident, @$);
}
/*| pascal_set_const tkPoint identifier_keyword_operatorname
{
var abcd = new dot_node($1 as addressed_value, $3 as addressed_value, @$);
$$ = new procedure_call(abcd as addressed_value, abcd is ident, @$);
} */
;

goto_stmt
Expand Down Expand Up @@ -4164,6 +4176,8 @@ factor_without_unary_op
| var_reference
{ $$ = $1; }
;



factor
: tkNil
Expand All @@ -4175,19 +4189,18 @@ factor
{ $$ = $1; }
| default_expr
{ $$ = $1; }
| tkSquareOpen elem_list tkSquareClose
| pascal_set_const
{
// Если elem_list пуст или содержит диапазон, то это множество, иначе массив. С PascalABC.NET 3.10
/*var is_set = false;
var el = $2 as expression_list;
if (el == null || el.Count == 0)
is_set = true;
else if (el.expressions.Count(x => x is diapason_expr_new) > 0)
is_set = true;
if (is_set)*/
$$ = new pascal_set_constant($2 as expression_list, @$);
//else $$ = new array_const_new($2 as expression_list, @$);
$$ = $1;
}
| factor tkPoint identifier_keyword_operatorname
{
$$ = new dot_node($1 as addressed_value, $3 as addressed_value, @$);
}
| factor tkRoundOpen optional_expr_list_func_param tkRoundClose
{
$$ = new method_call($1 as addressed_value,$3 as expression_list, @$);
}
| tkNot factor
{
$$ = new un_expr($2, $1.type, @$);
Expand Down Expand Up @@ -4375,6 +4388,7 @@ variable
}
| variable_or_literal_or_number tkSquareOpen expr_list tkSquareClose
{
//$$ = NewIndexerOrSlice($1 as addressed_value,$3 as expression_list,@$);
var el = $3 as expression_list; // SSM 10/03/16
if (el.Count==1 && el.expressions[0] is format_expr)
{
Expand Down
Loading

0 comments on commit 6bb62ac

Please sign in to comment.