Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attributes within Declarations #400

Closed
Clashsoft opened this issue Sep 9, 2018 · 0 comments
Closed

Attributes within Declarations #400

Clashsoft opened this issue Sep 9, 2018 · 0 comments
Assignees
Labels
epic:Syntax Changes to the syntax of the language module:Compiler Implementation requires major changes to the compiler type:Feature New functionality
Milestone

Comments

@Clashsoft
Copy link
Member

Extend declaration parsers to allow attributes after the declarator keyword, as shown in the example below.

Example

	// --------------- Functions ---------------

	inline func f1() -> int throws Exception = 1

	func f2() inline -> int throws Exception = 2

	func f3() -> int inline throws Exception = 3

	// func f4() -> int throws Exception inline = 4 // error for now

	// func f5() -> int throws Exception = 5 inline // error

	// --------------- Variables ---------------

	private var v1: int = 1

	var v2 private : int = 2

	var v3: int private = 3

	// var v4: int = 4 private // error

	// --------------- Properties ---------------

	private var p1: int { get: 1; set(v): {} }

	var p2 private : int { get: 2; set(v): {} }

	var p3: int private { get: 3; set(v): {} }

	var p4: int { private get: 4; private set(v): {} }

	var p5: int { get private: 5; set(v) private: {} }

	// var p6: int { get private: 6; set private (v): {} } // error

	// var p7: int { get: 7 } private // error

	// --------------- Constructor ---------------

	public init(i1: int) : super() throws Exception {}

	// init() public : super() throws Exception {} // error

	init(i1: int, i2: int) : super() public throws Exception {}

	// init() : super() throws Exception public {} // error for now
@Clashsoft Clashsoft added this to the v0.40.0 milestone Sep 9, 2018
@Clashsoft Clashsoft self-assigned this Sep 9, 2018
@Clashsoft Clashsoft added module:Compiler Implementation requires major changes to the compiler type:Enhancement Enhancements to exisiting functionality and small features epic:Syntax Changes to the syntax of the language status:Upcoming Implemented and scheduled for the next release labels Sep 9, 2018
Clashsoft added a commit that referenced this issue Sep 9, 2018
comp: Extended declaration parsers to allow attributes within the declaration. #400
comp: Extended the property body parser to allow attributes after after `get` and after the setter parameter name. #400
(test): Added the `DeclarationTest`.

Closes #400
@Clashsoft Clashsoft added type:Feature New functionality and removed type:Enhancement Enhancements to exisiting functionality and small features labels Sep 23, 2018
@Clashsoft Clashsoft removed the status:Upcoming Implemented and scheduled for the next release label Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic:Syntax Changes to the syntax of the language module:Compiler Implementation requires major changes to the compiler type:Feature New functionality
Projects
None yet
Development

No branches or pull requests

1 participant