Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 29 additions & 23 deletions builtin.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
bracket: \((.+)\) # Get content inside bracket

operator: ~(?:\+|-|\*|\\)~ # Arithmetic operators

#To match indented code
ind: (\n(?:((?:\t|\s)+)).*(?:(?:\n\ # For multiline

ent: .*)*\n*)*) # End line
#It give two tokens(1-indented code,2-tab used for indentation)
#Usage: <ind>No of tokens before+2<ent>
#Example
#regex: fun (\w+)<bracket>:<ind>4<ent>
#tokens: [funame,args,code,tab]

tab: ^((?:\t|\s)*) # Match tab/space

indentation: (\t|\s) # Indentation characters

number: (\d+(?:\.\d+)?) # Match numbers

string: ("(?:[^"\\]|\\.)*") # Match double-quoted strings

comment: (#[^\n]*) # Match single-line comments
expressions:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes the error in test.
can't use categories

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@B-R-P, If I remove the list and dict then will it be ok.


bracket: "\\((.+)\\)" # Get content inside bracket

operator: "~(?:\\+|-|\\*|\\\\)~" # Arithmetic operators

ind: >
(\n(?:((?:\t|\\s)+)).*(?:(?:\\n\\ # For multiline
ent: .*)*\\n*)*) # End line

tab: "^((?:\\t|\\s)*)" # Match tab/space

indentation: "(\\t|\\s)" # Indentation characters

number: "(\\d+(?:\\.\\d+)?)" # Match numbers

string: "(\"(?:[^\"\\\\]|\\\\.)*\")" # Match double-quoted strings

comment: "(#[^\\n]*)" # Match single-line comments

integer: "-?\\d+" # Match integers

float: "-?\\d+\\.\\d+" # Match floating-point numbers

boolean: "true|false" # Match boolean values

null: "null" # Match null value
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed


key: "\\w+:" # Match keys in key-value pairs