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

Add erl_scan #1342

Open
wants to merge 1 commit into
base: release-0.6
Choose a base branch
from
Open

Conversation

jakub-gonet
Copy link
Contributor

@jakub-gonet jakub-gonet commented Oct 15, 2024

  • Vendors erl_scan and erl_anno in.
  • Adds a stub of erl_features

This is a part of work that ultimately will allow building REPL in the AtomVM in the browser.
Next is adding erl_parse along with intermediate compiling .yrl to CMake and then adding simple REPL implementation (not supporting modules as they depend on code module) to webasm.

Currently, it uses unsupported line tag 19. I'm not accustomed with stacktraces yet so I'm waiting for the initial feedback to solve this issue.

Oneliner to find module's static deps: cat erl_scan.erl | egrep -o '\w+:\w+' | egrep -v "error:|_:|m:" | sort | uniq | cut -f1 -d":"

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later


-export([keywords/0]).

keywords() -> ['maybe', 'else'].
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably needs a config option based on different OTP versions. Not sure what's the policy of supported OTP versions here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed more stubs for Cardputer example code: all/0 and configurable/0

https://github.com/pguyot/cardputer_erlang/blob/main/src/erl_features.erl

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave them for now, we can add them in another PR. Especially after we decide if we need counterpart to init module.

@jakub-gonet jakub-gonet force-pushed the jgonet/erl_scan branch 2 times, most recently from ea0519a to 28dc5c6 Compare October 15, 2024 13:58
@jakub-gonet
Copy link
Contributor Author

jakub-gonet commented Oct 15, 2024

I guess I have to remove all unsupported attributes (like -doc) from vendored code and replace it with doxygen comments?

Will mark this PR as a draft after initial feedback. Waiting for CI to add license identifier to files.

@pguyot
Copy link
Collaborator

pguyot commented Oct 15, 2024

I guess I have to remove all unsupported attributes (like -doc) from vendored code and replace it with doxygen comments?

Will mark this PR as a draft after initial feedback. Waiting for CI to add license identifier to files.

You could use a macro that generates an empty attribute before OTP27 and the doc attribute from OTP27. I've seen this trick on a slide at CodeBEAM Europe 2024.

@UncleGrumpy
Copy link
Collaborator

For the time being we are still using edoc, so the new -doc() style isn't supported by our build system. I would love to move to ex_doc, this will require some planning and effort to coordinate.

Signed-off-by: Jakub Gonet <[email protected]>
@jakub-gonet jakub-gonet changed the base branch from main to release-0.6 October 16, 2024 14:23
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

Successfully merging this pull request may close these issues.

3 participants