PLDB
Languages Features Calendar CSV Lists Blog About Sponsor Add Language
GitHub icon

Embedded Crystal

Embedded Crystal

< >

Embedded Crystal is a template language created in 2016.

#296on PLDB 6Years Old 22.2kUsers
0Books 0Papers 287Repos

Embedded Crystal (ECR) is a template language for embedding Crystal code into other text, that includes but is not limited to HTML. The template is read and transformed at compile time and then embedded into the binary.


Example from the web:
# greeting.ecr <%- if @name -%> Greeting, <%= @name %>! <%- else -%> Greeting! <%- end -%> Greeting.new(nil).to_s #=> Greeting!
Example from Linguist:
<% if @name %> Greeting, <%= @name %>! <% else %> Greeting! <% end %>

Language features

Feature Supported Example Token
Comments
# A comment
Line Comments
# A comment
#
Semantic Indentation ϴ
sgml.html · ecr.html · perl-6.html

View source

PLDB - Build the next great programming language · v2022 · Day 90 · Docs · Build · Acknowledgements · Traffic Today · Traffic Trends · Mirrors · GitHub · feedback@pldb.com