Skip to content

Remove nothrow and data from the 1.4 grammar#425

Open
mandolaerik wants to merge 3 commits intointel:mainfrom
mandolaerik:pr/remove-nothrow-and-data-from-the-1-4-grammar
Open

Remove nothrow and data from the 1.4 grammar#425
mandolaerik wants to merge 3 commits intointel:mainfrom
mandolaerik:pr/remove-nothrow-and-data-from-the-1-4-grammar

Conversation

@mandolaerik
Copy link
Contributor

@mandolaerik mandolaerik commented Mar 4, 2026

No description provided.

@syssimics syssimics requested a review from lwaern-intel March 4, 2026 15:26
@mandolaerik
Copy link
Contributor Author

urgh, I get a failure if I apply this:

--- a/test/1.2/misc/porting.dml
+++ b/test/1.2/misc/porting.dml
@@ -416,7 +416,7 @@ template evt {
     method get_event_info(void *data) -> (attr_value_t attr) {
         attr = SIM_make_attr_nil();
     }
-    method set_event_info(attr_value_t attr) -> (void *data) {
+    method set_event_info(attr_value_t attr) -> (void *session) {
     }
     method destroy(void *data) {}
     method event(void *data) {}
diff --git a/test/1.4/misc/porting.dml b/test/1.4/misc/porting.dml
index d86cd81b..7f422998 100644
--- a/test/1.4/misc/porting.dml
+++ b/test/1.4/misc/porting.dml
@@ -431,8 +431,8 @@ template evt is event {
         return SIM_make_attr_nil();
     }
     method set_event_info(attr_value_t attr) -> (void *) {
-        local void *data;
-        return data;
+        local void *session;
+        return session;
     }
     method destroy(void *data) {}
     method event(void *data) {}

@mandolaerik mandolaerik force-pushed the pr/remove-nothrow-and-data-from-the-1-4-grammar branch from 8d00094 to 69eab79 Compare March 4, 2026 15:45
@mandolaerik
Copy link
Contributor Author

Never mind, session fails because it is not a valid variable name in 1.4, so that's not a relevant use case (port-dml will create broken DML, but that's ok). Changed outarg name from data to param to cover the same corner of the port_dml script.

@syssimics
Copy link
Contributor

PR Verification: ✅ success

keywords_dml12[kw] = kw.upper()
tokens += (kw.upper(),)
reserved_idents = reserved_idents_common + (kw.upper(),)
reserved_idents = reserved_idents + (kw.upper(),)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait so the old code failed to properly have PARAMETER as part of reserved_idents? That's hilarious. Given how DML 1.2 code has clearly adapted to this, I'd vote for keeping parameter restricted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vote against that because it complicates code for no gain. The gain of keeping it reserved is to open for extending syntax in some ways, like allowing parameter declarations inside methods, and if we ever will want to do that kind of change, then it will be 1.4 exclusive.

'parameter' was forbidden by mistake as identifier in DML 1.2
@mandolaerik mandolaerik force-pushed the pr/remove-nothrow-and-data-from-the-1-4-grammar branch from 69eab79 to 0651354 Compare March 5, 2026 21:41
@syssimics syssimics requested a review from lwaern-intel March 5, 2026 21:42
@syssimics
Copy link
Contributor

PR Verification: ✅ success

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.

3 participants