Skip to content

Commit

Permalink
Add syntax configurations for relational operators.
Browse files Browse the repository at this point in the history
The following configurations were added:

    code:cmp_eq
    code:cmp_ne
    code:cmp_lt
    code:cmp_gt
    code:cmp_le
    code:cmp_ge
  • Loading branch information
skvadrik committed Jul 28, 2024
1 parent 7fd5ec6 commit c76135c
Show file tree
Hide file tree
Showing 33 changed files with 2,546 additions and 2,228 deletions.
7 changes: 7 additions & 0 deletions bootstrap/src/default_syntax_c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ const char* DEFAULT_SYNTAX_C =
"\n"
"code:assign = topindent lhs \" = \" rhs \";\" nl;\n"
"\n"
"code:cmp_eq = \"==\";\n"
"code:cmp_ne = \"!=\";\n"
"code:cmp_lt = \"<\";\n"
"code:cmp_gt = \">\";\n"
"code:cmp_le = \"<=\";\n"
"code:cmp_ge = \">=\";\n"
"\n"
"code:if_then_else =\n"
" [branch{0}: topindent \"if (\" cond \") {\" nl\n"
" indent [stmt: stmt] dedent]\n"
Expand Down
7 changes: 7 additions & 0 deletions bootstrap/src/default_syntax_d.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ const char* DEFAULT_SYNTAX_D =
"\n"
"code:assign = topindent lhs \" = \" rhs \";\" nl;\n"
"\n"
"code:cmp_eq = \"==\";\n"
"code:cmp_ne = \"!=\";\n"
"code:cmp_lt = \"<\";\n"
"code:cmp_gt = \">\";\n"
"code:cmp_le = \"<=\";\n"
"code:cmp_ge = \">=\";\n"
"\n"
"code:if_then_else =\n"
" [branch{0}: topindent \"if (\" cond \") {\" nl\n"
" indent [stmt: stmt] dedent]\n"
Expand Down
7 changes: 7 additions & 0 deletions bootstrap/src/default_syntax_go.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ const char* DEFAULT_SYNTAX_GO =
"\n"
"code:assign = topindent lhs \" = \" rhs nl;\n"
"\n"
"code:cmp_eq = \"==\";\n"
"code:cmp_ne = \"!=\";\n"
"code:cmp_lt = \"<\";\n"
"code:cmp_gt = \">\";\n"
"code:cmp_le = \"<=\";\n"
"code:cmp_ge = \">=\";\n"
"\n"
"code:if_then_else =\n"
" [branch{0}: topindent \"if (\" cond \") {\" nl\n"
" indent [stmt: stmt] dedent]\n"
Expand Down
7 changes: 7 additions & 0 deletions bootstrap/src/default_syntax_haskell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ const char* DEFAULT_SYNTAX_HASKELL =
"\n"
"// code:assign\n"
"\n"
"code:cmp_eq = \"==\";\n"
"code:cmp_ne = \"/=\";\n"
"code:cmp_lt = \"<\";\n"
"code:cmp_gt = \">\";\n"
"code:cmp_le = \"<=\";\n"
"code:cmp_ge = \">=\";\n"
"\n"
"code:if_then_else =\n"
" [branch{0}: topindent (many ? \"if \" cond \" then\" : \"when (\" cond \") $\") (monadic ? \" do\") nl\n"
" indent [stmt: stmt] dedent]\n"
Expand Down
7 changes: 7 additions & 0 deletions bootstrap/src/default_syntax_java.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ const char* DEFAULT_SYNTAX_JAVA =
"\n"
"code:assign = topindent lhs \" = \" rhs \";\" nl;\n"
"\n"
"code:cmp_eq = \"==\";\n"
"code:cmp_ne = \"!=\";\n"
"code:cmp_lt = \"<\";\n"
"code:cmp_gt = \">\";\n"
"code:cmp_le = \"<=\";\n"
"code:cmp_ge = \">=\";\n"
"\n"
"code:if_then_else =\n"
" [branch{0}: topindent \"if (\" cond \") {\" nl\n"
" indent [stmt: stmt] dedent]\n"
Expand Down
7 changes: 7 additions & 0 deletions bootstrap/src/default_syntax_js.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ const char* DEFAULT_SYNTAX_JS =
"\n"
"code:assign = topindent lhs \" = \" rhs nl;\n"
"\n"
"code:cmp_eq = \"===\";\n"
"code:cmp_ne = \"!==\";\n"
"code:cmp_lt = \"<\";\n"
"code:cmp_gt = \">\";\n"
"code:cmp_le = \"<=\";\n"
"code:cmp_ge = \">=\";\n"
"\n"
"code:if_then_else =\n"
" [branch{0}: topindent \"if (\" cond \") {\" nl\n"
" indent [stmt: stmt] dedent]\n"
Expand Down
7 changes: 7 additions & 0 deletions bootstrap/src/default_syntax_ocaml.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ const char* DEFAULT_SYNTAX_OCAML =
"\n"
"code:assign = topindent lhs \" <- \" rhs \";\" nl;\n"
"\n"
"code:cmp_eq = \"==\"; // physical equality, as this is used to compare primitive values\n"
"code:cmp_ne = \"!=\"; // physical inequality, as this is used to compare primitive values\n"
"code:cmp_lt = \"<\";\n"
"code:cmp_gt = \">\";\n"
"code:cmp_le = \"<=\";\n"
"code:cmp_ge = \">=\";\n"
"\n"
"code:if_then_else =\n"
" [branch{0}: topindent \"if (\" cond \") then (\" nl\n"
" indent [stmt: stmt] dedent]\n"
Expand Down
7 changes: 7 additions & 0 deletions bootstrap/src/default_syntax_python.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ const char* DEFAULT_SYNTAX_PYTHON =
"\n"
"code:assign = topindent lhs \" = \" rhs nl;\n"
"\n"
"code:cmp_eq = \"==\";\n"
"code:cmp_ne = \"!=\";\n"
"code:cmp_lt = \"<\";\n"
"code:cmp_gt = \">\";\n"
"code:cmp_le = \"<=\";\n"
"code:cmp_ge = \">=\";\n"
"\n"
"code:if_then_else =\n"
" [branch{0}: topindent \"if \" cond \":\" nl\n"
" indent [stmt: stmt] dedent]\n"
Expand Down
7 changes: 7 additions & 0 deletions bootstrap/src/default_syntax_rust.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ const char* DEFAULT_SYNTAX_RUST =
"\n"
"code:assign = topindent lhs \" = \" rhs \";\" nl;\n"
"\n"
"code:cmp_eq = \"==\";\n"
"code:cmp_ne = \"!=\";\n"
"code:cmp_lt = \"<\";\n"
"code:cmp_gt = \">\";\n"
"code:cmp_le = \"<=\";\n"
"code:cmp_ge = \">=\";\n"
"\n"
"code:if_then_else =\n"
" [branch{0}: topindent \"if \" cond \" {\" nl\n"
" indent [stmt: stmt] dedent]\n"
Expand Down
7 changes: 7 additions & 0 deletions bootstrap/src/default_syntax_v.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ const char* DEFAULT_SYNTAX_V =
"\n"
"code:assign = topindent lhs \" = \" rhs nl;\n"
"\n"
"code:cmp_eq = \"==\";\n"
"code:cmp_ne = \"!=\";\n"
"code:cmp_lt = \"<\";\n"
"code:cmp_gt = \">\";\n"
"code:cmp_le = \"<=\";\n"
"code:cmp_ge = \">=\";\n"
"\n"
"code:if_then_else =\n"
" [branch{0}: topindent \"if \" cond \" {\" nl\n"
" indent [stmt: stmt] dedent]\n"
Expand Down
7 changes: 7 additions & 0 deletions bootstrap/src/default_syntax_zig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ const char* DEFAULT_SYNTAX_ZIG =
"\n"
"code:assign = topindent lhs \" = \" rhs \";\" nl;\n"
"\n"
"code:cmp_eq = \"==\";\n"
"code:cmp_ne = \"!=\";\n"
"code:cmp_lt = \"<\";\n"
"code:cmp_gt = \">\";\n"
"code:cmp_le = \"<=\";\n"
"code:cmp_ge = \">=\";\n"
"\n"
"code:if_then_else =\n"
" [branch{0}: topindent \"if (\" cond \") {\" nl\n"
" indent [stmt: stmt] dedent]\n"
Expand Down
Loading

0 comments on commit c76135c

Please sign in to comment.