* use transparent comparator to optimize away temporary string creation
* missing headers
should be case sensitive compare not insensitive
* flyweightstring support
made it insensitive again
next missing header
* more missing includes :(
* simplified via small wrapper
* allow also char[], removed on caller side some temp object creation which are no longer
needed
* it still only accepts string like objects.. fixed
* switched to strnicmp added comments
* missing header
* fixed comparison
* added unittest
* use c++20
* increased used clang version
* compiler report and logfacility use now compile time formatting, which
means that the formatstring gets checked at compile time. (which found 2 errors)
adapted a few places since report only accepts formatting arguments
adapted a few places with logging since char[] is compile time
formatting and string or chr* is runtime formatting
* use std::ranges instead of boost
* disabled pragma_assume vs specific macro (I guess noone cares)
* needed to fix ancient ms exception code
* modernized SpinLock
* removed unused code in ECompile
* replaced std::filesystem::path::u8string with string. It now returns an actual u8string type
* cleanup layers.h added the defines for other layers which where before
only defined in the pkt
* osmod::OpenConnection and HTTPRequest cleanup: early outs, dont check for pChild which is
only needed for startscript and placed suspend at the very last
position
* fix warning
* rebuild cache with new compiler version
* define c++ standard for external libs where possible
* added fixme
* first working short curcuit for && and or
creates jumps after each expressions to skip the following
* fixed valuestack when short circuit jmp does not jump
* use specialized instructions for short circuit && and ||
1: lhs
2: logical jump if false/true goto 4 <- if jmp do logical convert
3: rhs
4: logical convert
5: rest
logical convert is needed since "normal" && || operations convert isTrue
to BLong
added BObjectRef BObjectImp set specialization to remove noise
* fixed converted objimp when jump on false values
* first version of short circuit warning
should be moved to analyzer
added whitelist of module functions which have no sideeffect to reduce
the number of warnings
* moved warning visitor to analyzer and added it as extra compile step
fixed sourceline print and cache the content
* missing include, unused member
* included the correct header
* ecompile.cfg to activate and warn
ecompile cmdline arg to activate it
run all tests also with it active
fixed that only the most right side statement was checked
* ecompile cmdline
* increase ecompile version
cleanup
* compilation error
* missing header
* allow -S- to deactivate shortcircuit like the other params do
* extended whitelist functions
* revert fileformat version increase
fixed escript test cmake
* use the correct arg
* escript testoutput can now be different if shortcircuit is active
* docs
* additional test
* addressed comments
* Add -Z option to print string tree
* Simple test to print an AST
* Make CompiledScript owner of the tree
* some refactoring
- rename ecompile.cfg option
- rename AST generator class
* core-changes, docs
* fix warnings
* Add Report.debug
* Implement function call scoping
* Implement variable scoping
- Rename `Identifier::scope` to `calling_scope`, and concatenate the identifier scope into `name` if necessary.
- Track current scope in SemanticAnalyzer, similar to UserFunctionVisitor.
- Use current scope in SemanticAnalyzer when visiting identifiers.
* Update grammar for `::identifier` global scoping
* Introduce ScopableName for function resolution
* Address review comments
- Check for display_debugs missing
* Add ScopableName for identifier resolution
* Some cleanup
- Remove `Identifier::calling_scope`, as it is tracked in the semantic
analyzer
- Refactor `ScopeName::exists` to `global` for better clarification of
its use
- Removed `X::maybe_scoped_string/name`
* Address self-review comments
* Rename `Function::module_name` to `scope`
* fixed missing space when packing funcrefs
pack functioncall during group formatting without forcing a newline
* error if resulting format string is empty
* core changes
* do not start a newline when next part is a closing parenthesis during
groupformatting
* pkg loading is again quiet
* more formatting improvements:
replace inside of comments tabs with spaces if UseTabs is false
do not strip whitespaces at the beginning of linecomments
better handling of long lines eg string additions
"binpack":
if an array fits equally into up to 3 lines use this instead of having each element in a newline
struct/dicts get only packed if they fit into a single line, or half of the room for two lines
align comments in statements
* fixed linecomment forcing newline in simple splits
formatting of functionexpressions
```
@(blubb) {
blah;
};
```
* fixed windows lineendings
fixed extra newline before long comment in certain situations
added option FormatterFormatInsideComments to deactivate trimming and
replacing of tabs
* fixed typo..
ecompile cfg is now FormatterIndentLevel
* FormatterBracketAttachToType: array{} vs array {}
FormatterAllowSingleLines: allow single line case/functionrefs
* align case label expressions
comments at the end still make the expression packable
other bugs
* better detection of case labels, by buffering the text. fixed more
problems with comments while packing lines
* do not allow more then 3 lines to be packed to a single one
* fixed hopefully last bug with comments and packing
removed FormatterAllowSingleLines
added
FormatterAlignTrailingComments
FormatterAlignConsecutiveShortCaseStatements
FormatterAllowShortCaseLabelsOnASingleLine
FormatterAllowShortFuncRefsOnASingleLine
* better linesplits when prefferedBreak is used (functions with params)
* fixed unalign lines with comments in arrays
* simplified ecompile code, use callback for compilation during iteration
through the directories.
use for pkgs recursive_directory_iterator
* core-changes
* onlinedocs
* onlinedocs-typo
* corrected cfg
* do not touch comments at all when disabled
detect aligned */
* fixed group formatting in var statements in more complicated situations
* when packing finishes right before the last element check if this
element also fit into the last line
* remaining ); or similar parts dont start a new line during group
formatting
* fixed edge cases of preferredBreak tactic with paranthesis alignment
* changed defaults, updated docs
* Add libefsw at 3419347
* saving work
* some cleanup
* move to fs::paths
* saving work.. maybe hitting a limit with number of watched dirs?
* migrate to watching only ecompile.cfg specified folders, cleanup/doc
* Display summary between compilations in watch mode; fix cache reuse
* Fix inf loop; some cmake, format changes...
* some windows compilation fixes... tweaks to windows cmake?
* Update Efsw.cmake for build lib changes
* removed debug flag
* silence efsw build
dont add antlr project if it already exists
* Address review comments:
- use std::move on efswwatcher add_*
* add docs
* Add WatchModeByDefault ecompile.cfg option
* iniital work on tests
* Add CI actions
* some changes (passes locally on win, mac, linux)
* Fix fixtures dependency; use ecompile verbose mode
* Add core-changes
* Send ctrl+c instead of killing process
* Proper Python file naming
* Kill ecompile process on windows, SIGINT otherwise
---------
Co-authored-by: turleypol <turley@polserver.com>
* Squash only prettify changes from escript_formating_try
* support of "format-off" / "format-on" comments to mark areas without
formatting
* fix typo
* added FormatterIdentLevel, FormatterMergeEmptyLines cfg entry
better line splits for dicts/arrays
* added several spacing options. the current setting list is now:
//LineWidth
FormatterLineWidth 80
// keep original keyword spelling
FormatterKeepKeywords 0
// number of spaces for ident
FormatterIdentLevel 2
// multiple newlines get merged to a single
FormatterMergeEmptyLines 1
// space between emtpy parenthesis eg foo() vs foo( )
FormatterEmptyParenthesisSpacing 0
// space between emtpy brackets eg struct{} vs struct{ }
FormatterEmptyBracketSpacing 0
// space after/before parenthesis in conditionals
// eg if ( true ) vs if (true)
FormatterConditionalParenthesisSpacing 1
// space after/before parenthesis
// eg foo( true ) vs foo(true)
FormatterParenthesisSpacing 1
// space after/before brackets
// eg array{ true } vs array{true}
FormatterBracketSpacing 1
// add space after delimiter comma or semi in for loops
// eg {1, 2, 3} vs {1,2,3}
FormatterDelimiterSpacing 1
// add space around assignment
// eg a := 1; vs a:=1;
FormatterAssignmentSpacing 1
// add space around comparison
// eg a == 1 vs a==1
FormatterComparisonSpacing 1
// add space around operations
// eg a + 1 vs a+1
FormatterOperatorSpacing 1
// use \r\n as newline instead of \n
FormatterWindowsLineEndings 0
* added tab support
// use tabs instead of spaces
FormatterUseTabs 0
// tab width
FormatterTabWidth 4
* extended example ecompile.cfg with formatter settings
* cleanup
* program args comma is optional...
fixed line comments in group splitting
* since tokenids are now correct no more guessing for linecomments needed
* comments use as start tokenid the whitespace token if its on the same
line
* splitted processing from linebuilding
* renamed TokenPart to FmtToken better matches the purpose.
Comments get directly stored as FmtToken
started with a context enum
* better(?) formatting for groups
* fix eof rawlines
added check that all comments/rawlines got parsed
* const correctness
* datatype adapted to antlr
* fixed warnings
* added InsertNewlineAtEOF
* add newline at the end if the original file had one
dont strip comment whitespace if its somejind of "header block"
use the defined lineending for /* */ comments
* docs
* \r\n is default on windows \n otherwise
* fixed warning
---------
Co-authored-by: Kevin Eady <8634912+KevinEady@users.noreply.github.com>
* POLLOG* macros use the new formatting
removed all old logging functions
* removed old fmt lib from everything except StreamWriter
removed unneeded functions
* fixed review comments
* renamed include guard to be able to use both format lib versions in
parallel
* build Fmt lib and link it into clib
* use std::string instead of format Writer for logging
added variant "2" for logging with new fmt lib
* use new logging variant for two logs
* always add \n to flush log, lets see if the assumption holds
* use new lib for tostring
* replaced all INFO_PRINTS in clib
* formatter for Token, BObject and BObjectImp
* started with bsccript
* use function instead of actual object for logging
* remaining bscript, started plib
* logvariant without newline added, more template magic
* format support for base types, added test for format padding
new version for fdump
* chanhed ecompile/runecl fixed compilation with ESCRIPT_PROFILE
* rewrite INFO_PRINT in plib,poltool/uoconvert/uotool
* replaced remaining INFO_PRINTS, renamed macros INFO_PRINT for logging
without newline, INFO_PRINTLN for newline addition.
Replaced also INFO_PRINT_TRACE and renamed it to INFO_PRINTLN_TRACE
* gitignore for fmt lib
* cleanup vim leftovers
* use std::filesystem to iterate over directories
realms folder can now contain files
* Ignore unix like hidden dir entries
* simplified recursive compilation
Also: OG compiler debug info for foreach iterator changed to match actual variable name
Adds:
- ast/DebugStatementMarker: for "intrusive debug" (ecompile -i) instructions
- codegen/DebugBlockGuard: pushes and pops debug block #
- format/DebugStoreSerializer: writes .dbg and .dbg.txt files
- representation/DebugBlock: holds parent block # and local variable names for each block
- representation/DebugStore: holds all debug information
Adds:
- ast/UserFunction AST node for user-defined functions.
- astbuilder/AvailableUserFunction: reference to a parse tree for a user function.
- The AST builder only generates ASTs for user functions that are actually referenced.
- astbuilder/UserFunctionVisitor: visits (builds an AST for) a parse tree for a user function.
- This happens after the .src or .inc file has been otherwise processed, so this class serves to hook up the correct SourceFileIdentifier to the AST.
Adds enough to build the AST nodes for the module function declarations in a .em file.
Adds:
- Function: base class for module function declarations and user functions
- FunctionParameterDeclaration: declaration for a function parameter, as well as its default value if any
- FunctionParameterList: just a holder for function parameter declarations
- ModuleFunctionDeclaration: for function declarations in .em files
- FunctionResolver: hooks up function calls to module functions or user functions
- ModuleProcessor: a visitor for processing const declarations and module function declarations (const declarations are yet to come from the main branch)
The Disambiguator will correct the AST based on context.
At present, it needs to handle ambiguities in the grammar between
case group selectors and named break/continue labels.
Add astbuilder/BuilderWorkspace:
- Temporary workspace used while building the AST (which goes in the CompilerWorkspace)
Add astbuilder/CompilerWorkspaceBuilder:
- Builds a CompilerWorkspace for a script
Add model/CompilerWorkspace:
- Holds AST
- Holds some intermediate data used by semantic analyzer, optimizer, code generator
* Add compiler/Profile
* Add compiler/Report
* From CR notes: add newline on caught exception.
Also added comments that messages should have a newline at the end.
* use c++14 on linux, visual studio still undefined which means highest
available
* removed make_unique.h due to c++14 no more needed
* stumbled across pre c++14 code
* Removed use of boost::make_unique<> (updated to C++14)
Co-authored-by: turleypol <turley@polserver.com>
* Add -G / CompareCompilerOutput ecompile mode that runs old and new compiler and compares output.
Add LegacyFunctionOrder because parity needs to know how the old compiler ordered functions.
* Fix class/struct mixup, add to cmake sources