Truly independent web browser
Find a file
mattco98 adb4accab3 LibJS: Add template literals
Adds fully functioning template literals. Because template literals
contain expressions, most of the work has to be done in the Lexer rather
than the Parser. And because of the complexity of template literals
(expressions, nesting, escapes, etc), the Lexer needs to have some
template-related state.

When entering a new template literal, a TemplateLiteralStart token is
emitted. When inside a literal, all text will be parsed up until a '${'
or '`' (or EOF, but that's a syntax error) is seen, and then a
TemplateLiteralExprStart token is emitted. At this point, the Lexer
proceeds as normal, however it keeps track of the number of opening
and closing curly braces it has seen in order to determine the close
of the expression. Once it finds a matching curly brace for the '${',
a TemplateLiteralExprEnd token is emitted and the state is updated
accordingly.

When the Lexer is inside of a template literal, but not an expression,
and sees a '`', this must be the closing grave: a TemplateLiteralEnd
token is emitted.

The state required to correctly parse template strings consists of a
vector (for nesting) of two pieces of information: whether or not we
are in a template expression (as opposed to a template string); and
the count of the number of unmatched open curly braces we have seen
(only applicable if the Lexer is currently in a template expression).

TODO: Add support for template literal newlines in the JS REPL (this will
cause a syntax error currently):

    > `foo
    > bar`
    'foo
    bar'
2020-05-04 16:46:31 +02:00
.github Meta: Add GitHub Sponsors to funding options 2019-11-02 23:32:34 +01:00
AK AK: Rename variables with camelCase names in PrintfImplementation.h (#2095) 2020-05-04 09:40:17 +02:00
Applications LibTextCodec: Start fleshing out a simple text codec library 2020-05-03 23:01:58 +02:00
Base SystemMenu+MouseDemo: Add menu entry and nice icons 2020-05-04 09:58:14 +02:00
Demos MouseDemo: Add menu, using the new icon :^) 2020-05-04 09:58:14 +02:00
DevTools LibTextCodec: Start fleshing out a simple text codec library 2020-05-03 23:01:58 +02:00
Documentation Meta: Add configuration for setting up project in CLion 2020-05-04 09:50:45 +02:00
Games LibGUI: Make it easier to create checkable GUI::Actions 2020-04-21 17:21:28 +02:00
Kernel Kernel: Use Multiboot macros instead of magic constants (#2090) 2020-05-04 09:52:04 +02:00
Libraries LibJS: Add template literals 2020-05-04 16:46:31 +02:00
MenuApplets Meta: Fix Makefile permissions (not executable) 2020-05-03 14:24:08 +02:00
Meta Meta: Add configuration for setting up project in CLion 2020-05-04 09:50:45 +02:00
Ports Ports: Added rsync port 2020-05-02 14:12:07 +02:00
Servers ProtocolServer: Pass HTTP response headers to the client 2020-05-03 23:01:58 +02:00
Shell Shell: Check for invalid #! in commands 2020-05-04 09:39:05 +02:00
Tests Kernel: Demonstrate kernel crash on invalid fcntl 2020-05-03 22:46:28 +02:00
Toolchain Toolchain: Don't create repository for patches if not necessary 2020-04-27 17:59:33 +02:00
Userland LibJS: Add template literals 2020-05-04 16:46:31 +02:00
.clang-format Meta: Update .clang-format to not indent nested namespaces 2020-03-14 10:10:21 +01:00
.gitignore Meta: Add Lagom CMake dir to .gitignore 2020-04-13 23:15:05 +02:00
.travis.yml Meta: Build Lagom js and run LibJS tests on Travis 2020-04-20 22:44:13 +02:00
CODE_OF_CONDUCT.md Meta: Move code of conduct (lol) to a separate file 2019-10-23 10:05:06 +02:00
CONTRIBUTING.md Meta: Add a basic "issue policy" to CONTRIBUTING.md 2020-05-04 13:49:15 +02:00
INSTALL.md Meta: Update link to build instructions in INSTALL.md 2020-01-01 17:33:32 +01:00
LICENSE Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
Makefile Build: Use ccache if it's available (#1315) 2020-02-27 11:44:29 +01:00
Makefile.common Build: Use the GCC port if building on "SerenityOS" :^) 2020-04-20 19:52:35 +02:00
Makefile.subdir Build: wrap make invocations with flock(1) 2019-12-28 21:09:33 +01:00
ReadMe.md Meta: Add supercomputer7 to contributor list in ReadMe 2020-04-10 14:06:29 +02:00

SerenityOS

Graphical Unix-like operating system for x86 computers.

Travis CI status

About

SerenityOS is a love letter to '90s user interfaces with a custom Unix-like core. It flatters with sincerity by stealing beautiful ideas from various other systems.

Roughly speaking, the goal is a marriage between the aesthetic of late-1990s productivity software and the power-user accessibility of late-2000s *nix. This is a system by us, for us, based on the things we like.

I (Andreas) regularly post raw hacking sessions and demos on my YouTube channel.

Sometimes I write about the system on my github.io blog.

I'm also on Patreon and GitHub Sponsors if you would like to show some support that way.

Screenshot

Screenshot as of 1133aca

Kernel features

  • x86 (32-bit) kernel with pre-emptive multi-threading
  • Hardware protections (SMEP, SMAP, UMIP, NX, WP, TSD, ...)
  • IPv4 stack with ARP, TCP, UDP and ICMP protocols
  • ext2 filesystem
  • POSIX signals
  • Purgeable memory
  • /proc filesystem
  • Pseudoterminals (with /dev/pts filesystem)
  • Filesystem notifications
  • CPU and memory profiling
  • SoundBlaster 16 driver
  • VMWare/QEMU mouse integration

System services

  • Launch/session daemon (SystemServer)
  • Compositing window server (WindowServer)
  • Text console manager (TTYServer)
  • DNS client (LookupServer)
  • Network protocols server (ProtocolServer)
  • Software-mixing sound daemon (AudioServer)
  • Desktop notifications (NotificationServer)
  • HTTP server (WebServer)
  • Telnet server (TelnetServer)

Libraries

  • C++ templates and containers (AK)
  • Event loop and utilities (LibCore)
  • 2D graphics library (LibGfx)
  • GUI toolkit (LibGUI)
  • Cross-process communication library (LibIPC)
  • HTML/CSS engine (LibWeb)
  • JavaScript engine (LibJS)
  • Markdown (LibMarkdown)
  • Audio (LibAudio)
  • PCI database (LibPCIDB)
  • Terminal emulation (LibVT)
  • Network protocols (HTTP) (LibProtocol)
  • Mathematical functions (LibM)
  • ELF file handing (LibELF)
  • POSIX threading (LibPthread)
  • Higher-level threading (LibThread)

Userland features

  • Unix-like libc and userland
  • Shell with pipes and I/O redirection
  • On-line help system (both terminal and GUI variants)
  • Web browser (Browser)
  • C++ IDE (HackStudio)
  • IRC client
  • Desktop synthesizer (Piano)
  • Various desktop apps & games
  • Color themes

How do I build and run this?

See the SerenityOS build instructions

Wanna chat?

Come hang out with us in #serenityos on the Freenode IRC network.

Author

Contributors

(And many more!) Feel free to append yourself here if you've made some sweet contributions. :)

License

SerenityOS is licensed under a 2-clause BSD license.