Skip to content

Strict syntax#11

Open
Kisioj wants to merge 4 commits intoLehona:devfrom
Kisioj:strict-syntax
Open

Strict syntax#11
Kisioj wants to merge 4 commits intoLehona:devfrom
Kisioj:strict-syntax

Conversation

@Kisioj
Copy link
Copy Markdown

@Kisioj Kisioj commented Jul 7, 2019

I am main developer of Daedalus Compiler https://github.com/dzieje-khorinis/DaedalusCompiler and we would prefer to support more strict syntax of Daedalus than original compiler. We prefer not to use keywords like class, instance, var as identifiers (names of variables, attributes, functions, parameters etc.). We also do not like syntax: var int x, var int y; instead we would like to change it to var int x; var int y; (We also currently support var int x, y;). Also, we don't like single expression return hacks (because it's abusing the engine) but since it's essential to use in Ikarus & Lego, we allowed having lines like expression;. These lines give warnings tough (errors in --strict mode). However we implemented special comments to suppress these warnings. They have syntax like this: //suppress: WARNING_CODE [ WARNING_CODE]* and can be used to suppress warnings with selected codes for whole file (if this comment is in first line of file) or can be used to suppress warnings per line like this:

var int x;
x; //suppress: W1

Our compiler already successfully compiles Gothic2NotR and Basic Ikarus&Lego project. Results (.dat files) are the same as generated by original compiler. Here's TestCase proving that: https://github.com/dzieje-khorinis/DaedalusCompiler/blob/master/test/DaedalusCompiler.Tests/OutputComparisonTests.cs

The reason for this PR is because we would like to make Ikarus & LeGo compatible with our compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant