Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move C runtime to new parsing machine design #41

Open
orlandohill opened this issue Jul 13, 2017 · 4 comments
Open

Move C runtime to new parsing machine design #41

orlandohill opened this issue Jul 13, 2017 · 4 comments

Comments

@orlandohill
Copy link
Collaborator

Based on the in-progress Java version? Also see the new JavaScript version.

@glebm
Copy link
Contributor

glebm commented Aug 20, 2017

Would be nice if the AST substrings are slices into the original string (char *, size_t), to improve memory-usage and performance.

@orlandohill
Copy link
Collaborator Author

Yes, makes sense.

Would the idea be to change AST_CHAR to AST_SPLICE, or to add AST_SPLICE as a new type? Something else entirely?

@glebm
Copy link
Contributor

glebm commented Aug 22, 2017

Yes, something like that.

Something like AST_CHARS, containing a string_view (naming matches C++
std::string_view, alternative name: chars_view):

typedef struct _string_view {
  // Does not own the pointer
  char *pointer;
  size_t size;
} string_view;

Ideas for naming:

  • AST_CHARS_SLICE
  • AST_STRING_SLICE
  • AST_CHARS

The AST_CHAR type would then be removed.

@orlandohill
Copy link
Collaborator Author

Sounds good. AST_CHARS seems suitably short and descriptive.

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

No branches or pull requests

2 participants