diff --git a/docs/specification/characters_letters_digits.md b/docs/specification/characters_letters_digits.md index 5e7701d..6d7ac86 100644 --- a/docs/specification/characters_letters_digits.md +++ b/docs/specification/characters_letters_digits.md @@ -1,7 +1,7 @@ -There are a few predefined rules that could not easily be written as valid -EBNF or are used multiple times and therefor defined here to avoid repeating -them. The EBNF rules for the identifiers `unicode_*` are written within -comments as there is no real way to define them otherways. +There are a few predefined rules that could not easily be written as valid EBNF +or are used multiple times and therefor defined here to avoid repeating them. +The EBNF rules for the identifiers `unicode_*` are written within comments as +there is no real way to define them otherways. ```EBNF unicode_any = // any Unicode code point diff --git a/docs/specification/expressions.md b/docs/specification/expressions.md index c83eb16..6a6fdf0 100644 --- a/docs/specification/expressions.md +++ b/docs/specification/expressions.md @@ -1,16 +1,16 @@ -An expression in _Whistle_ evaluates to a value, this could be through either [binary](#binary) or -[unary expressions](#unary), or the special [conditional expression](#conditional). +An expression in _Whistle_ evaluates to a value, this could be through either +[binary](#binary) or [unary expressions](#unary), or the special +[conditional expression](#conditional). -> In the future, once [PR #21](https://github.com/whistle-lang/whistle/pull/21) gets merged, there -> will be a new type of expression: that of the array slice and index accessors. +> In the future, once [PR #21](https://github.com/whistle-lang/whistle/pull/21) +> gets merged, there will be a new type of expression: that of the array slice +> and index accessors. ## Unary A unary expression can be one of two things, either a primary or an operation. - -### Primary - -> TODO, Probably move this to a new file +Due to the complexity and many different types of primary expressions the +specification for them can be found [here](./primary_expressions). ### Operation diff --git a/docs/specification/literals.md b/docs/specification/literals.md index 4df66b3..4469f0e 100644 --- a/docs/specification/literals.md +++ b/docs/specification/literals.md @@ -1,8 +1,8 @@ -Literals are one of the essential parts of any program, they express values and one of the possible -building blocks of an [expression](./expressions). +Literals are one of the essential parts of any program, they express values and +one of the possible building blocks of an [expression](./expressions). -In _Whistle_ there are six literal types: booleans, integers, floats, characters, strings and the -none literal. +In _Whistle_ there are six literal types: booleans, integers, floats, +characters, strings and the none literal. ```EBNF literal = bool_literal @@ -15,7 +15,8 @@ literal = bool_literal ## Booleans -Booleans represent a true or false value, it does this through the keywords `true` and `false`. +Booleans represent a true or false value, it does this through the keywords +`true` and `false`. ```EBNF bool_literal = "true" | "false" @@ -23,10 +24,10 @@ bool_literal = "true" | "false" ## Integers -Integers represent a whole number in either binary, octal, decimal or hexadecimal base. Integer -literals are always positive/unsigned numbers, but this does not mean _Whistle_ only supports -unsigned integers, instead to use signed integers one would use the [negate](./operators#unary) -operator. +Integers represent a whole number in either binary, octal, decimal or +hexadecimal base. Integer literals are always positive/unsigned numbers, but +this does not mean _Whistle_ only supports unsigned integers, instead to use +signed integers one would use the [negate](./operators#unary) operator. ```EBNF int_literal = int_literal_binary @@ -41,10 +42,11 @@ int_literal_hex = "0" , ( "x" | "X" ) , { digit_hex } ## Floating point numbers -The float literal represents an [ieee754](https://en.wikipedia.org/wiki/IEEE_754) floating point -number. This number can contain an optional fractional part and or exponent along with the whole -part. Once again to negate the float literal one would use the [negate](./operators#unary) -operator. +The float literal represents an +[ieee754](https://en.wikipedia.org/wiki/IEEE_754) floating point number. This +number can contain an optional fractional part and or exponent along with the +whole part. Once again to negate the float literal one would use the +[negate](./operators#unary) operator. ```EBNF float_literal = { digit_decimal } , [ float_decimal ] , [ float_exponent ] @@ -54,9 +56,10 @@ float_exponent = ( "e" | "E" ) , [ "+" | "-" ] , { digit_decimal } ## Characters and strings -The character literal represents a single unicode character while a string represents an sequence -of these unicode characters. There are certain escaped values for things like newlines, tabs and -null bytes. These escaped values apply for both the inner values of strings and characters. +The character literal represents a single unicode character while a string +represents an sequence of these unicode characters. There are certain escaped +values for things like newlines, tabs and null bytes. These escaped values apply +for both the inner values of strings and characters. ```EBNF escaped_value = "\" , (""" | "\" | "r" | "n" | "t" | "0" | "'") diff --git a/docs/specification/primary_expressions.md b/docs/specification/primary_expressions.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/toc.json b/docs/toc.json index 8f1887a..142701b 100644 --- a/docs/toc.json +++ b/docs/toc.json @@ -13,7 +13,8 @@ "title": "Characters, letters and digits" }, "literals": { "title": "Literals" }, - "expressions": { "title": "Expressions" } + "expressions": { "title": "Expressions" }, + "primary_expressions": { "title": "Primary Expressions" } } } } diff --git a/www/.vscode/extensions.json b/www/.vscode/extensions.json new file mode 100644 index 0000000..971c0ed --- /dev/null +++ b/www/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [ + "denoland.vscode-deno", + "sastan.twind-intellisense" + ] +} diff --git a/www/.vscode/settings.json b/www/.vscode/settings.json new file mode 100644 index 0000000..6f4f84f --- /dev/null +++ b/www/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "deno.enable": true, + "deno.lint": true, + "editor.defaultFormatter": "denoland.vscode-deno" +} diff --git a/www/README.md b/www/README.md new file mode 100644 index 0000000..f605bd9 --- /dev/null +++ b/www/README.md @@ -0,0 +1,11 @@ +# fresh project + +### Usage + +Start the project: + +``` +deno task start +``` + +This will watch the project directory and restart as necessary. diff --git a/www/client_deps.ts b/www/client_deps.ts index 5063c36..c35111e 100644 --- a/www/client_deps.ts +++ b/www/client_deps.ts @@ -1,7 +1,2 @@ -export * from "https://raw.githubusercontent.com/lucacasonato/fresh/main/runtime.ts"; -import { IS_BROWSER } from "https://raw.githubusercontent.com/lucacasonato/fresh/main/runtime.ts"; -import { apply, setup, tw } from "https://esm.sh/twind@0.16.16"; -export { apply, setup, tw }; -if (IS_BROWSER) { - setup({}); -} +export * from "https://raw.githubusercontent.com/load1n9/whistle_bindgen/main/lib.ts"; +export { default as wabt } from "https://esm.sh/wabt@1.0.28?target=esnext"; diff --git a/www/components/Button.tsx b/www/components/Button.tsx index c71a57f..30fc171 100644 --- a/www/components/Button.tsx +++ b/www/components/Button.tsx @@ -1,13 +1,9 @@ -/** @jsx h */ - -import { h, tw } from "../client_deps.ts"; - -export function RoundedButton(props: h.JSX.HTMLAttributes) { +// deno-lint-ignore no-explicit-any +export function RoundedButton(props: any) { return (