Skip to content

Commit

Permalink
#86 - put grammar terminals in typst raw font
Browse files Browse the repository at this point in the history
  • Loading branch information
danilopedraza committed Feb 12, 2025
1 parent d4903a1 commit cb71adf
Showing 1 changed file with 74 additions and 73 deletions.
147 changes: 74 additions & 73 deletions report/report.typ
Original file line number Diff line number Diff line change
Expand Up @@ -1673,6 +1673,7 @@ La gramática mostrada es una referencia para describir la sintaxis de Komodo, p

#{
set text(font: "Noto Mono", size: 9pt)
show raw: set text(size: 9pt)

bnf(
Prod(
Expand Down Expand Up @@ -1709,22 +1710,22 @@ La gramática mostrada es una referencia para describir la sintaxis de Komodo, p
Prod(
[\<Bool\>],
{
Or["true"][]
Or["false"][]
Or[`"true"`][]
Or[`"false"`][]
},
),
Prod(
[\<List\>],
{
Or["\[" \<Expression\> "for" \<Pattern\> "in" \<Expression\> "\]"][]
Or["\[" \<Expression\> "|" \<Expression\> "\]"][]
Or["\[" \<Sequence\> "\]"][]
Or[`"["` \<Expression\> `"for"` \<Pattern\> `"in"` \<Expression\> `"]"`][]
Or[`"["` \<Expression\> `"|"` \<Expression\> `"]"`][]
Or[`"["` \<Sequence\> `"]"`][]
},
),
Prod(
[\<Pattern\>],
{
Or["\_"][]
Or[`"_"`][]
Or[\<Bool\>][]
Or[\<Char\>][]
Or[\<Ident\>][]
Expand All @@ -1740,100 +1741,100 @@ La gramática mostrada es una referencia para describir la sintaxis de Komodo, p
Prod(
[\<ListPattern\>],
{
Or["\[" \<Pattern\> "|" \<Pattern\> "\]"][]
Or["\[" \<SequencePattern\> "\]"][]
Or[`"["` \<Pattern\> `"|"` \<Pattern\> `"]"`][]
Or[`"["` \<SequencePattern\> `"]"`][]
},
),
Prod(
[\<SequencePattern\>],
{
Or[$lambda$][]
Or[\<Pattern\>][]
Or[\<Pattern\> "," \<SequencePattern\>][]
Or[\<Pattern\> `","` \<SequencePattern\>][]
},
),
Prod(
[\<TuplePattern\>],
{
Or["\(" \<SequencePattern\> "\)"][]
Or[`"("` \<SequencePattern\> `")"`][]
},
),
Prod(
[\<SetPattern\>],
{
Or["{" \<Pattern\> "|" \<Pattern\> "}"][]
Or["\{" \<SequencePattern\> "\}"][]
Or[`"{"` \<Pattern\> `"|"` \<Pattern\> `"}"`][]
Or[`"{"` \<SequencePattern\> `"}"`][]
},
),
Prod(
[\<DictPattern\>],
{
Or["\{" \<DictSequencePattern\> "\}"][]
Or[`"{"` \<DictSequencePattern\> `"}"`][]
},
),
Prod(
[\<DictSequencePattern\>],
{
Or[\<Pattern\> "=>" \<Pattern\>][]
Or[\<Pattern\> "=>" \<Pattern\> ","][]
Or[\<Pattern\> "=>" \<Pattern\> "," \<DictSequencePattern\>][]
Or[\<Pattern\> `"=>"` \<Pattern\>][]
Or[\<Pattern\> `"=>"` \<Pattern\> `","`][]
Or[\<Pattern\> `"=>"` \<Pattern\> `","` \<DictSequencePattern\>][]
},
),
Prod(
[\<InfixPattern\>],
{
Or[\<Pattern\> "||" \<Pattern\>][]
Or[\<Pattern\> ":" \<Signature\>][]
Or[\<Pattern\> `"||"` \<Pattern\>][]
Or[\<Pattern\> `":"` \<Signature\>][]
},
),
Prod(
[\<Signature\>],
{
Or[\<Ident\>][]
Or[\<Ident\> "||" \<Signature\>][]
Or[\<Ident\> `"||"` \<Signature\>][]
},
),
Prod(
[\<Sequence\>],
{
Or[$lambda$][]
Or[\<Expression\>][]
Or[\<Expression\> "," \<Sequence\>][]
Or[\<Expression\> `","` \<Sequence\>][]
},
),
Prod(
[\<Tuple\>],
{
Or["(" \<TupleSequence\> ")"][]
Or[`"("` \<TupleSequence\> `")"`][]
},
),
Prod(
[\<TupleSequence\>],
{
Or[$lambda$][]
Or[\<Expression\> "," \<Sequence\>][]
Or[\<Expression\> `","` \<Sequence\>][]
},
),
Prod(
[\<Set\>],
{
Or["\{" \<Expression\> "for" \<Pattern\> "in" \<Expression\> "\}"][]
Or["\{" \<Expression\> "|" \<Expression\> "\}"][]
Or["\{" \<Sequence\> "\}"][]
Or[`"{"` \<Expression\> `"for"` \<Pattern\> `"in"` \<Expression\> `"}"`][]
Or[`"{"` \<Expression\> `"|"` \<Expression\> `"}"`][]
Or[`"{"` \<Sequence\> `"}"`][]
},
),
Prod(
[\<Dict\>],
{
Or["\{" \<DictSequence\> "\}"][]
Or[`"{"` \<DictSequence\> `"}"`][]
},
),
Prod(
[\<DictSequence\>],
{
Or[\<Expression\> "=>" \<Expression\>][]
Or[\<Expression\> "=>" \<Expression\> ","][]
Or[\<Expression\> "=>" \<Expression\> "," \<DictSequence\>][]
Or[\<Expression\> `"=>"` \<Expression\>][]
Or[\<Expression\> `"=>"` \<Expression\> `","`][]
Or[\<Expression\> `"=>"` \<Expression\> `","` \<DictSequence\>][]
},
),
Prod(
Expand All @@ -1845,8 +1846,8 @@ La gramática mostrada es una referencia para describir la sintaxis de Komodo, p
Prod(
[\<Lambda\>],
{
Or[\<Tuple\> "->" \<Block\>][]
Or[\<Ident\> "->" \<Block\>][]
Or[\<Tuple\> `"->"` \<Block\>][]
Or[\<Ident\> `"->"` \<Block\>][]
},
),
Prod(
Expand Down Expand Up @@ -1875,9 +1876,9 @@ La gramática mostrada es una referencia para describir la sintaxis de Komodo, p
Prod(
[\<PrefixOperator\>],
{
Or["~"][]
Or["!"][]
Or["-"][]
Or[`"~"`][]
Or[`"!"`][]
Or[`"-"`][]
}
),
Prod(
Expand All @@ -1889,46 +1890,46 @@ La gramática mostrada es una referencia para describir la sintaxis de Komodo, p
Prod(
[\<InfixOperator\>],
{
Or["in"][]
Or[".."][]
Or["||"][]
Or["&&"][]
Or[">"][]
Or[">="][]
Or["<"][]
Or["<="][]
Or["/="][]
Or["="][]
Or["^"][]
Or["&"][]
Or["<<"][]
Or[">>"][]
Or["-"][]
Or["+"][]
Or["/"][]
Or["%"][]
Or["\*"][]
Or["\*\*"][]
Or[":="][]
Or[`"in"`][]
Or[`".."`][]
Or[`"||"`][]
Or[`"&&"`][]
Or[`">"`][]
Or[`">="`][]
Or[`"<"`][]
Or[`"<="`][]
Or[`"/="`][]
Or[`"="`][]
Or[`"^"`][]
Or[`"&"`][]
Or[`"<<"`][]
Or[`">>"`][]
Or[`"-"`][]
Or[`"+"`][]
Or[`"/"`][]
Or[`"%"`][]
Or[`"*"`][]
Or[`"**"`][]
Or[`":="`][]
},
),
Prod(
[\<Declaration\>],
{
Or["let" \<Pattern\> ":=" \<Block\>][]
Or["let" \<CallPattern\> ":=" \<Block\>][]
Or["let" "memoize" \<CallPattern\> ":=" \<Block\>][]
Or["let" \<Pattern\> ":" \<Ident\>][]
Or["var" \<Pattern\> ":= \<Block\>"][]
Or[`"let"` \<Pattern\> `":="` \<Block\>][]
Or[`"let"` \<CallPattern\> `":="` \<Block\>][]
Or[`"let"` `"memoize"` \<CallPattern\> `":="` \<Block\>][]
Or[`"let"` \<Pattern\> `":"` \<Ident\>][]
Or[`"var"` \<Pattern\> `":= \<Block\>"`][]
},
),
Prod(
[\<Import\>],
{
Or["import" \<ImportSource\>][]
Or["import" \<ImportSource\> "as" \<Ident\>][]
Or["from" \<ImportSource\> "import" \<ImportTarget\>][]
Or["from" \<ImportSource\> "import" \<ImportTargetTuple\>][]
Or[`"import"` \<ImportSource\>][]
Or[`"import"` \<ImportSource\> `"as"` \<Ident\>][]
Or[`"from"` \<ImportSource\> `"import"` \<ImportTarget\>][]
Or[`"from"` \<ImportSource\> `"import"` \<ImportTargetTuple\>][]
},
),
Prod(
Expand All @@ -1941,46 +1942,46 @@ La gramática mostrada es una referencia para describir la sintaxis de Komodo, p
Prod(
[\<ImportTargetTuple\>],
{
Or["(" \<ImportTargetSequence\> ")"][]
Or[`"("` \<ImportTargetSequence\> `")"`][]
},
),
Prod(
[\<ImportTargetSequence\>],
{
Or[\<ImportTarget\>][]
Or[\<ImportTarget\> "," \<ImportTargetSequence\>][]
Or[\<ImportTarget\> `","` \<ImportTargetSequence\>][]
},
),
Prod(
[\<Case\>],
{
Or["case" \<Expression\> "do" \<Indent\> \<CaseBlock\> \<Dedent\>][]
Or[`"case"` \<Expression\> `"do"` \<Indent\> \<CaseBlock\> \<Dedent\>][]
}
),
Prod(
[\<CaseBlock\>],
{
Or[\<Pattern\> "=>" \<Expression\>][]
Or[\<Pattern\> "=>" \<Expression\> \<Newline\>][]
Or[\<Pattern\> "=>" \<Expression\> \<Newline\> \<CaseBlock\>][]
Or[\<Pattern\> `"=>"` \<Expression\>][]
Or[\<Pattern\> `"=>"` \<Expression\> \<Newline\>][]
Or[\<Pattern\> `"=>"` \<Expression\> \<Newline\> \<CaseBlock\>][]
},
),
Prod(
[\<If\>],
{
Or["if" \<Expression\> "then" \<Block\> "else" \<Block\>][]
Or[`"if"` \<Expression\> `"then"` \<Block\> `"else"` \<Block\>][]
},
),
Prod(
[\<For\>],
{
Or["for" \<Pattern\> "in" \<Expression\> "do" \<Block\>][]
Or[`"for"` \<Pattern\> `"in"` \<Expression\> `"do"` \<Block\>][]
},
),
Prod(
[\<Parenthesized\>],
{
Or["(" \<Expression\> ")"][]
Or[`"("` \<Expression\> `")"`][]
},
),
)
Expand Down

0 comments on commit cb71adf

Please sign in to comment.