Commit graph

915 commits

Author SHA1 Message Date
Norayr Chilingarian
c18945bc70 starting work on dynamically loaded modules and shell 2026-10-09 03:13:59 +04:00
Norayr Chilingarian
531bfe168b fixing Math, MathL and the ooc real math
sincos took cos as sqrt(1 - sin*sin): its sign was lost and it was
0 near pi/2 (tan(pi/2) gave large, tan(-pi) the wrong sign); REAL tan
and sin/cos reduced in LONGREAL with REAL pi and pi/2; REAL arcsin and
arccos returned their unadjusted value after any earlier error
(err stays set). in oocLowReal, scale, intpart, trunc and round
treated a REAL as a 64 bit SET (RealMath.sqrt(2) was about 1E9); now
with Reals.SetExpo and ENTIER. LowReal.small and LowLReal.small are
the exact constants again. the math test expects the right values.
2026-10-06 20:14:42 +04:00
Norayr Chilingarian
e69f33a0cd converting and writing real constants exactly
the scanner built a decimal constant digit by digit, rounding at
each step (1.1D3 was not 1100), and the code generator wrote reals
with 15 digits, so very small values came out as 0 (LowReal.small,
LowLReal.small, MathL's miny). now the scanner converts with strtod
and strtof, a constant is out of range only when its value is, and
reals are written with 17 significant digits, which read back as the
same double. MAX(REAL) and MAX(LONGREAL) are set from their bits
(MAX(LONGREAL) was 1.79769296342094D308).
2026-10-06 20:14:42 +04:00
Norayr Chilingarian
d6d99b4fbe fixing Out.Real and Out.LongReal: the exponent missed the rounding carry
the exponent digits were written before the mantissa was rounded, so
a carry into the next power of ten was lost: 0.99999999999999989
came out as 1.0D-001, and Math.sqrt(1.0) as 1.00000E-01.
2026-10-06 20:14:31 +04:00
Norayr Chilingarian
9701249ad2 adding ulm unix file and terminal streams. 2026-09-25 19:05:52 +04:00
Norayr Chilingarian
fcf59d5d93 connecting ulm standard streams to platform. 2026-09-21 15:22:53 +04:00
Norayr Chilingarian
552eade09d oocProgramArgs compatibility library. two examples. 2026-09-18 04:19:37 +04:00
Norayr Chilingarian
575ea5c236 Platform.SetFileMtime and oocFiles.SetModTime. 2026-09-18 01:46:06 +04:00
Norayr Chilingarian
0decbe950e adding LDFLAGS and LDLIBS environment variable processing. 2026-09-17 20:44:14 +04:00
Norayr Chilingarian
e661d17436 ported oocFiles compatibility library. 2026-09-17 20:43:01 +04:00
Norayr Chilingarian
c0fb40fb69 standardizing installation paths and default build. 2026-09-17 01:56:54 +04:00
Norayr Chilingarian
c985dcb3e4 ocat: fixing missing last line by flushing output after each file
console module only flushes its internal buffer on lf or when full.
files without a trailing newline silently lost their last line on exit.
switching to out module and calling out.flush after processing each file
guarantees all buffered output is written.
2026-08-01 00:28:29 +04:00
Norayr Chilingarian
4dd3c395fe adding big-endian support across compiler, runtime, and library modules
- adding Platform.LittleEndian to centralize endianness detection
- using SYSTEM.GET with correct byte offset for HUGEINT to smaller type reads on big-endian
- fixing Reals.BytesToHex iteration direction and InitEndian for big-endian
- fixing oocLowReal fraction, IsInfinity, IsNaN using Reals.Expo/SetExpo
- fixing Math.ToREAL and MathL.exponent for big-endian
- fixing In.Int and In.LongInt for big-endian
- fixing outtest.wh byte iteration direction for big-endian
- regenerating all bootstrap C sources
- tested on ppc32
2026-07-12 18:17:58 +04:00
Norayr Chilingarian
93c0198f18 bootstrap c sources. 2026-07-10 04:05:39 +04:00
Norayr Chilingarian
49f9e55630 fixing SYSTEM.ADDRESS cross-module parameter type mismatch
assigning adrtyp a dedicated symbol file back-reference tag (Sadr=12)
so it round-trips through symbol files as adrtyp rather than deserializing
as int32typ/int64typ, preventing false err(115) when passing procedures
with SYSTEM.ADDRESS parameters across module boundaries.
2026-07-10 04:02:57 +04:00
Norayr Chilingarian
63ec99e0bc implementing read-only value parameters using the '-' marker (oakwood guidelines 5.13)
declaring a parameter as 'name-: TYPE' passes it by reference for
efficiency but prevents assignment within the procedure body.
per xds oberon-2 documentation, '-' is a modifier on value parameters
only; combining it with VAR is an error (246).

adding 'readOnlyPar = 3' to the vis field constants on OPT.Object.
setting node^.readonly in OPB.Ident for VarPar nodes whose object
has vis = readOnlyPar, which causes OPB.Assign to emit err(76) on
any attempt to write the parameter or its components.

relaxing OPB.Param to allow passing a read-only variable as an
actual argument to a read-only formal (previously blocked by err(76)
because VarPar checked ap^.readonly unconditionally).

adding Srpar = 42 symbol file tag so that read-only parameters
survive across module boundaries: OutSign writes Srpar and InSign
reconstructs the mode and vis correctly when importing.

code generation in OPV is unchanged; read-only parameters produce
the same C as VAR parameters since the restriction is purely semantic.
2026-07-10 01:06:47 +04:00
Norayr Chilingarian
0db5141423 fixing two incompatible pointer type warnings from gcc
passing a 2d static array to an open array parameter generated no
(void*) cast, because the condition only checked for VarPar mode.
adding a check for whether the formal element type is composite
(typ^.BaseTyp^.form = OPT.Comp) catches the pointer-indirection
mismatch for nested arrays, matching the fix in ofrontplus fe43645.

assigning a pointer-to-extension to a pointer-to-base failed to
cast when the pointer type was anonymous (strobj = NIL). falling
back to casting through the base type's strobj when the pointer
type itself has no name, matching the fix in ofrontplus 69e7660.

fixes issue #105.
2026-07-09 23:50:22 +04:00
Norayr Chilingarian
f6f4c904fa fixing os name parsing from /etc/os-release for single-quoted values
gentoo (and possibly others) write ID='gentoo' with single quotes in
/etc/os-release. ParseOsRelease was only stripping double quotes and
using ascii comparison to find the end of the value, which caused
single quotes to be embedded in the os string, producing invalid oberon
like os* = ''gentoo''.

stripping both quote styles at start and stopping at either kind at end.
works for unquoted values (raspbian, devuan) and double-quoted values too.
2026-07-09 23:20:02 +04:00
Norayr Chilingarian
851aadcaf4 fixing compiler crash on dynamic array to static array assignment
the crash was introduced in aed9134e: when the rhs of an array assignment
is a pointer-dereferenced dynamic array (e.g. s^), the rhs node has no
named obj, so obj is nil. the dynArr branch in OPV was calling OPC.Len
which dereferences obj immediately, causing a segfault in the compiler.

OPV already has a Len() procedure that handles Nderef nodes by generating
ptr->len[dim] instead of relying on a named obj. switching to that call
fixes the crash and generates correct bounds-checked C code.

removing the err(113) workaround in OPB.CheckAssign that was suppressing
the crash by rejecting valid oberon-07 assignments.

fixes issue #55.
2026-07-09 23:16:59 +04:00
Norayr Chilingarian
7ffdb0859b fixed bug in function description(comment). 2026-05-06 20:28:02 +04:00
Norayr Chilingarian
65baeb77a9
Merge pull request #113 from robdaemon/fix-gcc-15
Fixes build problems on gcc 15
2026-02-04 12:51:31 +04:00
Robert Roland
9fce469f23 Fixes build problems on gcc 15
GCC 15 changes the C language standard to gnu23, and VOC compiles just fine on gnu11.

Tested against GCC 15 and GCC 14.
2026-02-03 17:43:38 -08:00
Norayr Chilingarian
84516b2ac6 prevents orphaned or misplaced comments from being written to symbol
files.
2025-07-19 05:56:37 +04:00
Norayr Chilingarian
a517a42357 comments length increased, multiline comments are also now possible. 2025-07-19 05:48:27 +04:00
Norayr Chilingarian
50b5a1438e better handling of faulty symbol files. ethStrings comments fixed. 2025-07-19 05:13:09 +04:00
Norayr Chilingarian
fa9e73f7af adapted Base64 file from Oberon S3. 2025-07-10 23:08:59 +04:00
Norayr Chilingarian
a9465ccfc6 bootstrap sources. 2025-06-24 18:27:35 +04:00
Norayr Chilingarian
dac6504f12 comments in symbol files, viewable by showdef browser. 2025-06-24 17:44:19 +04:00
Norayr Chilingarian
2f1ce08aff should fix type-bound procedure name mismatch between calls and definitions 2025-06-14 17:12:48 +04:00
Carlos Une
28c327be28 Math, MathL: add procedure fcmp 2025-05-08 15:48:46 +04:00
Norayr Chilingarian
94683df1d8
Merge pull request #111 from InnaKhachikyan/master
modified Index checking to handle run-time variable index containing …
2025-04-23 02:46:44 +04:00
Inna Khachikyan
f0e92c7434 modified Index checking to handle run-time variable index containing negative value 2025-04-17 23:44:56 +04:00
Norayr Chilingarian
71488ffe85
Merge pull request #110 from rbmk-plus/master
add ctags, fix dead links, and other minor fixes
2025-04-04 18:13:57 +00:00
sevoves
378de43274 rewording doc/ctags.md 2025-04-04 22:00:31 +04:00
sevoves
1fbbb68dc7 rewording ctags doc 2025-04-04 21:56:16 +04:00
sevoves
9846292b85 minor changes in docs 2025-04-04 21:51:30 +04:00
sevoves
bb7a731197 small change in ctags.md 2025-04-04 21:44:46 +04:00
sevoves
7dafb02d1e add ctags doc 2025-04-04 21:40:59 +04:00
sevoves
5e52f8c231 add ctags doc and remove comments from oberon.ctags 2025-04-04 21:39:45 +04:00
sevoves
e298d10d99 rewording in configure.c 2025-04-04 15:43:44 +04:00
sevoves
3460b9f78a create macros for ignoring flood warnings 2025-04-04 15:37:41 +04:00
sevoves
089ca94207 remove scope pop in ctag since file is the scope 2025-04-04 00:38:41 +04:00
sevoves
b12029e3ed remove warning floods for MinGW compiler 2025-04-03 22:26:20 +04:00
sevoves
cd06cd32b1 ignore common warnings in gcc and clang 2025-04-03 22:09:20 +04:00
sevoves
7691293a5b replace egrep with grep -E for less warnings 2025-04-03 21:05:42 +04:00
sevoves
d005317424 address more caveats in oberon.ctags 2025-04-03 20:57:00 +04:00
sevoves
a25b44ae21 exclude all confidence test files without extension except expect 2025-04-03 20:38:12 +04:00
sevoves
e64d4c4d44 add test binaries to .gitignore 2025-04-03 20:14:24 +04:00
sevoves
ac82959092 add stuff to .gitignore 2025-04-03 20:05:37 +04:00
sevoves
cb098d448d update deaed links in ReadMe 2025-04-03 19:20:01 +04:00