You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 24, 2020. It is now read-only.
It should be possible to validate that the given AST is valid for a given version of Lua by casting between ASTs.
For example:
let ast = parse(source);let ast_5_1 = ast.to_version_5_1().expect("Source was not valid Lua 5.1! (maybe it used goto?)");let new_ast = ast_5_1.to_version_agnostic();// What do we call this?assert_eq!(ast, new_ast);
The text was updated successfully, but these errors were encountered:
The alternative to this would be to keep every version of Lua using the same AST types, but just have validation functions to check for features you can't use in your target version.
Then we might be able to avoid the maintenance hell of trying to keep all these ASTs in sync at the expense of version-specific tools having to verify that the AST doesn't contain unknown nodes.
It should be possible to validate that the given AST is valid for a given version of Lua by casting between ASTs.
For example:
The text was updated successfully, but these errors were encountered: