about summary refs log tree commit diff stats
path: root/linux/browse
Commit message (Collapse)AuthorAgeFilesLines
* rename grapheme to code-point-utf8Kartik K. Agaram2021-11-092-108/+108
| | | | | | Longer name, but it doesn't lie. We have no data structure right now for combining multiple code points. And it makes no sense for the notion of a grapheme to conflate its Unicode encoding.
* 7846Kartik K. Agaram2021-03-041-1/+2
|
* 7842 - new directory organizationKartik K. Agaram2021-03-034-0/+1078
Baremetal is now the default build target and therefore has its sources at the top-level. Baremetal programs build using the phase-2 Mu toolchain that requires a Linux kernel. This phase-2 codebase which used to be at the top-level is now under the linux/ directory. Finally, the phase-2 toolchain, while self-hosting, has a way to bootstrap from a C implementation, which is now stored in linux/bootstrap. The bootstrap C implementation uses some literate programming tools that are now in linux/bootstrap/tools. So the whole thing has gotten inverted. Each directory should build one artifact and include the main sources (along with standard library). Tools used for building it are relegated to sub-directories, even though those tools are often useful in their own right, and have had lots of interesting programs written using them. A couple of things have gotten dropped in this process: - I had old ways to run on just a Linux kernel, or with a Soso kernel. No more. - I had some old tooling for running a single test at the cursor. I haven't used that lately. Maybe I'll bring it back one day. The reorg isn't done yet. Still to do: - redo documentation everywhere. All the README files, all other markdown, particularly vocabulary.md. - clean up how-to-run comments at the start of programs everywhere - rethink what to do with the html/ directory. Do we even want to keep supporting it? In spite of these shortcomings, all the scripts at the top-level, linux/ and linux/bootstrap are working. The names of the scripts also feel reasonable. This is a good milestone to take stock at.
; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/* Test file for minus operator spacing functionality */
/* This tests the new spacing-based ambiguity resolution for minus operator */

..out "=== Minus Operator Spacing Tests ===";

/* Basic unary minus tests */
test1 : -5;
test2 : -3.14;
test3 : -10;
test4 : -42;

/* Basic binary minus tests */
test5 : 5 - 3;
test6 : 10 - 5;
test7 : 15 - 7;
test8 : 10 - 2.5;

/* Legacy syntax tests (should continue to work) */
test9 : (-5);
test10 : (-3.14);
test11 : (-10);
test12 : 5-3;
test13 : 15-7;

/* Complex negative expressions */
test14 : -10 - -100;
test15 : -5 - -3;
test16 : -20 - -30;

/* Assertions to validate behavior */
..assert test1 = -5;           /* Unary minus: -5 */
..assert test2 = -3.14;        /* Unary minus: -3.14 */
..assert test3 = -10;          /* Unary minus: -10 */
..assert test4 = -42;          /* Unary minus: -42 */

..assert test5 = 2;            /* Binary minus: 5 - 3 = 2 */
..assert test6 = 5;            /* Binary minus: 10 - 5 = 5 */
..assert test7 = 8;            /* Binary minus: 15 - 7 = 8 */
..assert test8 = 7.5;          /* Binary minus: 10 - 2.5 = 7.5 */

..assert test9 = -5;           /* Legacy: (-5) = -5 */
..assert test10 = -3.14;       /* Legacy: (-3.14) = -3.14 */
..assert test11 = -10;         /* Legacy: (-10) = -10 */
..assert test12 = 2;           /* Legacy: 5-3 = 2 */
..assert test13 = 8;           /* Legacy: 15-7 = 8 */

..assert test14 = 90;          /* Complex: -10 - -100 = 90 */
..assert test15 = -2;          /* Complex: -5 - -3 = -2 */
..assert test16 = 10;          /* Complex: -20 - -30 = 10 */

..out "=== Basic Minus Operator Spacing Tests Passed ===";