|1,2..3| запрещено

|1,'v'| запрещено
## - коррекции в Intellisense
This commit is contained in:
Mikhalkovich Stanislav 2020-07-06 21:43:26 +03:00
parent 9ebe2fcd77
commit 8d9ad8ddef
18 changed files with 4450 additions and 4369 deletions

View file

@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "6";
public const string Build = "3";
public const string Revision = "2551";
public const string Revision = "2552";
public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;

View file

@ -1,4 +1,4 @@
%MINOR%=6
%REVISION%=2551
%COREVERSION%=3
%REVISION%=2552
%MINOR%=6
%MAJOR%=3

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -181,7 +181,9 @@ UNICODEARROW \x890
}
"|" { return (int)Tokens.tkVertParen; }
"##" { return (int)Tokens.tkShortProgram; }
[#][#][ \t\r\n] { yylval = new Union(); yylval.ti = new token_info(yytext,CurrentLexLocation); return (int)Tokens.tkShortProgram; }
[#][#][#][ \t\r\n] { yylval = new Union(); yylval.ti = new token_info(yytext,CurrentLexLocation); return (int)Tokens.tkShortSFProgram;
}
"&" { return (int)Tokens.tkAmpersend; }
"," { yylval = new Union(); yylval.ti = new token_info(yytext); return (int)Tokens.tkComma; }
":" { return (int)Tokens.tkColon; }

View file

@ -37,9 +37,9 @@
%token <ti> tkIf tkImplementation tkInherited tkInterface tkProcedure tkOperator tkProperty tkRaise tkRecord tkSet tkType tkThen tkUses tkVar tkWhile tkWith tkNil
%token <ti> tkGoto tkOf tkLabel tkLock tkProgram tkEvent tkDefault tkTemplate tkPacked tkExports tkResourceString tkThreadvar tkSealed tkPartial tkTo tkDownto
%token <ti> tkLoop
%token <ti> tkSequence tkYield
%token <ti> tkSequence tkYield tkShortProgram tkVertParen tkShortSFProgram
%token <id> tkNew
%token <id> tkOn tkShortProgram tkVertParen
%token <id> tkOn
%token <id> tkName tkPrivate tkProtected tkPublic tkInternal tkRead tkWrite
%token <ti> tkParseModeExpression tkParseModeStatement tkParseModeType tkBegin tkEnd
%token <ti> tkAsmBody tkILCode tkError INVISIBLE
@ -189,7 +189,19 @@ parse_goal
| parts
{ root = $1; }
| tkShortProgram stmt_list
{ root = $$ = NewProgramModule(null, null, null, new block(null, $2 as statement_list, @$), new token_info("end"), @$); }
{
var stl = $2 as statement_list;
stl.left_logical_bracket = $1;
root = $$ = NewProgramModule(null, null, null, new block(null, stl, @$), new token_info("end"), @$);
}
| tkShortSFProgram stmt_list
{
var stl = $2 as statement_list;
stl.left_logical_bracket = $1;
var un = new unit_or_namespace(new ident_list("SF", @$),@$);
var ul = new uses_list(un,@$);
root = $$ = NewProgramModule(null, null, ul, new block(null, stl, @$), new token_info("end"), @$);
}
;
parts

File diff suppressed because it is too large Load diff

View file

@ -270,5 +270,6 @@ script=

View file

@ -1 +1 @@
3.6.3.2551
3.6.3.2552

View file

@ -1 +1 @@
!define VERSION '3.6.3.2551'
!define VERSION '3.6.3.2552'

View file

@ -2706,6 +2706,24 @@ namespace PascalABCCompiler.TreeConverter
return ret_type;
}
public type_node select_base_type_for_arr_const_new(type_node_list types, List<expression_node> lst, bool only_implicit = false)
{
type_node ret_type = null;
if (types.Count > 0) ret_type = types[0];
for (int i = 1; i < types.Count; i++)
{
if (types[i] == ret_type) continue;
type_compare tc = type_table.compare_types_in_specific_order(types[i], ret_type, only_implicit);
if (tc == type_compare.greater_type && ret_type != SystemLibrary.SystemLibrary.object_type)
ret_type = types[i];
else if (tc == type_compare.non_comparable_type)
{
AddError(lst[i].location, "UNCOMPARABLE_TYPES_IN_ARRAY_CONST");
}
}
return ret_type;
}
public enum int_types { sbyte_type = 0, byte_type = 1, short_type = 2, ushort_type = 3, integer_type = 4, uint_type = 5, int64_type = 6, uint64_type = 7};
public bool is_value_int_type(type_node tn)

View file

@ -5000,7 +5000,7 @@ namespace PascalABCCompiler.TreeConverter
type_node_list types = new type_node_list();
foreach (var tn in lst.Select(ex => ex.type))
types.AddElement(tn);
var el_type = convertion_data_and_alghoritms.select_base_type(types, true);
var el_type = convertion_data_and_alghoritms.select_base_type_for_arr_const_new(types, lst, true);
var syntax_type = new SyntaxTree.semantic_type_node(el_type);
var plist = new SyntaxTree.expression_list(new int32_const(acn.elements.Count));
var nn = new SyntaxTree.new_expr(syntax_type, plist, true, new SyntaxTree.array_const(acn.elements, acn.elements.source_context), acn.source_context);

View file

@ -10,11 +10,13 @@
<Digits name = "Digits" bold = "false" italic = "false" color = "DarkGreen"/>
<RuleSets>
<RuleSet ignorecase="true">
<Delimiters>&lt;&gt;~!%^*()-+=|\#/{}[]:;"' , .?</Delimiters>
<Span name = "LineBigComment" rule = "CommentMarkerSet" bold = "false" italic = "false" color = "Green" stopateol = "true">
<Delimiters>&lt;&gt;~!%^*()-+=|\/{}[]:;"' , .?</Delimiters>
<Span name = "LineBigComment" rule = "CommentMarkerSet" bold = "false" italic = "false" color = "Green" stopateol = "true">
<Begin>////</Begin>
</Span>
<Span name = "LineComment" rule = "CommentMarkerSet" bold = "false" italic = "false" color = "Green" stopateol = "true">
<Begin>//@!/@</Begin>
</Span>
@ -51,7 +53,13 @@
<Begin>$'</Begin>
<End>'</End>
</Span>
<KeyWords name = "ShortProgram" bold = "false" italic = "false" color = "Green">
<Key word = "##" />
<Key word = "###" />
</KeyWords>
<KeyWords name = "KeyWords" bold = "true" italic = "false" color = "Black">
<Key word = "external" />
<Key word = "in" />
@ -187,7 +195,8 @@
<Key word = "for" />
<Key word = "foreach" />
</KeyWords>
<KeyWords name = "ExceptionHandlingStatements" bold="true" italic="false" color="Black">
<Key word = "except" />
<Key word = "on" />
@ -278,6 +287,7 @@
<RuleSet name = "CompilerDirectivesSet" ignorecase = "true">
<Delimiters>&lt;&gt;~!@%^*()-+=|\#/{}[]:;"' , .?</Delimiters>
<Span name = "String" bold = "false" italic = "false" color = "DarkRed" stopateol = "true">
<Begin>'</Begin>
<End>'</End>
@ -319,6 +329,5 @@
<Delimiters>&lt;&gt;~!%^*()-+=|\#/{}[]:;"' , .?</Delimiters>
</RuleSet>
</RuleSets>
</SyntaxDefinition>

View file

@ -59,8 +59,13 @@ based on Python 3.0, most of syntax - for future :) -->
<Key word = "#end" />
</KeyWords>
<KeyWords name = "Punctuation" bold = "false" italic = "false" color = "Black">
<Key word = "," />
<KeyWords name = "Punctuation123" bold = "true" italic = "false" color = "Orange">
<Key word = "((" />
<Key word = ".Where" />
</KeyWords>
<KeyWords name = "Punctuation2" bold = "true" italic = "false" color = "Black">
<Key word = "," />
<Key word = "." />
<Key word = ";" />
<Key word = "(" />

View file

@ -4129,9 +4129,14 @@ function operator in<T>(x: T; a: array of T): boolean; extensionmethod := a.Cont
function operator*<T>(a: array of T; n: integer): array of T; extensionmethod;
begin
Result := new T[a.Length * n];
for var i := 0 to n - 1 do
a.CopyTo(Result, a.Length * i);
if a.Length=1 then
Result := ArrFill(n,a[0])
else
begin
Result := new T[a.Length * n];
for var i := 0 to n - 1 do
a.CopyTo(Result, a.Length * i);
end;
end;
function operator*<T>(n: integer; a: array of T): array of T; extensionmethod := a * n;

View file

@ -59,6 +59,8 @@ function Pr(Self: char): char; extensionmethod := Self.Print;
function Pr(Self: boolean): boolean; extensionmethod := Self.Print;
function Pr(Self: string): string; extensionmethod := Self.Print;
function Pr<T>(Self: array [,] of T; w: integer := 4): array [,] of T; extensionmethod := Self.Print(w);
function Prln(Self: integer): integer; extensionmethod := Self.Println;
function Prln(Self: real): real; extensionmethod := Self.Println;
function Prln(Self: Biginteger): Biginteger; extensionmethod := Self.Println;

View file

@ -42,4 +42,5 @@ OVERRIDE_METHODS_CANNOT_CONTAIN_WHERE_SECTION=Methods with override modifier can
EXPLICIT_CASTS_FOR_LAMBDA_EXPRESSIONS_ARE_FORBIDDEN=Explicit type casts for lambda expressions are forbidden
STATIC_CLASS_CANNOT_HAVE_PREDEFINITION=Static class cannot be predefined
OPERATIONS_CANNOT_BE_CALLED_USING_THIS_SYNTAX=Operations cannot be called using this syntax
MEMBER_{0}_OF_TYPE_{1}_CANNOT_BE_FOUND_IN_THE_CONTEEXT_OF_FUNCTION_WITH_YIELD=Name {0} cannot be found in type {1} in the context of function with yield statement
MEMBER_{0}_OF_TYPE_{1}_CANNOT_BE_FOUND_IN_THE_CONTEEXT_OF_FUNCTION_WITH_YIELD=Name {0} cannot be found in type {1} in the context of function with yield statement
UNCOMPARABLE_TYPES_IN_ARRAY_CONST=Uncomparable types in array initializers

View file

@ -42,4 +42,5 @@ OVERRIDE_METHODS_CANNOT_CONTAIN_WHERE_SECTION=Методы с модификат
EXPLICIT_CASTS_FOR_LAMBDA_EXPRESSIONS_ARE_FORBIDDEN=Явные приведения типов для лямбда-выражений запрещены
STATIC_CLASS_CANNOT_HAVE_PREDEFINITION=Статический класс не может иметь предописание
OPERATIONS_CANNOT_BE_CALLED_USING_THIS_SYNTAX=Операции нельзя вызывать, используя данный синтаксис
MEMBER_{0}_OF_TYPE_{1}_CANNOT_BE_FOUND_IN_THE_CONTEEXT_OF_FUNCTION_WITH_YIELD=Имя {0} не удаётся найти в типе {1} в контексте функции с оператором yield
MEMBER_{0}_OF_TYPE_{1}_CANNOT_BE_FOUND_IN_THE_CONTEEXT_OF_FUNCTION_WITH_YIELD=Имя {0} не удаётся найти в типе {1} в контексте функции с оператором yield
UNCOMPARABLE_TYPES_IN_ARRAY_CONST=Несовместимые типы при задании массива