Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

Scripting builtins #3

Open
15 tasks
ThibautHH opened this issue Apr 8, 2023 · 0 comments
Open
15 tasks

Scripting builtins #3

ThibautHH opened this issue Apr 8, 2023 · 0 comments
Assignees
Labels
feature New functionnality or request
Milestone

Comments

@ThibautHH
Copy link
Owner

Scripting builtins

Implement if, while and foreach control structures and the special expression syntax.

Control structures

  • if (<expr>) then ... [else ... ]endif
  • while (<expr>) ... end
  • foreach <var> (<words>) ... end

Expressions

  • Mathematical operators (+, -, *, /, %)
  • + and - are right-associative
  • Comparison operators (==, !=, <, <=, >, >=)
  • == and != compare strings; the rest, numbers
  • Pattern matching operators (=~, !~)
  • Regex engine?
  • Logical operators (&&, ||, !)
  • Bit-wise and bitshift operators (~, &, |, ^, <<, >>)
  • Precedence override (())
    Null or missing operands are considered to be 0.

File inquiries (-<letter> <file>)

  • r, w, x: Read, write and execute permissions respectively
  • o: Have ownership
  • e: Is (Existence)
  • z: Is empty (zero size file)
  • f: Is regular file
  • d: Is directory
@ThibautHH ThibautHH added the feature New functionnality or request label Apr 8, 2023
@ThibautHH ThibautHH added this to the Extra Part milestone Apr 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionnality or request
Projects
None yet
Development

No branches or pull requests

2 participants