Commit graph

4846 commits

Author SHA1 Message Date
nevermind322 75e79d9a82
Assign tuple optimizer (#3160)
* branch init

* add BindCollectLightSymInfo

* moved lightsyminfo to syntaxVisitors

* LIghtSymInfo fixes

* binder 0.1

* Attributes -> SymbolAttributes

* AssignTupleOptimizer -> AssignTupleDesugar

* moved algorithm classes to AssignTupleDesugarAlgorithm namespace

* fixes and refactoring

* LightSymInfo rework

* add rebuildDebug and build units

* enable VarNamesInMethodsWithSameNameAsClassGenericParamsReplacer

* remove CollectFullLightSymInfo call

* bind now return BindResult

* change BindResult path type

* path testing

* fix Current in BindCollectLightSymInfo

* fix Current in BindCollectLightSymInfo

* fix #3116

* (the rest of the fix)

* potential symomyms handling without assigns count minimization

* assign count minimization

* rename AssignTuplesDesugar

* move NewAssignTupleDesugar

* add optimization switch

* delete AssignTupleDesugar project

* remove comments

* collect symbols from var tuples

* optimize var_tuple_def_statement and assign_var_tuple

* fix

* fix Tuple Visitor

* #3091

* #3125

* revert #3125

* #3125

* #3123

* #3123

* #3127

* fix

* del doc

* await переместил

* Перегенерировал грамматику

* s.ToLines
RenameDirectory

* Исправление ToLines

* Убрал из грамматики узлы await - случайно оставались

* Sync `.ToLines` with `System.IO.StringReader` (#3154)

* 3.9.0.3494

* add const optimization

* #3152

* #3152

---------

Co-authored-by: Sun Serega <sunserega2@gmail.com>
Co-authored-by: Ivan Bondarev <ibond84@googlemail.com>
Co-authored-by: Mikhalkovich Stanislav <miks@math.sfedu.ru>
Co-authored-by: Артём Филонов <afilono@sfedu.ru>
2024-06-24 19:54:40 +03:00
nevermind322 66eaa619a3
Assign tuple optimizer (#3158)
* branch init

* add BindCollectLightSymInfo

* moved lightsyminfo to syntaxVisitors

* LIghtSymInfo fixes

* binder 0.1

* Attributes -> SymbolAttributes

* AssignTupleOptimizer -> AssignTupleDesugar

* moved algorithm classes to AssignTupleDesugarAlgorithm namespace

* fixes and refactoring

* LightSymInfo rework

* add rebuildDebug and build units

* enable VarNamesInMethodsWithSameNameAsClassGenericParamsReplacer

* remove CollectFullLightSymInfo call

* bind now return BindResult

* change BindResult path type

* path testing

* fix Current in BindCollectLightSymInfo

* fix Current in BindCollectLightSymInfo

* potential symomyms handling without assigns count minimization

* assign count minimization

* rename AssignTuplesDesugar

* move NewAssignTupleDesugar

* add optimization switch

* delete AssignTupleDesugar project

* remove comments

* collect symbols from var tuples

* optimize var_tuple_def_statement and assign_var_tuple

* fix

* fix Tuple Visitor

* fix

* add const optimization
2024-06-23 13:05:10 +03:00
nevermind322 d269c7ca20
Assign tuple optimizer (#3147)
* branch init

* add BindCollectLightSymInfo

* moved lightsyminfo to syntaxVisitors

* LIghtSymInfo fixes

* binder 0.1

* Attributes -> SymbolAttributes

* AssignTupleOptimizer -> AssignTupleDesugar

* moved algorithm classes to AssignTupleDesugarAlgorithm namespace

* fixes and refactoring

* LightSymInfo rework

* add rebuildDebug and build units

* enable VarNamesInMethodsWithSameNameAsClassGenericParamsReplacer

* remove CollectFullLightSymInfo call

* bind now return BindResult

* change BindResult path type

* path testing

* fix Current in BindCollectLightSymInfo

* fix Current in BindCollectLightSymInfo

* potential symomyms handling without assigns count minimization

* assign count minimization

* rename AssignTuplesDesugar

* move NewAssignTupleDesugar

* add optimization switch

* delete AssignTupleDesugar project

* remove comments

* collect symbols from var tuples

* optimize var_tuple_def_statement and assign_var_tuple

* fix

* fix Tuple Visitor

* fix
2024-06-12 16:15:43 +03:00
Mikhalkovich Stanislav 54f8db8ce2 3.9.0.3489 2024-06-08 20:54:30 +03:00
nevermind322 2dc3c4e50c
fix CollectLightSymInfo (#3143)
* branch init

* add BindCollectLightSymInfo

* moved lightsyminfo to syntaxVisitors

* LIghtSymInfo fixes

* binder 0.1

* Attributes -> SymbolAttributes

* AssignTupleOptimizer -> AssignTupleDesugar

* moved algorithm classes to AssignTupleDesugarAlgorithm namespace

* fixes and refactoring

* LightSymInfo rework

* add rebuildDebug and build units

* enable VarNamesInMethodsWithSameNameAsClassGenericParamsReplacer

* remove CollectFullLightSymInfo call

* bind now return BindResult

* change BindResult path type

* path testing

* fix Current in BindCollectLightSymInfo

* fix Current in BindCollectLightSymInfo

* potential symomyms handling without assigns count minimization

* assign count minimization

* rename AssignTuplesDesugar

* move NewAssignTupleDesugar

* add optimization switch

* delete AssignTupleDesugar project

* remove comments

* collect symbols from var tuples

* optimize var_tuple_def_statement and assign_var_tuple

* fix

* fix Tuple Visitor
2024-06-07 20:57:03 +03:00
nevermind322 133d082e4e
Assign tuple optimizer (#3142)
* branch init

* add BindCollectLightSymInfo

* moved lightsyminfo to syntaxVisitors

* LIghtSymInfo fixes

* binder 0.1

* Attributes -> SymbolAttributes

* AssignTupleOptimizer -> AssignTupleDesugar

* moved algorithm classes to AssignTupleDesugarAlgorithm namespace

* fixes and refactoring

* LightSymInfo rework

* add rebuildDebug and build units

* enable VarNamesInMethodsWithSameNameAsClassGenericParamsReplacer

* remove CollectFullLightSymInfo call

* bind now return BindResult

* change BindResult path type

* path testing

* fix Current in BindCollectLightSymInfo

* fix Current in BindCollectLightSymInfo

* potential symomyms handling without assigns count minimization

* assign count minimization

* rename AssignTuplesDesugar

* move NewAssignTupleDesugar

* add optimization switch

* delete AssignTupleDesugar project

* remove comments
2024-06-06 23:10:38 +03:00
AlexanderZemlyak 9f8f982cc2
Delete xml documentation of standard modules (#3140) 2024-06-04 21:49:19 +02:00
Mikhalkovich Stanislav bda964c3af fix #3133 2024-05-31 22:01:54 +03:00
Mikhalkovich Stanislav 497566e325 В инсталляторе пока mini версия заменена обычной
из-за ложных срабатываний антивируса Яндекса

ProgrammRunner переписан на C# по той же причине

В Linux-версии убран rc.exe по той же причине
2024-05-28 16:45:53 +03:00
Mikhalkovich Stanislav 9aeff23c71 ProgrammRunner cs - на C# 2024-05-28 16:43:16 +03:00
AlexanderZemlyak c2111cf375
Change type of language field in syntax tree to be string (#3119)
* Change syntax tree language field to be string

Тип LanguageId заменен на string

* Fix unit language name assigning

* Update lexer and parser

* Add checks to avoid NullReferenceException

Проверки на null для SyntaxTree. (К падению компилятора они не приводили, т.к. они связаны с другими ошибками, например синтаксическими), но мешали отладке.

* Return initial lexer and parser versions

* Revert language name assigning
2024-05-28 14:16:49 +03:00
AlexanderZemlyak 8acf536300
Make changes for spython compatibility (#3131)
* Update parser tools

* Update NodesBuilder

* Update syntax_tree_visitor

* Update CompilationErrors
2024-05-28 14:16:03 +03:00
Mikhalkovich Stanislav 303a3cdb32 3.9.0.3485 2024-05-25 12:52:06 +03:00
AlexanderZemlyak 342375501b
New languages engine (#3120)
* Implement first version of languages interfaces and classes

ParsersController заменен на LanguageProvider.

* Update ParserTools.csproj

* Update RemoteCompiler.cs

* Update TestRunner

* Rename LanguageIntegrator project to Languages

* Update TestRunner

* Rename Parsers folder

* Rename PascalABCParser.dll to PascalABCLanguage.dll

* Reorganise LanguageIntegrator and rename DocTagsParser

* Update Release Generators

* Update language loading messages

* Update linux version

* Move BaseParser fields to ILanguage interface

* Revert "Update Release Generators"

This reverts commit 26a991c71b81e643d9fbd9a815ddca222768dda9.

* Revert "Rename PascalABCParser.dll to PascalABCLanguage.dll"

* Clean the mess in parser folders

* Organize namespaces properly

* Revert "Rename LanguageIntegrator project to Languages"

* Add new enclosing folders for standard languages

* Organize namespaces of LanguageIntegrator properly

* Rename StandardLanguages to Languages

* Comment the rest of Visual basic source code

* Update OutputPath in pascal parser project

* Move BaseParser methods to IParser

* Restore Pascal parser project initial structure

* Add PascalLanguage project

* Move SyntaxTreeConverters project to Languages\Pascal folder

* Rename SemanticRules in parser project

* Rename Errors1 to Errors in parser project

* Delete LambdaConverter dll from installer

* Update language integrator to load *Language.dll files

* Move lambda converter project to pascal lanuage dir

* Revert "Delete LambdaConverter dll from installer"

This reverts commit dd56f559ebe4f8c4c5c33752d44e6953001b96a5.

* Switch off VBNETParser building

* Delete syntax tree converters controller

* Delete lambda converter dll from repository

* Reorganize syntax tree to semantic tree conversion stage

* Add BaseLanguage class to make language initialization more neat

* Delete syntax tree post processors entity from ILanguage and refactor ABCStatistics calls

* Add new IDocParser interface for documentation comments parser

* Clean up folders

* Add helper data structures to reduce parameters amount in CompileInterface and CompileImplementation

* Add documentation to language classes

* Move Union struct in global namespace and project (ParserTools)

* Add more comments and a safe select language method

* Rename SemanticRules class

* Fix directives format null bug

* Add System.Linq ref to LanguageIntegrator

* Delete SyntaxToSemanticTreeConverter interface

* Add BaseSyntaxTreeConverter

* Call safe select language method in intellisence

* Delete source files providers from parsers

* Rename GetSyntaxTree method

* Change Prebuild tree to be virtual - not abstract

* Refresh documentation a bit

* Add temporary language check for ABCHealth button

* Add parser reference to parser tools

* Move current compilation unit assigning higher to avoid bug with unit check

* Delete null DirectiveInfo's and refactor directives' code

* Add a few more comments
2024-05-25 12:26:32 +03:00
AlexanderZemlyak d7bf53c283
Fix directives format null bug (#3129) 2024-05-22 10:27:55 +03:00
Mikhalkovich Stanislav c8e5e58cff 3.9.0.3483 2024-05-21 20:47:45 +03:00
Vladislav Krylov 5c38a46f7c
changed accces modifiers for outside visitors (#3128) 2024-05-21 20:17:57 +03:00
Mikhalkovich Stanislav 8a02d07fc3 3.9.0.3482 2024-05-18 00:05:32 +03:00
Mikhalkovich Stanislav e71b3cf188 Исправил вывод records, Tuples, Complex в Print 2024-05-17 23:48:28 +03:00
Ivan Bondarev 61e5aed5d9
Merge pull request #3117 from SunSerega/ldnull-ldc0
Замена `Ldnull` на `Ldc_I4_0`
2024-05-11 16:55:58 +02:00
Sun Serega 54514ab9cc
more intelligent Ldnull vs Ldc_I4_0 2024-05-10 19:31:36 +02:00
AlexanderZemlyak a6a25d955d
Preprocessor removal (#3113)
* Remove preprocessor

* Delete preprocessor localization files

* Clean up code

* Remove adding directive in EXCLUDETEXT section

* Fix directive adding in EXCLUDETEXT

* Remove preprocessor leftovers

* More clean up

* Rename preprocessor to ifdef_directive

* Fix building tree for formatter variable assigning

* Restore convert4.exe

* Rework adding directive in EXCLUDETEXT

Более логично будет все-таки так.
2024-05-09 19:04:31 +03:00
AlexanderZemlyak 8add90aca0
Refactor file searching functions in Compiler (#3111)
* Refactor GetUnitFileName function and used by it

* Revert nested ifs in file searching

* Revert sanity checks

* Return lost checks
2024-05-09 11:58:42 +03:00
Sun Serega 00dad9d76b
Ldnull => Ldc_I4_0 2024-05-09 10:01:05 +02:00
Mikhalkovich Stanislav 38c4901787 DrawMan исправления падения при запуске 2024-05-08 23:44:49 +03:00
Mikhalkovich Stanislav 6f4f3a8aa0 3.9.0.3478 2024-05-07 23:31:47 +03:00
Ivan Bondarev 8120fb9d7a Merge branch 'master' of https://github.com/pascalabcnet/pascalabcnet 2024-05-07 22:04:11 +02:00
Ivan Bondarev bff1425ede fixed semantic intellisense 2024-05-07 22:04:03 +02:00
Ivan Bondarev be090609f0
Merge pull request #3115 from SunSerega/bin-Lng-encoding
Исправление кодировки Lng файлов
2024-05-07 18:25:20 +02:00
Mikhalkovich Stanislav 443ed6d3d7 ObjectToString - убрал подчеркивание
TypeName - убрал артефакты реализации в implementation и тесты, это использующие
2024-05-07 12:19:23 +03:00
Mikhalkovich Stanislav 7681391663 TypeName - оставил в интерфейсе только необходимое 2024-05-06 22:30:41 +03:00
Sun Serega 42fd1da870
+1 2024-05-06 01:41:52 +02:00
Sun Serega ba8a510185
fix SEMICOLON_BEFORE_ELSE 2024-05-06 01:40:53 +02:00
Sun Serega 2358149c70 convert all Lng files to UTF8+BOM 2024-05-06 01:15:29 +02:00
Mikhalkovich Stanislav efafd27ffb Merge branch 'master' of https://github.com/pascalabcnet/pascalabcnet
# Conflicts:
#	Configuration/GlobalAssemblyInfo.cs
#	Configuration/Version.defs
#	Localization/DefaultLang.resources
#	Release/pabcversion.txt
#	ReleaseGenerators/PascalABCNET_version.nsh
2024-05-05 23:54:40 +03:00
Mikhalkovich Stanislav 27fc10ab0f Странные комментарии к TypeName
LightPT - SetMessagesOn
2024-05-05 23:51:09 +03:00
Vladislav Krylov 1daa515b4e
Интерфейс семантических проверок + делегат на проверку, является ли файл модулем (#3112)
* changes to fit multi semantic analyzer architecture

* Added CheckIfParsingUnit delegate to Compiler
2024-05-05 18:12:50 +03:00
AlexanderZemlyak acb1be8c92
Directives fixes (#3110)
* Unify directive errors

* Add new quotesAreSpecialSymbols field to DirectifeInfo

* Rewrite directive parsing and checks

* Delete R+ directive from pascal tests
2024-05-05 18:12:35 +03:00
Sun Serega edf3358b39
Предупреждения для $else и $endif, у которых не совпадает имя дефайна (#3109)
* `$ifdef`: add warnings

* save directive name casing
2024-05-05 18:09:39 +03:00
Sun Serega 6612fac1c4
cleanup (#3107) 2024-05-04 22:20:40 +03:00
AlexanderZemlyak efb4a4338f
New checks for directives added (#3099)
* Extract base classes from ParserTools (local) and GPPGParserHelper

* Fix string resources error

* Extract base class for unexpected token error

* Update ParserTools project file

* Add comments for compiler directives usages in compiler

* Add directives checks

* Move string constants to new project

* Implement scalable directives checks

* Remove known directives from compiler

* Fix PABCSystem namespace error

* Allow region and endregion with no params

* Allow parameters to endif directive

* Delete directive parameters extension checks

* Replace error with warning for uknown directive case

* Fix generate native code (semantic rule) assigning

* Improve error messages for directives

* Rename RunParseThread to SwitchOnIntellisence

Для отладки может требоваться отключение Intellisence на уровне кода. Для понятности метод назван SwitchOnIntellisence.

* Resolve merge conflicts

* Add new compiler errors for unsupported target framework and output file type

* Add documentation to directives checks

* Fix directives check loop
2024-05-04 20:21:50 +03:00
Sun Serega 769212192f
TypeName: Handle tuples (#3106) 2024-05-04 14:08:21 +03:00
Sun Serega dfaef32384
TypeName: Improved nested generics (#3104)
fix #3103
2024-05-03 21:31:58 +03:00
Sun Serega 9104315f3e
refactor code dup (#3105) 2024-05-03 21:31:06 +03:00
Mikhalkovich Stanislav 99845ad152 fix #3102 2024-04-29 23:02:34 +03:00
Sun Serega 8e6ebc1f28
Вариант доработки #2655 (#3082)
* make new methods - ext methods

* fix the test

* +1

* fix description after merge

* fix doc

* Keep only the `ObjectString` ext methods

* revert everything except descriptions
2024-04-27 00:06:45 +03:00
Mikhalkovich Stanislav 4eb6462fd9 3.9.0.3463 2024-04-26 00:40:48 +03:00
Ivan Bondarev 1459245b6a Merge branch 'master' of https://github.com/pascalabcnet/pascalabcnet 2024-04-25 20:39:35 +02:00
Ivan Bondarev 0e25b58737 fix in intellisense 2024-04-25 20:39:21 +02:00
Sun Serega ca1700846d
Исправление TypeToTypeName для энумов (#3094)
* fix `TypeToTypeName` for enums

* use existing test
2024-04-23 21:32:13 +03:00