Skip to content

pointers!#137

Merged
pointbazaar merged 15 commits intomasterfrom
pointer-type
Mar 2, 2025
Merged

pointers!#137
pointbazaar merged 15 commits intomasterfrom
pointer-type

Conversation

@pointbazaar
Copy link
Owner

resolves #134

Grammar Change:

 PointerType ::= '*' Type

 Type ::= BasicType | TypeParam | ArrayType | PointerType

The big choice here is whether to use prefix notation or postfix
notation.

prefix notation: "PointerType ::= '*' Type"
postfix notation: "PointerType ::= Type '*'"

The postfix notation is more of a convention in C/C++/...
but the prefix notation is also used in other languages.

Prefix notation has the advantage of being easier/faster to parse, but
is less conventional.

Choosing the prefix notation.

other changes:

- additional testcases for AST -> string functions like
  str_type, str_pointer_type, ...
@netlify
Copy link

netlify bot commented Mar 1, 2025

Deploy Preview for espl1000 ready!

Name Link
🔨 Latest commit 10a33ca
🔍 Latest deploy log https://app.netlify.com/sites/espl1000/deploys/67c398d5ab3e1100086e756a
😎 Deploy Preview https://deploy-preview-137--espl1000.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

	local int8 x;
	*int8 y = &x;

	*int8 z = &(*y);

This construction can be evaluated at compile-time as a special case.
checking that the following program works correctly.

 uint8 x = 75;
 return *(&x);
@pointbazaar pointbazaar merged commit 895db6f into master Mar 2, 2025
13 checks passed
@pointbazaar pointbazaar deleted the pointer-type branch March 2, 2025 00:19
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.

Add a proper pointer type

1 participant