add parser, fix comments

This commit is contained in:
zongor 2025-06-14 19:05:19 -04:00
parent 447886b037
commit 697b6de2ff
11 changed files with 50 additions and 17 deletions

View File

@ -208,8 +208,7 @@ If you develop a new program, and you want it to be of the greatest possible use
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
ztl-mode
Copyright (C) 2025 zongor
ZRE Copyright (C) 2025 zongor
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

View File

@ -6,10 +6,10 @@
:END:
* Overview
ZRE is a lightweight, portable programming language for permacomputing, game preservation, and indie game development.
Built in **C89** for cross-platform compatibility (desktop, microcontrollers, and web via Emscripten).
Designed for simplicity, performance, and creative exploration.
It is inspired by [[https://wiki.xxiivv.com/site/uxn.html][uxn]], [[http://duskos.org/][Dusk OS]], [[https://doc.cat-v.org/inferno/4th_edition/dis_VM_specification][Dis VM]], [[https://lua.org][Lua]], [[https://en.wikipedia.org/wiki/Lisp_(programming_language)][Lisp]], [[https://en.wikipedia.org/wiki/C_(programming_language)][C]], and [[https://ziglang.org/][Zig]].
- ZRE is a lightweight, portable programming language for permacomputing, game preservation, and indie game development.
- Built in **C89** for cross-platform compatibility (desktop, microcontrollers, and web via Emscripten).
- Designed for simplicity, performance, and creative exploration.
- It is inspired by [[https://wiki.xxiivv.com/site/uxn.html][uxn]], [[http://duskos.org/][Dusk OS]], [[https://doc.cat-v.org/inferno/4th_edition/dis_VM_specification][Dis VM]], [[https://lua.org][Lua]], [[https://en.wikipedia.org/wiki/Lisp_(programming_language)][Lisp]], [[https://en.wikipedia.org/wiki/C_(programming_language)][C]], and [[https://ziglang.org/][Zig]].
* Key Features

View File

@ -225,17 +225,17 @@ also used for letting constants
coerces a type as another type if possible
#+begin_src zre
let «token» = 0; /* default is real */
some_functon(«token» as byte); /* needs an byte */
let «token» = 0; // default is int
some_functon(«token» as real); // needs a real
#+end_src zre
=in=
checks if a object's type, or a type impls another type
checks if a object's type, or a type implements a contract
#+begin_src zre
if («token» in Tunnel) {
print("im tunnel-able");
if («token» in Tunnel, Drawable) {
print("im tunnel-able and draw-able");
}
#+end_src zre

View File

@ -1,4 +1,4 @@
/*
/**
* ZRE - A lightweight, portable programming language for permacomputing.
* Copyright (C) 2025 zongor
*

View File

@ -1,4 +1,4 @@
/*
/**
* ZRE - A lightweight, portable programming language for permacomputing.
* Copyright (C) 2025 zongor
*

View File

@ -1,4 +1,4 @@
/*
/**
* ZRE - A lightweight, portable programming language for permacomputing.
* Copyright (C) 2025 zongor
*

View File

@ -1,4 +1,4 @@
/*
/**
* ZRE - A lightweight, portable programming language for permacomputing.
* Copyright (C) 2025 zongor
*

17
src/parser.c Normal file
View File

@ -0,0 +1,17 @@
/**
* ZRE - A lightweight, portable programming language for permacomputing.
* Copyright (C) 2025 zongor
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

17
src/parser.h Normal file
View File

@ -0,0 +1,17 @@
/**
* ZRE - A lightweight, portable programming language for permacomputing.
* Copyright (C) 2025 zongor
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

View File

@ -1,4 +1,4 @@
/*
/**
* ZRE - A lightweight, portable programming language for permacomputing.
* Copyright (C) 2025 zongor
*

View File

@ -1,4 +1,4 @@
/*
/**
* ZRE - A lightweight, portable programming language for permacomputing.
* Copyright (C) 2025 zongor
*