as2js: Todo List

as2js  0.1.14
AlexScript to JavaScript
Todo List
Member as2js::as2js_library_version ()
Add another function that checks whether your code is compatible with this library.
Member as2js::FileOutput::open (String const &filename)
Generate an error message for why the file could not be opened.
Member as2js::Node::add_variable (pointer_t variable)
Add a test of the node type so we can make sure we do not call this function on nodes that cannot have variables. For that purpose, we need to know what those types are.
Member as2js::Node::get_variable (int index) const

Add a test of the node type so we can make sure we do not call this function on nodes that cannot have variables.

The returned pointer may be a null pointer since we use a weak pointer for variables.

Member as2js::Node::get_variable_size () const
Add a test of the node type so we can make sure we do not call this function on nodes that cannot have variables.
Member as2js::Node::string_to_operator (String const &str)

The table is sorted by type_t::NODE_... value. It would be good to create another table sorted by name. We could declare a static table which gets initialized on a first call to this function. Then we could also make use of the binary search here.

This is a TBD, I think it is okay, but the compiler may need some tweaking to work... It seems that the ++x and x++ (and corresponding –) won't work right. We should be able to detect that once we try to declare such operators in a class. The "x" is nice when outputing the result, but it is problematic when searching for a node type. However, we certainly have to add it anyway depending on whether the function has a parameter or not because otherwise we cannot know whether it is a pre- or a post-increment or -decrement.

Member as2js::Node::to_as ()
We will need to verify that this is correct and does not introduce other problems. However, remember that we do not use prototypes in our world. We have well defined classes so it should work just fine.
Member as2js::Node::verify_flag (flag_t f) const
Move some of the external tests (tests done by code in other places like the parser) to here because some flags are mutally exclusive and we should prevent such from being set simultaneously.
Member as2js::optimizer_details::anonymous_namespace{optimizer_optimize.cpp}::optimizer_func_DIVIDE (node_pointer_vector_t &node_array, optimization_optimize_t const *optimize)
Should we always return a floating point number when dividing? At this point two integers return an integer unless the divisor is zero in which case +/-Infinity is returned.
Member as2js::optimizer_details::optimize_tree (Node::pointer_t node)
Look into losing the recusirve aspect of this function (so the entire tree of nodes gets checked.)
Member as2js::Options::OPTION_JSON
This is not yet fully implemented.
Member as2js::Position::set_filename (String const &filename)
Test that the filename is valid (no '\0', mainly.)
Member as2js::String::is_float64 () const
Ameliorate the test so if no digits are present where required then an error is emitted (i.e. you may have '0.', '.0' but not just '.'; same problem with exponent).
Member as2js::String::operator+= (wchar_t const c)
Under MS-Windows the character is viewed as UTF-16, only we do not properly manage surrogates in this case (i.e. if you just added another surrogate, concatenate both surrogates in one UTF-32 character.)
Member as2js::String::to_utf8 () const
This String object is expected to not have any invalid characters so this function always returns the conversion even if it finds invalid characters.
Member as2js::String::valid () const
We are actually transforming the String object to properly check all of its characters as added to the buffer so this function should become obsolete at some point.
File node_compare.cpp
Implement a compare of object and array literals.
File node_flag.cpp

The conversion functions do not take flags in account. As far as I know, at this point we cannot convert a node of a type that accept a flag except with the to_unknown() function in which case flags become irrelevant anyway. We should test that the flags remain valid after a conversion.

Mutually exclusive flags are not currently verified in this code when it should be.

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.

Syndicate content

Snap! Websites
An Open Source CMS System in C++

Contact Us Directly