Goose  Diff

Differences From Artifact [e6cb1a1cb6]:

  • File bs/builtins/statements/hif.cpp — part of check-in [55beba911a] at 2021-09-12 16:48:57 on branch trunk —
    • Started work on extensibility api
    • some code cleanup
    (user: achavasse size: 5124)

To Artifact [00c181d56c]:

  • File bs/builtins/statements/hif.cpp — part of check-in [bf81e30984] at 2021-09-18 17:00:20 on branch trunk —
    • Refactored LocationId into a separate class and actually use it everywhere instead of uint32_t, this makes it easier to make generic wrappers for APIs
    • g0 api: more work on the CIR api
    (user: achavasse size: 5126)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "builtins/builtins.h"
#include "parse/parse.h"
#include "precedence.h"
#include "builtins/helpers.h"

using namespace goose;
using namespace goose::eir;
using namespace goose::parse;

namespace goose::builtins
{
    void SetupHIfStmt( Env& e )
    {
        auto handleHIf = []( Parser& p, uint32_t locationId, uint32_t prec )
        {
            auto& dm = DiagnosticsManager::GetInstance();

            auto np = p.makeNestedParser();
            if( !np.parseExpression( precedence::IfStmt ) )
            {
                dm.emitSyntaxErrorMessage( locationId, "expected an expression following the #if statement1.", 0 );













|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "builtins/builtins.h"
#include "parse/parse.h"
#include "precedence.h"
#include "builtins/helpers.h"

using namespace goose;
using namespace goose::eir;
using namespace goose::parse;

namespace goose::builtins
{
    void SetupHIfStmt( Env& e )
    {
        auto handleHIf = []( Parser& p, LocationId locationId, uint32_t prec )
        {
            auto& dm = DiagnosticsManager::GetInstance();

            auto np = p.makeNestedParser();
            if( !np.parseExpression( precedence::IfStmt ) )
            {
                dm.emitSyntaxErrorMessage( locationId, "expected an expression following the #if statement1.", 0 );