@@ -259,7 +259,12 @@ export enum NodeType {
259259 /**
260260 * {@link SquareExpression }.
261261 */
262- Square
262+ Square ,
263+
264+ /**
265+ * {@link IdentifierExpression }.
266+ */
267+ Identifier
263268}
264269
265270/**
@@ -341,6 +346,17 @@ export interface StringExpression extends Expression {
341346 value : string ;
342347}
343348
349+ /**
350+ * An expression that represents an alphabetical identifier. Uses type {@link NodeType.Identifier}. Contains the name of something.
351+ * @author efekos
352+ * @version 1.0.0
353+ * @since 0.0.2-alpha
354+ */
355+ export interface IdentifierExpression extends Expression {
356+ type : NodeType . Identifier ;
357+ name : string ;
358+ }
359+
344360/**
345361 * An expression that represents multiple statements inside braces (`{}`). Uses type {@link NodeType.Brace}.
346362 * @author efekos
@@ -395,7 +411,7 @@ export interface OperatorStatement extends Statement {
395411 * @since 0.0.1-alpha
396412 */
397413export interface KeywordStatement extends Statement {
398- word : string ;
414+ word : IdentifierExpression ;
399415 type : NodeType . Keyword ;
400416}
401417
@@ -408,7 +424,7 @@ export interface KeywordStatement extends Statement {
408424 */
409425export interface ImportsStatement extends Statement {
410426 type : NodeType . Imports ,
411- formats : string [ ] ;
427+ formats : IdentifierExpression [ ] ;
412428 module : string ;
413429}
414430
@@ -421,7 +437,7 @@ export interface ImportsStatement extends Statement {
421437 */
422438export interface CompileStatement extends Statement {
423439 type : NodeType . Compile ,
424- formats : string [ ] ,
440+ formats : IdentifierExpression [ ] ,
425441 body : Expression [ ] ;
426442}
427443
@@ -434,7 +450,7 @@ export interface CompileStatement extends Statement {
434450 */
435451export interface RuleStatement extends Statement {
436452 type : NodeType . Rule ;
437- rule : string ;
453+ rule : StringExpression ;
438454 value : unknown ;
439455}
440456
@@ -447,7 +463,7 @@ export interface RuleStatement extends Statement {
447463 */
448464export interface ImportStatement extends Statement {
449465 type : NodeType . Import ,
450- path : string ;
466+ path : StringExpression ;
451467}
452468
453469/**
@@ -459,7 +475,7 @@ export interface ImportStatement extends Statement {
459475 */
460476export interface FunctionStatement extends Statement {
461477 type : NodeType . Function ,
462- name : string ,
478+ name : IdentifierExpression ,
463479 arguments : string [ ] ;
464480 body : Statement [ ] ;
465481}
@@ -473,7 +489,7 @@ export interface FunctionStatement extends Statement {
473489 */
474490export interface GlobalStatement extends Statement {
475491 body : Statement [ ] ;
476- name : string ;
492+ name : IdentifierExpression ;
477493}
478494
479495
0 commit comments