1.0.5 • Published 2 years ago

marwan.akhandaf v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Grammar

keywords

var : 'var' let : 'let' const : 'const' function : 'function' return : 'return' import : 'import' from : 'from' as : 'as'

statement : block | variableStatement | functionDeclaration | returnStatement | importStatement ;

block : '{' statementList? '}' ;

statementList : statement+ ;

variableStatement

variableStatement : varModifier '=' variablepossible ;

varModifier : var | let | const ;

variablepossible : literal ;

string : A-Za-z0-9+ ;

onlyAlpha : A-Za-z+ ;

integer :0-9+ ;

boolean :'true' |'false' ;

htmlTagName : 'h1' : 'p' : 'strong' ;

functionDeclaration

functionDeclaration : function onlyAlpha '(' parameterList? ')' '{' functionBody '}' ;

parameterList : parameterArg (',' parameterArg)* ;

parameterArg : varModifier string ('=' variablepossible)? ;

functionBody :statementList? ;

returnStatement

returnStatement : return '(' htmlElements ')' | return variablepossible ;

htmlElements : htmlElement+ ;

htmlElement : '<' htmlTagName '>' htmlContent '<''/' htmlTagName '>' | '<' htmlTagName '/''>' | '<' htmlTagName '>' ;

nested html

htmlContent : (string | htmlElement)+
;

importStatement

importStatement : import importFromBlock ;

importFromBlock : (importNamespace | moduleItems) importFrom ;

importNamespace : ('*' | onlyAlpha) (as onlyAlpha)? ;

moduleItems : '{' (onlyAlpha ',')* (onlyAlpha ','?)? '}' ;

importFrom : from '\"'string'\"' ;

nog doen

literals

literal : stringLiteral | numberLiteral | booleanLiteral ;

stringLiteral : '\'' string '\'' | '"' string '"' ;

numberLiteral : integer | float ;

booleanLiteral : 'true' | 'false' ;

pair 
: stringLiteral ':' literal
;
1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago