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

new in-code docs parser #1322

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

alex-s168
Copy link
Contributor

@alex-s168 alex-s168 commented Mar 6, 2025

this does not work currently, and I do not know why. It parses documentation correctly, but after some time (during typechecking and maybe lowering), it just exits with Killed, and no error signal or anything. I think it might be related to the newly added AST nodes.
Please help

doc syntax

this should probably be moved to the lsts lang ref

## some text
## same paragraph, but new line
##
## new paragraph. **bold text**
## __same paragraph, but underlined__ .
##
## see [print]
##
## see [type(Vector<t>)]. type() is required because inside the square brackets is an LSTS expression
##
## [[attribute]]
## [[another-attribute: lsts-expression]]
## [[deprecated: "don't use this anymore lol"]]
some-code

the expected AST for the above:

Seq { some-code, Meta { DocMeta {
  Seq { Seq {
    DocParagraph { Seq { Seq { DocWord("some"), DocWord("text") }, DocWord("same") } .... },
    DocPagraph { ..., DocUnderline("same paragraph, but underlined") }
  },DocParagraph { Seq { DocWord("see"), AIdent("print") } }
   ...
  },
  { "attribute": None,
    "another-attribute": Some(lsts-expression),
    "deprecated": str-node }
} } }

TODO

Checklist before requesting a review

  • I have performed a self-review of my code
  • If it is a new feature, I have added thorough tests.
  • I agree to release these changes under the terms of the permissive MIT license (1).
  1. https://github.com/andrew-johnson-4/lambda-mountain/blob/main/LICENSE

@andrew-johnson-4
Copy link
Owner

"Killed" sounds like an infinite loop or infinite recursion.

@alex-s168
Copy link
Contributor Author

alex-s168 commented Mar 6, 2025

"Killed" sounds like an infinite loop or infinite recursion.

I think infinite recursion would have caused a signal that is captirable by the debugger

@alex-s168
Copy link
Contributor Author

actually maybe it was OOM?

@andrew-johnson-4
Copy link
Owner

If an infinite loop happens, then often times there will be allocations with no GC, leading to OOM.

@alex-s168
Copy link
Contributor Author

If an infinite loop happens, then often times there will be allocations with no GC, leading to OOM.

I don't think the infinite loop is in my code tho

@andrew-johnson-4
Copy link
Owner

Yes, possibly. Let me read code for a bit to see what is happening.

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.

2 participants