xavitator / nut-lang

MIT License
0 stars 0 forks source link

Iota Grammar #8

Open FauconFan opened 5 years ago

FauconFan commented 5 years ago

From @xavitator on July 6, 2018 21:56

This issue deals with Iota grammar :

In this state of the grammar, we could have in a file :

import 'ex1.nut' import "ex2" import 'ex3'

It is not throwing an error... We don't verify if the pointed file is in a good format (if it is a .nut file). Moreover, i think that is not really readable in this format, maybe this is more readable :

import 'ex1',"ex2","ex3"

Or

import "ex1" "ex2" "ex3"

To put it in a nutshell (#wordGame), i propose this Iota Grammar :

Iota_command
    None
    import_command '\n' Iota_command

import_command
    import string multiple_port

multiple_import
    None
    ',' String  (#koma before)
    ' ' String  (#space before)

The '\n' is the subject of an other issue.

Copied from original issue: Heijix/Warehouse#5

FauconFan commented 5 years ago

The .nut extension is not needed... Maybe we will force the fact that the file must be a nut file. But for the moment a correct file with no nut extension is accepted. So if we give a wrong file. The lexer or parser must cry.

For Iota Grammar, i thought something about that:

import 'ex1'
import 'ex2'
import 'ex3'

(multi-lines imports).

But the fact that we can have multiple include in one line is interesting, but not for now. It is more about cosmetic that the purpose of this language. Maybe we will come back on this later...

It it's okay for you, you can close this issue.