Skip to content

Guard identifier on compiled JS #9

Open
@pveyes

Description

Currently we can use any reserved word/token (such as var, if, etc) as identifier in naskah which won't be valid JS. The simplest thing we can do is add underscore before printing the identifier if it's a reserved word in JS

So that:

misal x = 3;
misal var = 2;

jika while benar {
} 

should be compiled to

var x = 3;
var _var = 2;

if (_while == true) {
}

Activity

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

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions