1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-06-29 10:30:36 +00:00
Commit graph

1229 commits

Author SHA1 Message Date
Matthew Kilgore 335ff451bc Fix 'Bit * n' syntax in some cases.
There's some logic for handling `Bit * n` types that doesn't properly
handle NoPrefix. There's both a faulty error check which only works for
the `_` version (It was using `OR` so it always failed), and then also
the code that pulls out the number only works if the `_` is present.
Both of those are fixed in this commit.
2022-10-01 14:18:53 -04:00
Matthew Kilgore 855b8dfce7 Fix declare Static array as 'String * n'
The original issue comes from b87dde8. Fellippe was fixing using
NoPrefix types with Declare Library, which uses some of the same logic
as Static arrays. Unfortunately, his change broke the `String *n` syntax
and `Bit * n` syntax because he stopped using LEFT$() to check only the
prefix of the type. Cory fixed the issue over in QB64Official/qb64#35
by reverting the code to use LEFT$() again and I pulled some of that
logic in here.

Note that I've modified his solution a bit. During testing of that fix I
noticed that `_Unsigned Integer64` no longer worked, because is because
it aliases with `_Unsigned Integer` and the shorter type gets checked
first. This may have been what Fellippe was trying to fix (since
removing the LEFT$() avoids this issue) but it's hard to say.

I addressed that issue by only applying $LEFT() to the two types that
are allowed to have text after them (`Bit` and `String`). The rest of
the types continue to use the direct string comparison that requires an
exact match. Additionally I reorganized the checks a bit to make them
easier to read and also easier to confirm all combinations are checked.
2022-10-01 14:18:53 -04:00
Matthew Kilgore 21b7d60f44 Fix -o to be relative to _STARTDIR$ when source file is
In 094a8c82 we added the ability to compile a source file relative to
_STARTDIR$ instead of the location of the qb64pe executable. This change
fixes `-o` so that it is also treated as relative to _STARTDIR$ when the
provided source file is.

Note that this is not a real behavior change because if the provided
source file is relative to the qb64pe executable then `-o` will be as
well, which matches the previous behavior. The cases where it is made
relative to _STARTDIR$ all produced errors until 094a8c82 was done, so
there was no previous defined behavior.
2022-10-01 04:24:54 -04:00
Matthew Kilgore 094a8c82b2 Fix compiling bas files relative to the CWD
Fix was pulled from QB64Official/qb64#17 by Cory Smith, I just added
tests around it.

Most (all?) compilers allow you to run the compiler from a separate
directory than the compiler itself is located in and compile source
files relative to that directory. QB64-PE however does not allow that,
for a variety of reasons it always search for the provided source file
relative to the location of the QB64-PE compiler rather than the CWD it
was run from. This is pretty unexpected behavior in a lot of cases, and
also doesn't give very helpful error messages either.

This change has us check if the source file exists at the given CWD
location, and if it does we will prepend the CWD to produce the correct
path to the file.

To test that this behavior works as expected I modified
`compile_test.sh` to compile from within the test directories using a
relative path directly to the test file, this fails with current QB64-PE
versions because it can't find the source file.

Additionally, I was unsure of whether this would impact the behavior of
`'$include`, so I added some tests around include that uses various
combinations of paths relative to QB64-PE and relative to the source
file being compiled, and they all find the files as expected so I think
it's fine.
2022-09-30 17:13:43 -04:00
Matthew Kilgore 59dd8d3c51 Fix undefined variables in CONST expressions to trigger an error
Overall this is fairly straight forward, `evaluateconst$` has type
information on the parameters for its expressions, but it's not actually
checking that both parameters have a proper type. The result is that
expressions with nonsense values such as undefined variable names end up
just trying to use that nonsense value as an integer.

Fixes: #177
2022-09-26 02:47:08 -04:00
Matthew Kilgore 47682e91c3 Fix _BLUE in CONST
_BLUE is one of the few functions that requires multiple parameters, but
it was not included in the list of functions that require them. The
result is that gets get parsed incorrectly and _BLUE did not work.
Adding it to the check of functions that accept multiple parameters
allows it to work as expected.

Fixes: #195
2022-09-26 02:46:37 -04:00
Matthew Kilgore 53dc4e0467 Fix using _RGBA in CONST
Fairly simple, the order of functions meant that `_RGBA` got picked up
as `_RGB` instead, with the `A` then considered invalid syntax. Fixing
the order allows `_RGBA` to work as expected.

Fixes: #194
2022-09-26 02:46:37 -04:00
Matthew Kilgore 191db3fb57 Version 3.2.1 2022-09-24 12:17:36 -04:00
Matthew Kilgore 581460abbc Remove unused variables 2022-09-17 03:06:24 -04:00
Matthew Kilgore 443838485e Version 3.2.0 2022-09-11 11:50:16 -04:00
Matthew Kilgore cebcb11646 Fix compiling source files with single quotes in name
Using single quotes in a file name wasn't working because the Makefile
was using single quotes itself to quote the filename when providing it
to the compiler. The Makefile was switched to use double quotes instead,
which work just as well but are allowed to contain single quotes inside
of them.

Since double quotes are a legal character to have in a file name on
Linux and Mac OS, I added extra logic to start escaping double quote
characters.

I added a test to verify that we can compile source files with single
quotes in the name. I could not add a test for double quotes since such
files cannot exist on Windows and thsu cannot easily be added to the
repository.
2022-09-09 09:59:43 -04:00
Matthew Kilgore d928e5d8ba Add command line switches for compiler settings
This adds compiler settings for each of the settings in the
'Compiler Settings' IDE dialog. This makes it easy to supply the
settings per compile without needing to use the IDE to change them (or
edit the `config.ini`).

Fixes: #162
2022-09-04 23:35:14 -04:00
Matthew Kilgore b301e2acf5 Fix chmod +x when filename has spaces
We were missing some quotes in the command line strings, so if there
were spaces involved `chmod +x` would not work correctly.
2022-09-04 23:35:14 -04:00
Matthew Kilgore 2b3403745c Add initial MIDI language support
This adds MIDI support to the language as a new unstable feature. There
are two new metacommands that come with this:

$Unstable: Midi
$MidiSoundFont: [Default|"filename"]

The $Unstable command is required to be able to use any of the other
commands, and just signifies that this is not a full part of the
language yet and may change in breaking ways before the API is
finalized.

The $MidiSoundFont command enables MIDI support in the compiled program,
and also specifies what sound font to use to play MIDI files. "Default"
will make use of the soundfont placed at
'./internal/support/default_soundfont.sf2', and otherwise a filename can
be specified to use any soundfont wanted.

In either case, the selected sound font is compiled into the executable
and then loaded at runtime.

Fixes: #115
2022-09-04 23:35:14 -04:00
Matthew Kilgore fcc1444910 Version v3.1.0 2022-09-03 14:31:30 -04:00
Samuel Gomes a2cd317d6a Change SHR & SHL to camel case per discussion in https://github.com/QB64-Phoenix-Edition/QB64pe/pull/153 2022-09-01 21:39:30 +05:30
Samuel Gomes 028017b21a Change ROL and ROR names to Camel case per discission in https://github.com/QB64-Phoenix-Edition/QB64pe/pull/153 2022-09-01 21:30:23 +05:30
Samuel Gomes f99eb27717 Remove all _SHR & _SHL changes 2022-09-01 16:15:42 +05:30
Samuel Gomes 2ed17f6198 Add _ROR & _ROL support. Fix issues with _SHR & _SHL 2022-09-01 06:51:06 +05:30
Matthew Kilgore 333bc6231d Allow selecting audio backend in IDE
This change allows selecting the audio backend to use in your compiler
programs. The selection can be made via the 'Compiler Settings' dialog
in the IDE (renamed from the 'C++ Compiler Settings' dialog).

The new miniaudio backend is the default, a checkbox for "Use old audio
backend" exists in the IDE for switching back to the old backend (in the
event someone runs into compatibility issues or etc.). Eventually we'll
drop the old one.
2022-08-27 14:27:55 -04:00
Roland Heyder 2b967dc124 Update version.bas 2022-08-26 15:05:07 +02:00
Roland Heyder b7f2bb7199 Fixing sizing logic
- unveiled by MacOSX (Actions failure)
2022-08-25 02:58:50 +02:00
Roland Heyder 51667125c9 Avoid excessive disk access while typing
- No longer constantly (over)writes files in the `internal\temp` folder while typing in the IDE, as the generated C/C++ code is buffered internally now.
- Buffers are automatically written out to disk on a `Make` request (F5/F11).
2022-08-25 01:14:29 +02:00
Roland Heyder 46790c420f Step 22: There's always something else
- also removed changelog.md from make_dist.sh
- make `curl` really quiet with >NUL, --silent does suppress the progress display only
2022-08-19 00:26:13 +02:00
Roland Heyder b63478b602 Step 21: Finalize this PR for merge
- reset .gitignore to disallow any internal\help uploads again (folder is created during build now)
- get rid of old changelog (changes can better be summarized at release pages)
- added a change by @dkearns from the old QB64Team repository (comment highlighting after `REM`)
2022-08-18 23:41:13 +02:00
Roland Heyder 9c5664e788 Step 18: I'll KILL that damn Cat !! 2022-08-14 18:25:02 +02:00
Roland Heyder 312a24fea2 Step 17: All done !!!
Final adjustments in Wiki stuff.
2022-08-14 15:54:55 +02:00
Roland Heyder bee9f10bfd Step 16: More fixes
- the pure fact we're running the qb64pe executable causes creation of file tempfoldersearch.bin on LNX/OSX only, which must be deleted after run (this caused LNX/OSX checks to fail)
- Wiki parser: added $ to the list of critical file name chars (LNX/OSX doesn't like those)
2022-08-13 10:54:32 +02:00
Roland Heyder a402ae4429 Step 14: So all good things are three
- also switched curl to silent mode to shorten build logs
2022-08-13 02:44:11 +02:00
Roland Heyder 14f2cd29e0 Step 13: Fixing build errors 2022-08-13 01:58:16 +02:00
Roland Heyder 756eb6ac68 Step 12: Implement automatic help file update
- changes to update code (ignore static _GL pages as mentioned at Discord https://discord.com/channels/975381912350752819/975389657212805160/1007683254792507412 )
- dist script changes
- update internal/help to contain static _GL pages only
2022-08-12 22:54:59 +02:00
Roland Heyder 2ec897b75d Step 10: Update remaining stuff
- checks all remaining occurrences of the term 'qb64', some remain untouched, some are renamed according to context
- also added new logo for README.md
- this step does finalize the 'Phoenix Edition' re-branding
2022-08-12 02:54:12 +02:00
Roland Heyder db6081b1ae Step 8: Rename other involved file extensions
- qb64*.bat, .sh, .command, .desktop, .sym to qb64pe*.* respectively
- Excludes mentions in the help (*.txt) files
2022-08-11 22:53:01 +02:00
Roland Heyder e68582b6f2 Step 7: Rename qb64.exe to qb64pe.exe
- Includes related LNX/OSX files
- Excludes mentions in the help (*.txt) files
2022-08-11 18:07:57 +02:00
Roland Heyder 0bd6afd389 Step 6: Rename qb64.bas to qb64pe.bas
Mentions in the help (*.txt) files are excluded.
2022-08-11 02:11:35 +02:00
Roland Heyder 4dd8d8f5ec Step 4: Update Windows icon & resource file
- int/src/icon.ico (replaced image but same name, dynamically created from given $EXEICON)
- int/src/icon.rc (updated but same name, dynamically created from given $VERSIONINFO)
- int/src/qb64.ico and src/icon.rc removed (not used anymore since dynamic creation was implemented)
- src/qb64.bas updated (rename comes in a later step)
- src/qb64.ico replaced and renamed
2022-08-10 02:03:12 +02:00
Roland Heyder 9b4b7992d4 Step 2: Update Linux icon file
Replaced and renamed icon file and moved it into the regular source folder, adjusted references in setup_lnx.sh
2022-08-10 00:48:56 +02:00
Roland Heyder c9e709bc68 Adjust blockquote color
Will use the "Comment color" of the current color scheme.
2022-08-02 14:49:11 +02:00
Roland Heyder 73debad50e Add plugin exchange for tables
If a template plugin is available for a table, then use it in the IDE help.
2022-08-02 13:36:10 +02:00
Roland Heyder b25c8b55a9 Improved help rendering
Headings enforce a blank line before it as separation to the previous section. Definition lists are rendered in blockquote style as in the Wiki, also enforce blank line separation.
2022-07-31 23:31:42 +02:00
Roland Heyder decdde5cdc Some more tweaks
Beside local #toc links also ignore #top links (top of page).
2022-07-20 16:23:18 +02:00
Roland Heyder 5a4687f1b4 Added some comments 2022-07-17 18:59:27 +02:00
Roland Heyder 4aff0cc49c Update plugins recursively
Update current page must include all used plugin templates, hence ignoring the cache for the whole process.
2022-07-17 00:34:51 +02:00
Roland Heyder d6d9c15a14 Added plugin templates
Works like $INCLUDE, but for help text. Meant to outsource recurring text into a template and plug it in where needed.
2022-07-16 23:42:05 +02:00
Roland Heyder 11dae1ccbf Fixed headings
Makes headings detection more reliable, also revised syntax notes.
2022-07-16 23:34:26 +02:00
github-actions[bot] 72d801e0cd Fix linking static libraries on Windows
In QB64, when linking with an external static library `nm.exe` is used
to determine whether the symbol being used is either a C or C++ symbol,
which determines how the function should be declared in the C++ code.

Unfortunately on Windows the `SHELL` command for `nm.exe` is missing the
`cmd /c`, which means the redirection does not work and consequently
we're unable to find the function declaration via `nm.exe`, which causes
the compilation to fail.

In addition to fixing this, I added tests for `DECLARE STATIC LIBRARY`
for all supported platforms.

Fixes: #112
2022-07-09 14:59:33 -04:00
github-actions[bot] 863029ddfd Math evaluator: values that round to zero can crash QB64pe
The math evaluator already contains a few checks for zero when we're
executing operations that could cause a `Divide By Zero` error, but the
actual value input is floating point and can get rounded to zero when
the operation happens. This effectively allows zero values to bypass the
checks to prevent them from being evaluated.

To avoid the error completely we need to check that the rounded value is
not zero, rather than the initial value. FIX() is used to make sure
values such a `-.1` round to zero and are avoided. I also applied FIX()
when we actually execute the operation, just to ensure the same
behavior.
2022-07-09 03:23:20 -04:00
Roland Heyder 04b3d5e42a Semi-support local links
Rather than declining page local links completely, simply link to the top of the respective page, except if it's on the currently displayed page.
2022-07-06 16:13:02 +02:00
Roland Heyder c20d80235f Improves table info box with direct link 2022-06-23 23:50:56 +02:00
Roland Heyder 5f039415bf Add plus (+) to the list of critical chars 2022-06-15 11:19:26 +02:00