Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Generated code needs a prefix to prevent clash #153

@mingodad

Description

@mingodad

After this reply #150 (comment) I started thinking about it and discovered that the code generated doesn't have any prefix and this can lead to name clash with internal function/variable names like:

create proc cql_finalize_stmt(obj integer not null)
begin
end;

Generates this Lua code:

--[[
CREATE PROC cql_finalize_stmt (obj INTEGER NOT NULL)
BEGIN
END;
--]]

function cql_finalize_stmt(obj)
  cql_contract_argument_notnull(obj, 1)


end

Generates this C code:

/*
CREATE PROC cql_finalize_stmt (obj INTEGER NOT NULL)
BEGIN
END;
*/

#define _PROC_ "cql_finalize_stmt"
#line 23
void cql_finalize_stmt(cql_int32 obj) {
#line 25 "lopp-pp.cql"

#line 25
}
#undef _PROC_
#line 27 "lopp-pp.cql"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions