<commit_before>#+TITLE: Cnt grammar specification
#+AUTHOR: <NAME> <<EMAIL>>

* BNF

#+BEGIN_EXAMPLE
<program>    := <block>
<block>      := [ <statement> ]...

<statement>  := <command> |
                <rfork> |
                <comment>

<command>    := [ "-" ] <identifier> [ <argument> ]... [ "|" <command> ]... |
                <filepath> [ <argument> ]... [ "|" <command> ]...

<rfork>      := "rfork" <argument> [ "{" <block> "}" ]
<comment>    := "#" <any> <eol>

<argument>   := <alphanumeric> |
                "\"" <alphanumeric "\"" |
                "'" <alphanumeric> "'"
<identifier> := <alphanumeric>
<eol>        := "\r\n" |
                "\n" |
                "\r"
#+END_EXAMPLE

* Examples

Some code examples:

#+BEGIN_EXAMPLE
#!/bin/cnt

echo "hello world"
#+END_EXAMPLE

#+BEGIN_EXAMPLE
echo "Here is the global namespace"

fork upm {
        echo "Here we are at some child namespace"
        echo "The global namespace was copied, and it still visible"

        # Shows all processes running in the parent namespace
        ps aux

        # mount the procfs in this mount namespace
        mount -t proc proc /proc

        echo "Now we see only the processes running inside this namespace
        ps aux
}

echo "Running commands in the parent namespace again"

#+END_EXAMPLE<commit_msg>Added vendoring. Improve docs. Add examples<commit_after>#+TITLE: Cnt grammar specification
#+AUTHOR: <NAME> <<EMAIL>>

* BNF

#+BEGIN_EXAMPLE
<program>    := <block>
<block>      := [ <statement> ]...

<statement>  := <command> |
                <rfork> |
                <comment>

<command>    := [ "-" ] <identifier> [ <argument> ]... [ "|" <command> ]... |
                <filepath> [ <argument> ]... [ "|" <command> ]...

<rfork>      := "rfork" <argument> [ "{" <block> "}" ]
<comment>    := "#" <any> <eol>

<argument>   := <alphanumeric> |
                "\"" <alphanumeric "\"" |
                "'" <alphanumeric> "'"
<identifier> := <alphanumeric>
<eol>        := "\r\n" |
                "\n" |
                "\r"
#+END_EXAMPLE

* Examples

Some code examples:

#+BEGIN_EXAMPLE
#!/bin/cnt

echo "hello world"
#+END_EXAMPLE

#+BEGIN_EXAMPLE
echo "Here is the global namespace"

rfork upm {
        echo "Here we are at some child namespace"
        echo "The global namespace was copied, and it still visible"

        # Shows all processes running in the parent namespace
        ps aux

        # mount the procfs in this mount namespace
        mount -t proc proc /proc

        echo "Now we see only the processes running inside this namespace
        ps aux
}

echo "Running commands in the parent namespace again"

#+END_EXAMPLE
{'fraction_non_alphanumeric': 0.15436493068565005, 'fraction_numerical': 0.0, 'mean_word_length': 2.1785714285714284, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6374445', 'n_tokens_mistral': 893, 'n_tokens_neox': 851, 'n_words': 250}