polserver/pol-core/bscript/compiler/format
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
..
CompiledScriptSerializer.cpp Properly scope the compiler includes to the Bscript folder. (#360) 2021-02-25 16:53:22 +01:00
CompiledScriptSerializer.h bscript/compiler: use c++17 nested namespace definitions (#202) 2020-08-10 12:20:29 +02:00
DebugStoreSerializer.cpp Properly scope the compiler includes to the Bscript folder. (#360) 2021-02-25 16:53:22 +01:00
DebugStoreSerializer.h New compiler: write debug info (.dbg and .dbg.txt) (#302) 2020-09-12 14:26:58 -07:00
ListingWriter.cpp Properly scope the compiler includes to the Bscript folder. (#360) 2021-02-25 16:53:22 +01:00
ListingWriter.h Add StoredTokenDecoder and ListingWriter stubs; write listfile (#208) 2020-08-11 12:49:18 +02:00
StoredTokenDecoder.cpp Add support for interpolated strings ("interstrings") (#369) 2021-03-11 22:48:16 +01:00
StoredTokenDecoder.h Clean up warnings: size_t/unsigned mixing, unused private variables (#352) 2020-12-01 02:23:03 -08:00