aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-07-14 18:08:44 +0200
committerEugen Wissner <belka@caraus.de>2026-07-14 18:08:44 +0200
commita32a61813ebaecf0c1e69fd1481bf09d8c8b1420 (patch)
treeecfb6140075e3c46b599755e220dbf560de2e31d /include
parent51e2f98e33ae10fc3052335cc6847bc93d0784fa (diff)
downloadelna-a32a61813ebaecf0c1e69fd1481bf09d8c8b1420.tar.gz
Support more floating point literals
Diffstat (limited to 'include')
-rw-r--r--include/elna/boot/ast.h10
-rw-r--r--include/elna/boot/result.h35
-rw-r--r--include/elna/gcc/elna-diagnostic.h1
3 files changed, 30 insertions, 16 deletions
diff --git a/include/elna/boot/ast.h b/include/elna/boot/ast.h
index fbe65a4..04ffc22 100644
--- a/include/elna/boot/ast.h
+++ b/include/elna/boot/ast.h
@@ -533,11 +533,12 @@ namespace elna::boot
class traits_expression : public expression
{
public:
- std::vector<type_expression *> parameters;
+ const std::vector<type_expression *> arguments;
const std::string name;
std::vector<type> types;
- traits_expression(const struct position position, const std::string& name);
+ traits_expression(const struct position position, const std::string& name,
+ std::vector<type_expression *>&& arguments);
~traits_expression();
void accept(parser_visitor *visitor) override;
@@ -666,9 +667,10 @@ namespace elna::boot
designator_expression *m_callable;
public:
- std::vector<expression *> arguments;
+ const std::vector<expression *> arguments;
- procedure_call(const struct position position, designator_expression *callable);
+ procedure_call(const struct position position, designator_expression *callable,
+ std::vector<expression *>&& arguments);
void accept(parser_visitor *visitor) override;
virtual procedure_call *is_call_expression() override;
diff --git a/include/elna/boot/result.h b/include/elna/boot/result.h
index 1b04bfb..0556dbe 100644
--- a/include/elna/boot/result.h
+++ b/include/elna/boot/result.h
@@ -26,15 +26,33 @@ along with GCC; see the file COPYING3. If not see
namespace elna::boot
{
/**
- * Position in the source text.
+ * Location in the source text.
*/
- struct position
+ struct location
{
/// Line.
- std::size_t line = 1;
+ const std::size_t line;
/// Column.
- std::size_t column = 1;
+ const std::size_t column;
+
+ location(std::size_t line, std::size_t column);
+
+ bool available() const;
+ };
+
+ /**
+ * Span in the source text.
+ */
+ struct position
+ {
+ /// Start location.
+ const location start;
+
+ /// End location.
+ const location end;
+
+ position(location start, location end);
};
/**
@@ -46,18 +64,11 @@ namespace elna::boot
error(const struct position position);
public:
+ /// Error position.
const struct position position;
- virtual ~error() = default;
-
/// Error text.
virtual std::string what() const = 0;
-
- /// Error line in the source text.
- std::size_t line() const;
-
- /// Error column in the source text.
- std::size_t column() const;
};
using error_list = typename std::deque<std::unique_ptr<error>>;
diff --git a/include/elna/gcc/elna-diagnostic.h b/include/elna/gcc/elna-diagnostic.h
index a8d4a69..3957003 100644
--- a/include/elna/gcc/elna-diagnostic.h
+++ b/include/elna/gcc/elna-diagnostic.h
@@ -42,6 +42,7 @@ namespace elna::gcc
};
location_t get_location(const boot::position *position);
+ void fill_range(const boot::position& position, location_t& start, location_t& end);
std::string print_type(tree type);
void report_errors(const std::deque<std::unique_ptr<boot::error>>& errors);
}