public inbox for ~johnnyrichard/olang-devel@lists.sr.ht
 help / color / mirror / code / Atom feed
From: Johnny Richard <johnny@johnnyrichard.com>
To: ~johnnyrichard/olang-devel@lists.sr.ht
Cc: Johnny Richard <johnny@johnnyrichard.com>
Subject: [PATCH olang v2 0/4] add support to compile if statements
Date: Sun,  8 Sep 2024 03:10:54 +0200	[thread overview]
Message-ID: <20240908011512.152684-2-johnny@johnnyrichard.com> (raw)

This first interaction we implemented compilation for simple _if_
statements without _else_  and _else-if_ support.

V2: I changed patch manually and it corrupted the object id and the
    patch as a whole.

Supersedes
  - Message-ID: <20240908003402.145538-1-johnny@johnnyrichard.com>

Carlos Maniero (2):
  lexer: add support to if token
  parser: parse a simple if statement

Johnny Richard (2):
  codegen: x86_64: add support to emit if statements
  codegen: x86_64: add if cond support for literals

 src/ast.c                                     | 13 +++
 src/ast.h                                     | 11 +++
 src/codegen_linux_x86_64.c                    | 64 +++++++++++----
 src/lexer.c                                   |  5 ++
 src/lexer.h                                   |  1 +
 src/parser.c                                  | 79 ++++++++++++++++++-
 src/pretty_print_ast.c                        | 14 ++++
 tests/integration/tests/0020_if_statement.ol  | 43 ++++++++++
 .../tests/0021_if_statement_failed.ol         | 24 ++++++
 .../tests/0022_if_statement_literal.ol        | 24 ++++++
 10 files changed, 260 insertions(+), 18 deletions(-)
 create mode 100644 tests/integration/tests/0020_if_statement.ol
 create mode 100644 tests/integration/tests/0021_if_statement_failed.ol
 create mode 100644 tests/integration/tests/0022_if_statement_literal.ol


base-commit: 83b791b252e46b6bf081bcd75c8e34c03c45681f
-- 
2.46.0


             reply	other threads:[~2024-09-07 23:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-08  1:10 Johnny Richard [this message]
2024-09-07 23:23 ` Carlos Maniero
2024-09-08  1:10 ` [PATCH olang v2 1/4] lexer: add support to if token Johnny Richard
2024-09-08  1:10 ` [PATCH olang v2 2/4] parser: parse a simple if statement Johnny Richard
2024-09-08  1:10 ` [PATCH olang v2 3/4] codegen: x86_64: add support to emit if statements Johnny Richard
2024-09-08  1:10 ` [PATCH olang v2 4/4] codegen: x86_64: add if cond support for literals Johnny Richard
2024-09-08  1:36 ` [PATCH olang v2 0/4] add support to compile if statements Johnny Richard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240908011512.152684-2-johnny@johnnyrichard.com \
    --to=johnny@johnnyrichard.com \
    --cc=~johnnyrichard/olang-devel@lists.sr.ht \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.johnnyrichard.com/olang.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox