-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: WIP syntax highlighting, new logo, remooved some beacon refere…
…nces
- Loading branch information
Showing
17 changed files
with
151 additions
and
51 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion
2
Beacon/Components/SwiftUIInput.swift → Beacon/Components/ReplInput.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// | ||
// History.swift | ||
// Beacon | ||
// Arrayground | ||
// | ||
|
||
import Foundation | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
// | ||
// Beacon-Bridging-Header.h | ||
// Beacon | ||
// | ||
// Arrayground | ||
// | ||
|
||
#ifndef Beacon_Bridging_Header_h | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// | ||
// LexK.swift | ||
// Arrayground | ||
// | ||
|
||
import SwiftUI | ||
|
||
enum TokenType { | ||
case number, function, variable, string, statement, comment, other | ||
} | ||
|
||
struct Token { | ||
let value: String | ||
let type: TokenType | ||
} | ||
|
||
func tokenize(code: String) -> [Token] { | ||
var tokens: [Token] = [] | ||
var currentToken = "" | ||
var isComment = false | ||
var isString = false | ||
|
||
for char in code { | ||
if isComment { | ||
currentToken.append(char) | ||
if char == "\n" { | ||
tokens.append(Token(value: currentToken, type: .comment)) | ||
currentToken = "" | ||
isComment = false | ||
} | ||
continue | ||
} | ||
|
||
if isString { | ||
currentToken.append(char) | ||
if char == "\"" { | ||
tokens.append(Token(value: currentToken, type: .string)) | ||
currentToken = "" | ||
isString = false | ||
} | ||
continue | ||
} | ||
|
||
if char == "#" || char == "/" { | ||
isComment = true | ||
currentToken.append(char) | ||
continue | ||
} | ||
|
||
if char == "\"" { | ||
isString = true | ||
currentToken.append(char) | ||
continue | ||
} | ||
|
||
if char.isWhitespace { | ||
if !currentToken.isEmpty { | ||
tokens.append(Token(value: currentToken, type: determineType(token: currentToken))) | ||
} | ||
currentToken = "" | ||
} else { | ||
currentToken.append(char) | ||
} | ||
} | ||
|
||
if !currentToken.isEmpty { | ||
tokens.append(Token(value: currentToken, type: determineType(token: currentToken))) | ||
} | ||
|
||
return tokens | ||
} | ||
|
||
func determineType(token: String) -> TokenType { | ||
if Double(token) != nil { | ||
return .number | ||
} | ||
if token.last == ":" { | ||
return .function | ||
} | ||
if token.first?.isLetter == true { | ||
return .variable | ||
} | ||
if token == ":" { | ||
return .statement | ||
} | ||
return .other | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
// | ||
// Utils.swift | ||
// Beacon | ||
// | ||
// | ||
// Arrayground | ||
// | ||
|
||
import Foundation | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
// | ||
// k.h | ||
// Beacon | ||
// | ||
// Arrayground | ||
// | ||
|
||
#ifndef k_h | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// | ||
// BuffersView.swift | ||
// Beacon | ||
// Arrayground | ||
// | ||
|
||
import SwiftUI | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// | ||
// ConfigView.swift | ||
// Beacon | ||
// Arrayground | ||
// | ||
|
||
import SwiftUI | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// | ||
// DashboardView.swift | ||
// Beacon | ||
// Arrayground | ||
// | ||
|
||
import Charts | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// | ||
// HelpView.swift | ||
// Beacon | ||
// Arrayground | ||
// | ||
|
||
import Foundation | ||
|