[examples] rearrange; add hello_world.mdesk example file

This commit is contained in:
Allen Webster
2021-09-10 15:54:39 -07:00
parent 39b30d9276
commit ba372c135f
7 changed files with 34 additions and 8 deletions
+5 -3
View File
@@ -9,9 +9,11 @@ cd ..
echo "~~~ Build All Exampes ~~~" echo "~~~ Build All Exampes ~~~"
bin/bld_core.sh show_ctx bin/bld_core.sh show_ctx
bin/bld_core.sh unit datadesk_like examples/datadesk_like_template.c metasrc="examples/metaprograms"
bin/bld_core.sh unit node_errors examples/node_errors/node_errors.c
bin/bld_core.sh unit parse_check examples/parse_check.c bin/bld_core.sh unit datadesk_like $metasrc/datadesk_like_template.c
bin/bld_core.sh unit node_errors $metasrc/node_errors.c
bin/bld_core.sh unit parse_check $metasrc/parse_check.c
echo echo
+22
View File
@@ -0,0 +1,22 @@
/* the hello world file */
hello world!
"hello world!"
// sets
(hello world!)
[hello world!]
{hello world!}
// sets with labels
hello: world!
hello: (world!)
// tags
@exclaim "hello world"
@message
{
@recipient world
@contents hello
@punctuate !
}
@@ -66,7 +66,7 @@ int main(int argument_count, char **arguments)
// can easily check the severity of a entire parse by looking at the // can easily check the severity of a entire parse by looking at the
// `max_message_kind` field on the errors from the parse result. Here // `max_message_kind` field on the errors from the parse result. Here
// only push the parse result onto our list if there were no errors. // only push the parse result onto our list if there were no errors.
if (parse_result.errors.max_message_kind >= MD_MessageKind_Error) if (parse_result.errors.max_message_kind < MD_MessageKind_Error)
{ {
MD_PushNewReference(arena, list, parse_result.node); MD_PushNewReference(arena, list, parse_result.node);
} }
+3 -1
View File
@@ -18,7 +18,9 @@ Example Programs:
[ ] Example multi-threaded parsing [ ] Example multi-threaded parsing
Example Metadesk Files: Example Metadesk Files:
[ ] Hello world [x] Hello world
[ ] identifiers, numbers, strings, and symbols
[ ] sets, seperators, labels, and tags
Allen's Final Tweak Notes (September 10th 2021): Allen's Final Tweak Notes (September 10th 2021):