Commit graph

19451 commits

Author SHA1 Message Date
Ali Mohammad Pur
4c40151160 Shell: Implement formatting for Heredocs 2021-04-29 20:25:56 +02:00
Ali Mohammad Pur
c5c6161406 Base: Describe heredocs in Shell's manpage 2021-04-29 20:25:56 +02:00
Ali Mohammad Pur
d70f25bbe5 Shell: Add some tests for heredocs 2021-04-29 20:25:56 +02:00
Ali Mohammad Pur
3048274f5e Shell: Add support for heredocs
Closes #4283.
Heredocs are implemented in a way that makes them feel more like a
string (and not a weird redirection, a la bash).
There are two tunables, whether the string is dedented (`<<-` vs `<<~`)
and whether it allows interpolation (quoted key vs not).
To the familiar people, this is how Ruby handles them, and I feel is the
most elegant heredoc syntax.
Unlike the oddjob that is bash, heredocs are treated exactly as normal
strings, and can be used _anywhere_ where a string can be used.
They are *required* to appear in the same order as used after a newline
is seen when parsing the sequence that the heredoc is used in.
For instance:
```sh
echo <<-doc1 <<-doc2 | blah blah
contents for doc1
doc1
contents for doc2
doc2
```
The typical nice errors are also implemented :^)
2021-04-29 20:25:56 +02:00
Ali Mohammad Pur
7c8d39e002 Shell: Do not assume that all parts of a node are enclosed in the node
For instance, heredocs are made of two parts, and the second part is not
within the bounds of the first one.
2021-04-29 20:25:56 +02:00
Ali Mohammad Pur
cf4935e806 Shell: Avoid position push/pop when checking for next_is()
This operation is not a rule and cannot produce nodes.
2021-04-29 20:25:56 +02:00
Ali Mohammad Pur
0d742557c6 Shell: Allow Syntax errors to be mutated while parsing
Some nodes (such as heredocs) cannot be validated immediately, so the
entire tree will need to be revalidated if we don't allow mutating
syntax errors.
2021-04-29 20:25:56 +02:00
Andreas Kling
39369f1da6 Utilities: Use Vector<String> positional arguments in some places
There are more places we can use these, I just picked some that felt
like they improved the code.
2021-04-29 11:28:01 +02:00
Andreas Kling
695cdf7bc0 LibCore: Support Vector<String> positional arguments
We already supported Vector<char const*>, so let's add Vector<String>
as well. :^)
2021-04-29 11:10:06 +02:00
Tobias Christiansen
889e1d3db9 LibWeb: Add list-style-type: upper-latin and upper-alpha support 2021-04-29 10:43:33 +02:00
Tobias Christiansen
cb34775c83 LibWeb: Add list-style-type: lower-alpha and lower-latin support
They achieve the same, a list which markers are lowercase (latin)
characters.
2021-04-29 10:43:33 +02:00
Tobias Christiansen
7dd0fb0086 LibWeb: Conversion from number to bijective-base with alphabet.
This allows us to convert a number to a String given a bijective
(zero-less) alphabet.
So you count A,B,C,...,Y,Z,AA,AB,...

This was surprisingly very tricky!

This allows the ListItemMarker to be displayed with different (simple)
alphabets in the future.
2021-04-29 10:43:33 +02:00
Tobias Christiansen
0983cd9243 LibWeb: Add list-style-type: decimal-leading-zero support
This doesn't exactly do what you would think from its name: It surely
adds an extra leading zero to the front of a number, but only if the
number is less than 10. CSS is weird sometimes.
2021-04-29 10:43:33 +02:00
Brian Gianforcaro
64d7a8b7aa Tests: Convert LibC exec unit test to be LibTest based. 2021-04-29 10:37:26 +02:00
Brian Gianforcaro
8d8535f297 Tests: Convert LibC mktemp tests to be LibTest based. 2021-04-29 10:37:26 +02:00
Brian Gianforcaro
2cef015528 LibTest: Add EXPECT_NE(..) test assertion. 2021-04-29 10:37:26 +02:00
Brian Gianforcaro
adcd56473c Tests: Enable Spreadsheet unit tests so they actually build 2021-04-29 10:37:26 +02:00
Brian Gianforcaro
8ae3191ab5 Tests: Unify LibC tests to single location.
In a1720eed2a I added this new test,
but missed that there were already some "unit tests" for LibC over
in Userland/Tests/LibC. So lets unify these two locations.
2021-04-29 10:37:26 +02:00
Brian Gianforcaro
7a0d7525f1 Build: Simplify LibGfx test's CMakeLists.txt with serenity_test(..)
Now that everything is LibTest based, we can just use the normal
pattern of iterating + serenity_test(..).
2021-04-29 10:37:26 +02:00
Brian Gianforcaro
a8835b2d8f Tests: Convert LibGfx font handling test to be LibTest based. 2021-04-29 10:37:26 +02:00
Brian Gianforcaro
6b5bbf9464 Tests: Convert LibGfx image decoder test to be LibTest based. 2021-04-29 10:37:26 +02:00
Brian Gianforcaro
d2b4ea69ab Tests: Rename LibGfx painter benchmark to denote it's not a test. 2021-04-29 10:37:26 +02:00
Brian Gianforcaro
cf0640c870 Build: Remove unused ${REGEX_SOURCES} from the tests CMakeLists.txt 2021-04-29 10:37:26 +02:00
Idan Horowitz
115b445dab LibGfx: Add basic support for bidirectional text rendering
This adds a *very* simplified version of the UNICODE BIDIRECTIONAL
ALGORITHM (https://www.unicode.org/reports/tr9/), that can render most
bidirectional text but also produces awkward results in a large amount
of edge cases, and as such, this should probably be replaced with a
fully spec compliant implementation at some point.
2021-04-29 10:36:23 +02:00
Idan Horowitz
33fdd402b5 Meta: Increase fconstexpr-steps for Clang Lagom builds
Clang's default constexpr-steps limit is 1048576, which is not enough
for LibGfx's generation of the unicode bidirectional class lookup table
while GCC doesn't have any limit at all, so this patch increases the
limit to an arbitrarily larger value.
2021-04-29 10:36:23 +02:00
Andreas Kling
357a455b5c iLibC: Fix some missed camelCase => snake_case 2021-04-29 10:34:02 +02:00
Andreas Kling
bebdf24329 Meta: Add note to CONTRIBUTING.md about pointless GitHub comments 2021-04-29 10:34:02 +02:00
Andreas Kling
910edb1e0c Meta: Simplify & clarify CONTRIBUTING.md somewhat
Also remove the feature policy section, since it was mostly fluff.
It was nice fluff, but made the document less focused.
2021-04-29 10:34:02 +02:00
Andreas Kling
d3e7529297 LibWeb: Move Layout::TextNode whitespace collapse to separate function 2021-04-29 10:34:02 +02:00
Gunnar Beutner
2f1ee91b3e Ports: Make Super Mario work with GCC 11 2021-04-29 10:33:44 +02:00
Gunnar Beutner
19064eaaca Toolchain: Update the binutils patch file to match the port
Previously the toolchain's binutils would not have been able to
build binaries on 32-bit host systems (not that this would be
much of an issue nowadays) because one of the #ifdefs was in
the wrong place.

I moved the #ifdef in the port's patch and this now updates
the toolchain's patch file to match the port's patch.
2021-04-29 10:33:44 +02:00
Gunnar Beutner
797cb8858a Ports: Update binutils to version 2.36.1
Otherwise linking fails when building object files with
DWARF 5 symbols.
2021-04-29 10:33:44 +02:00
Gunnar Beutner
77087780a2 Ports: Remove duplicate configopts var 2021-04-29 10:33:44 +02:00
Gunnar Beutner
669676b635 Ports: Build fix for gcc when building the port with gcc 11.1.0 2021-04-29 10:33:44 +02:00
Gunnar Beutner
d2a5d76b54 Ports: Use SHA256 for the gcc port
This updates the way we verify signatures for the gcc
port because we were previously downloading the keychain
from the mirror which defeats the point of doing signature
checks.
2021-04-29 10:33:44 +02:00
Gunnar Beutner
c861195557 Userland: Fix new GCC warnings 2021-04-29 10:33:44 +02:00
Gunnar Beutner
8cd62b5780 Toolchain+Ports: Update GCC to version 11.1.0 2021-04-29 10:33:44 +02:00
Brian Gianforcaro
1d3bc482a5 Ports: Fix ports linting, ffmpeg is missing from AvailablePorts.md 2021-04-29 09:50:10 +02:00
Holden Green
0d74dffe3b Ports: ffmpeg 4.4 2021-04-29 09:34:27 +02:00
Holden Green
18a641f3f8 Implemented llabs() in stdlib.h/cpp. 2021-04-29 09:34:27 +02:00
Holden Green
4ce17721e3 LibC: added a bunch of macros in inttypes.h for use in formating strings being passed to sscanf. 2021-04-29 09:34:27 +02:00
Gunnar Beutner
f94f381210 Ports: Fix the SHA256 checksum for the yasm port 2021-04-29 09:29:53 +02:00
Maciej Zygmanowski
1460c93651 Browser: Display search engine format in statusbar 2021-04-29 09:08:22 +02:00
Maciej Zygmanowski
2de0ff28dd Browser: Save search engine setting to preferences 2021-04-29 09:08:22 +02:00
Sahan Fernando
c3cf739b94 AK: Make AK::Vector expose allocation failures in API 2021-04-29 09:02:58 +02:00
Justin
e6401d65bd Kernel: Add MSG_PEEK support for the IPv4Socket
This commit will add MSG_PEEK support, which allows a package to be
seen without taking it from the buffer, so that a subsequent recv()
without the MSG_PEEK flag can pick it up.
2021-04-29 08:09:53 +02:00
Justin
2d098c88dc Kernel: Implement peek() function for DoubleBuffer
This allows us to "peek" into a DoubleBuffer without incrementing
the m_read_buffer_index, which is needed to implement MSG_PEEK.
2021-04-29 08:09:53 +02:00
Gunnar Beutner
9bcdbe205b LibDebug: Implement support for AttributeDataForm::ImplicitConst
While symbolicating a crash dump for UserspaceEmulator I came across
another data form we didn't support.

ImplicitConst encodes a LEB128 value in the abbreviation record
rather than - like all other values - in the .debug_info section.
2021-04-29 08:02:52 +02:00
Panagiotis Vasilopoulos
278605cde6
Browser: Add GitHub and Yandex to search engines 2021-04-29 01:15:42 +02:00
Gunnar Beutner
21ba438ad3 Ports: Remove unused signature file for the rsync port 2021-04-29 01:12:55 +02:00