Commit graph

93 commits

Author SHA1 Message Date
Jakub Kalita
67acb43264
Fixed reading map properties + VS2022 boost update (#455)
* Fixed reading map properties.
* Updated boost version to enable VS2022 builds.
2022-02-18 19:01:40 +01:00
Kevin Eady
c6301c0c52
Fix constant declaration production (#399)
* Fix constant delcaration production

* Add tests
2021-04-19 21:58:36 +02:00
Kevin Eady
0ca7912fcd
Add support for conditional operator (#387)
* Grammar update

* AST generation

* Emit instructions

* Add initial tests

* Additional tests

* Rename to ConditionalOperator

* Add docs
2021-03-14 23:20:20 +01:00
Kevin Eady
e41f70d72e
Add support for interpolated strings ("interstrings") (#369)
* Update grammar to support interpolated strings

* Struct initializers, case switchs are regular strings

* Initial stub for interpolated string in AST
This splits the previous STRING_LITERAL terminal into a production,
stringLiteral, to handle REGULAR_STRING terminal and interpolatedString
production.

* Change interpolated strings to expressions

* Fix mode handling in grammar

* Grammar fixes
- Fix mode handling in lexer
- Interpolated strings only have one expression

* Can successfully parse, stub compile interstrings
$"He {there + print("hello")}";

* Add formatting string to grammar

* Fix tests, and add test stubs

* Rename curleys to brace; better AST generation

* initial work interstring instruction

* Initial work on formatted string instruction: emit

* Formatted string instruction: execution

* Add simple formatted string test

* Add formatted string test src

* Review changes #1
- Rename `FormattedString` to `FormatExpression`
- Rename overloaded `try_to_format()` to `get_formatted()`

* Review changes part 2
- Rename `InterpolatedString` ast node to `InterpolateString`

* Review changes part 3
- Modify `ins_interpolate_string`

* Review changes part 4
- Remove unused formal parameter

* Add negative tests

* Spruce up positive tests

* Fix braces, escape chars inside interstring

* Fix, add tests for escaped char and double brace

* Address differences for new lines in tests

* Update Escript version

* Make empty expression an error

* Add documentation for interpolated strings

* Quick touchup on docs
2021-03-11 22:48:16 +01:00
Kevin Eady
44c864b917
Remove erroneous lexing productions (#371)
* Remove erroneous lexing productions

* Fix hex float literals

* Address review comments.
2021-02-27 23:54:07 +01:00
Kevin Eady
b1e8d2b36a
Fix escape sequences, double-slash in strings (#368) 2021-02-22 21:20:55 +01:00
Eric Swanson
1adcab5644
Upgrade boost to 1.74 (#340)
* boost 1.69

Due to this: https://github.com/boostorg/atomic/issues/15

* build boost with libs for asio

* Boost 1.74

Download from dl.bintray.com/boostorg/ because Boost 1.74 .bz2 is larger than GitHub will allow without LFS

* set BUILD_BYPRODUCTS (just setting one library, and doesn't handle windows..  I don't know what is correct anyway)

* build with b2

* Try Boost.cmake from Kevin

* Specify toolset in configure command line

* Use POL_EXT_LIB_DIR.  Make clib depend on boost, not pol itself

* cache boost for github actions

* Copy-pasta correction

* Cache boost for additional github build workflows

* cache boost for coverage build, updated cache action version

Co-authored-by: Kevin Eady <8634912+KevinEady@users.noreply.github.com>
Co-authored-by: turleypol <turley@polserver.com>
2020-12-23 12:11:32 +01:00
Eric Swanson
203db02d48
New compiler: Move precedence of "in" above comparison operators (#316)
Rationale:
  a in b == x in y   // membership in two things is the same
  a in b != x in y   // membership in two things is different
  a in b <= x in y   // a has at most as much membership in b as x has in y
  a in b <  x in y   // a has less membership in b than x does in y

This matches Kotlin precedence for this operator https://kotlinlang.org/docs/reference/grammar.html#expressions
2020-09-15 06:48:36 -07:00
Eric Swanson
00904c02c8
Adjust operator precedence for bitwise operators: (#315)
- Moved <<, >>, & to same level as multiplication
- Moved | and ^ to same level as addition
2020-09-15 06:03:05 -07:00
Eric Swanson
591eb37d04
New compiler: No longer reserved words: null, declare (#313)
* These are not reserved words:
  - null
  - declare

Fixes https://github.com/polserver/polserver/issues/309
2020-09-15 00:16:31 -07:00
Eric Swanson
92098e3784
grammar: report trailing commas in dictionary, struct, array initializer lists (#252) 2020-08-29 02:52:40 -07:00
Eric Swanson
d456cc98eb
Update compiler grammar (#238)
* Update grammar
  - add '=' to grammar so that we can report appropriate errors
  - add elvis ?: operator
  - add foreachIterableExpression to match old compiler (which only allows certain expressions)
  - allow both byref and unused on the same function parameter
  - rename methodCall -> functionCall
  - rename memberCall -> methodCall
  - add named parser rule for functionReference
  - move everything that isn't expression(s) with operators into primary
    - expression is now just the left-recursive rules and prefix operators
  - add named parser rules for struct, dictionary, error, array initialization
  - remove special-case for named parameters with := from function call argument, because it is ambiguous with assignment
  - Moved array access, object member access, and object method calls to navigationSuffix

* Regen grammar
2020-08-21 01:53:42 -07:00
Fernando Rozenblit
f3c3dbd0cf
Remove unused library and header (#218) 2020-08-14 21:38:02 +02:00
turleypol
ad3644de23
Antlr and Curl build step fix (#213)
* force antlr to always build in release node also for multiconfigs
set the correct c++ runtime flag for clang on windows
fixed lib path for antlr
in CI also test msbuild and different modes then release

* cache antlr in nopch and force recompile in pch build

* force release mode also for curl
2020-08-13 15:16:36 +02:00
turleypol
62fa91ec8e
Antlr external project (#204)
Build antlr as external project inside of lib/antlr.
Cache in Ci the antlr folder to speed up compilation times.

* replace ERROR with ANTLR_ERROR, fix clang build
* added missing define needed to link on windows
* different lib name with clang on windows
2020-08-10 14:53:29 -07:00
Eric Swanson
ed033fc6e4 bscript uses antlr library, and compiles the lexer and parser
Ignore ANTLR grammar plugin (idea) generated files
2020-08-03 19:39:29 -07:00
Eric Swanson
4834aee9d9 escript_grammar.cmake from Turley
Incorporate cmake/escript_grammar.cmake

Adjust generated EscriptParser.cpp: Need namespace for TokenStream in constructor
2020-07-26 23:42:33 -07:00
Eric Swanson
c0880e5e46 generated lib/EscriptGrammar from grammar 2020-07-26 21:28:02 -07:00
Eric Swanson
bc95e2e53b
EscriptGrammar from escript-antlr repo commit ef133e3a3a3184936e93493c863b7b995cdf4737 (#162) 2020-07-25 12:17:42 -07:00
Eric Swanson
26aa8a01fa Incorporate ANTLR into the cmake build.
Adjust ANTLR runtime source code: Replace ERROR with ANTLR_ERROR because it clashes with a longstanding windows header #define.
2020-07-17 20:52:40 -07:00
Eric Swanson
3b7bed8d60 Add ANTLR runtime source code as lib/antlr: Add runtime/Cpp/runtime/src directory from https://github.com/antlr/antlr4/archive/4.8.tar.gz 2020-06-27 20:46:17 -07:00
turleypol
39093cdbbe fix compile error with clang 2020-01-13 11:13:35 +01:00
turleypol
7db59e0ab8 Support for github actions
with artefacts for all platforms
fixed VS2019 build for format lib
2019-12-26 21:43:41 +01:00
turleypol
af5d3f38d7 utf8 work in progress 2018-06-25 19:30:59 +02:00
turleypol
6cb38c16d5 updated zlib for windows 2018-06-24 11:41:30 +02:00
turleypol
30dd7bc2d3 removed old boost archive 2018-06-24 11:15:49 +02:00
turleypol
fbc9a78cda updated Boost to 1.67 2018-06-24 11:14:51 +02:00
turleypol
7f9219afbd Curl should now build correctly on windows
Removed more visual studio prj files and removed some deprecated files
2018-06-23 19:19:27 +02:00
turleypol
aa6e8f44bf removed all visual studio files 2018-06-17 18:20:06 +02:00
Fernando Rozenblit
83c4ca59af Merge branch 'master' into feature/uopreading 2018-02-26 23:16:32 +01:00
turleypol
3afc41241b
CMake on windows (#48)
CMake can now also be used for windows
2018-02-24 22:34:55 +01:00
Fernando Rozenblit
9f047e3adb Added kaitai runtime for cpp 2018-02-19 18:30:19 +01:00
turleypol
dbb25bdb62
Include and buildsystem cleanup (#45)
Include cleanup
Reworked buildsystem (Linux only)
Removed dynamic libs, Linux now again uses static linking (like windows)
2018-01-29 21:55:48 +01:00
Kevin Eady
a28cd9c42c Initial implementation of json 2018-01-05 20:40:14 +01:00
GIB
2385381060
Update prepare_extlibs.bat
Update prepare_extlibs.bat to force vs2017 dev cmd to use current working directory.
2018-01-03 20:48:38 +08:00
turley
af863461dd Added dedicated VS2017 project 2018-01-03 12:09:36 +01:00
turley
c0db8527ef reworked buildDistWin
find VS installation with vswhere (local if no 2017 is installed)
dont build and link against debug version of curl
automatically insert git revision if git is in path
2018-01-03 10:07:42 +01:00
turleypol
8d7e7fcfb9 Linux build curl
placed boost also as extra cmake step
removed some outdated files
2017-12-31 18:34:12 +01:00
Kevin Eady
5063a20428 Moved building of curl into prepare_extlibs batch file. 2017-12-30 21:46:42 +01:00
Kevin Eady
ef5562f25c Initial implementation of libcurl support 2017-12-27 21:46:13 +01:00
turley
0e5d57e994 Added missing zlib files to be able to uncompress on windows platform 2017-09-10 14:14:53 +02:00
Fernando Rozenblit
0f66818b9e Update boost to version 1.63 2017-02-27 23:53:15 +01:00
turley
9094b3bd8c Optimized los check by introducing caching
added Google Benchmark lib (currently linux only)
compile with ENABLE_BENCHMARK see bin-build/build_tools.sh
2016-12-18 12:48:35 +01:00
turley
b375cfb7bc Merge branch 'master' of https://github.com/polserver/polserver
* 'master' of https://github.com/polserver/polserver:
  update gitignore for boost
2016-02-12 00:07:03 +01:00
turley
764e983d98 more lineendings
again blame bodom
2016-02-12 00:06:07 +01:00
turley
4991647c0e update gitignore for boost 2016-02-11 23:52:24 +01:00
turley
ed7b16b233 normalized lineendings 2016-02-11 22:54:43 +01:00
turley
6de0c7e1c0 added define to use boost regex (older gcc has bug in std version)
added define for the git revision and centralized others
2016-01-19 21:04:40 +01:00
turley
3c8c9f5c28 fixed pessimizing move
disabled testrun for clang
2015-12-27 22:48:51 +01:00
Thomas Volkert
8c3c5f760a Fixed Windows build and several minor fixes 2015-11-18 23:45:16 +01:00